FreeBASIC  0.91.0
gfx_win32.c File Reference
#include "../fb_gfx.h"
#include "fb_gfx_win32.h"
#include "../../rtlib/win32/fb_private_console.h"
#include <process.h>
Include dependency graph for gfx_win32.c:

Go to the source code of this file.

Data Structures

struct  keyconvinfo
 

Macros

#define WM_MOUSEENTER   WM_USER
 
#define WM_XBUTTONDOWN   523
 
#define WM_XBUTTONUP   524
 
#define WM_XBUTTONDBLCLK   525
 
#define WM_MOUSEHWHEEL   526
 
#define MK_XBUTTON1   32
 
#define MK_XBUTTON2   64
 
#define MONITOR_DEFAULTTONEAREST   0x00000002
 

Typedefs

typedef struct keyconvinfo KEYCONVINFO
 

Functions

static void keyconv_clear (KEYCONVINFO *k)
 
static void keyconv_grow (KEYCONVINFO *k, int nchars, int charsize)
 
static unsigned int hIntlConvertChar (int key, int source_cp, int dest_cp)
 
static void fb_hSetMouseClip (void)
 
static void ToggleFullScreen (void)
 
static VOID CALLBACK fb_hTrackMouseTimerProc (HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime)
 
static BOOL WINAPI fb_hTrackMouseEvent (TRACKMOUSEEVENT *e)
 
LRESULT CALLBACK fb_hWin32WinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
void fb_hHandleMessages (void)
 
int fb_hInitWindow (DWORD style, DWORD ex_style, int x, int y, int w, int h)
 
int fb_hWin32Init (char *title, int w, int h, int depth, int refresh_rate, int flags)
 
void fb_hWin32Exit (void)
 
void fb_hWin32Lock (void)
 
void fb_hWin32Unlock (void)
 
void fb_hWin32SetPalette (int index, int r, int g, int b)
 
void fb_hWin32WaitVSync (void)
 
int fb_hWin32GetMouse (int *x, int *y, int *z, int *buttons, int *clip)
 
void fb_hWin32SetMouse (int x, int y, int cursor, int clip)
 
void fb_hWin32SetWindowTitle (char *title)
 
int fb_hWin32SetWindowPos (int x, int y)
 
void fb_hScreenInfo (ssize_t *width, ssize_t *height, ssize_t *depth, ssize_t *refresh)
 
ssize_t fb_hGetWindowHandle (void)
 

Variables

WIN32DRIVER fb_win32
 
const GFXDRIVER__fb_gfx_drivers_list []
 
struct {
   const char *   name
 
   FARPROC *   proc
 
user32_procs []
 
static CRITICAL_SECTION update_lock
 
static HANDLE handle
 
static BOOL screensaver_active
 
static BOOL cursor_shown
 
static BOOL has_focus = FALSE
 
static int last_mouse_buttons
 
static int mouse_buttons
 
static int mouse_wheel
 
static int mouse_hwheel
 
static int mouse_x
 
static int mouse_y
 
static int mouse_on
 
static POINT last_mouse_pos
 
static KEYCONVINFO keyconv1 = {{NULL}, 0}
 
static KEYCONVINFO keyconv2 = {{NULL}, 0}
 

Macro Definition Documentation

#define MK_XBUTTON1   32

Definition at line 21 of file gfx_win32.c.

#define MK_XBUTTON2   64

Definition at line 22 of file gfx_win32.c.

#define MONITOR_DEFAULTTONEAREST   0x00000002

Definition at line 26 of file gfx_win32.c.

#define WM_MOUSEENTER   WM_USER

Definition at line 8 of file gfx_win32.c.

#define WM_MOUSEHWHEEL   526

Definition at line 17 of file gfx_win32.c.

#define WM_XBUTTONDBLCLK   525

Definition at line 13 of file gfx_win32.c.

#define WM_XBUTTONDOWN   523

Definition at line 11 of file gfx_win32.c.

#define WM_XBUTTONUP   524

Definition at line 12 of file gfx_win32.c.

Typedef Documentation

typedef struct keyconvinfo KEYCONVINFO

Definition at line 65 of file gfx_win32.c.

Function Documentation

ssize_t fb_hGetWindowHandle ( void  )

Definition at line 764 of file gfx_win32.c.

void fb_hHandleMessages ( void  )

Definition at line 488 of file gfx_win32.c.

Here is the caller graph for this function:

int fb_hInitWindow ( DWORD  style,
DWORD  ex_style,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 497 of file gfx_win32.c.

Here is the caller graph for this function:

void fb_hScreenInfo ( ssize_t *  width,
ssize_t *  height,
ssize_t *  depth,
ssize_t *  refresh 
)

Definition at line 752 of file gfx_win32.c.

static void fb_hSetMouseClip ( void  )
static

Definition at line 74 of file gfx_win32.c.

Here is the caller graph for this function:

static BOOL WINAPI fb_hTrackMouseEvent ( TRACKMOUSEEVENT *  e)
static

Definition at line 129 of file gfx_win32.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static VOID CALLBACK fb_hTrackMouseTimerProc ( HWND  hWnd,
UINT  uMsg,
UINT  idEvent,
DWORD  dwTime 
)
static

Definition at line 115 of file gfx_win32.c.

Here is the caller graph for this function:

void fb_hWin32Exit ( void  )

Definition at line 616 of file gfx_win32.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int fb_hWin32GetMouse ( int *  x,
int *  y,
int *  z,
int *  buttons,
int *  clip 
)

Definition at line 673 of file gfx_win32.c.

int fb_hWin32Init ( char *  title,
int  w,
int  h,
int  depth,
int  refresh_rate,
int  flags 
)

Definition at line 514 of file gfx_win32.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void fb_hWin32Lock ( void  )

Definition at line 649 of file gfx_win32.c.

Here is the caller graph for this function:

void fb_hWin32SetMouse ( int  x,
int  y,
int  cursor,
int  clip 
)

Definition at line 687 of file gfx_win32.c.

Here is the call graph for this function:

void fb_hWin32SetPalette ( int  index,
int  r,
int  g,
int  b 
)

Definition at line 659 of file gfx_win32.c.

int fb_hWin32SetWindowPos ( int  x,
int  y 
)

Definition at line 730 of file gfx_win32.c.

void fb_hWin32SetWindowTitle ( char *  title)

Definition at line 720 of file gfx_win32.c.

void fb_hWin32Unlock ( void  )

Definition at line 654 of file gfx_win32.c.

Here is the caller graph for this function:

void fb_hWin32WaitVSync ( void  )

Definition at line 668 of file gfx_win32.c.

LRESULT CALLBACK fb_hWin32WinProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 136 of file gfx_win32.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned int hIntlConvertChar ( int  key,
int  source_cp,
int  dest_cp 
)
static

Definition at line 794 of file gfx_win32.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void keyconv_clear ( KEYCONVINFO k)
static

Definition at line 769 of file gfx_win32.c.

Here is the caller graph for this function:

static void keyconv_grow ( KEYCONVINFO k,
int  nchars,
int  charsize 
)
static

Definition at line 778 of file gfx_win32.c.

Here is the caller graph for this function:

static void ToggleFullScreen ( void  )
static

Definition at line 92 of file gfx_win32.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const GFXDRIVER* __fb_gfx_drivers_list[]
Initial value:

Definition at line 31 of file gfx_win32.c.

BOOL cursor_shown
static

Definition at line 52 of file gfx_win32.c.

WIN32DRIVER fb_win32

Definition at line 29 of file gfx_win32.c.

HANDLE handle
static

Definition at line 51 of file gfx_win32.c.

BOOL has_focus = FALSE
static

Definition at line 52 of file gfx_win32.c.

KEYCONVINFO keyconv1 = {{NULL}, 0}
static

Definition at line 66 of file gfx_win32.c.

KEYCONVINFO keyconv2 = {{NULL}, 0}
static

Definition at line 67 of file gfx_win32.c.

int last_mouse_buttons
static

Definition at line 53 of file gfx_win32.c.

POINT last_mouse_pos
static

Definition at line 55 of file gfx_win32.c.

int mouse_buttons
static

Definition at line 53 of file gfx_win32.c.

int mouse_hwheel
static

Definition at line 54 of file gfx_win32.c.

int mouse_on
static

Definition at line 54 of file gfx_win32.c.

int mouse_wheel
static

Definition at line 54 of file gfx_win32.c.

int mouse_x
static

Definition at line 54 of file gfx_win32.c.

int mouse_y
static

Definition at line 54 of file gfx_win32.c.

const char* name

Definition at line 40 of file gfx_win32.c.

FARPROC* proc

Definition at line 40 of file gfx_win32.c.

BOOL screensaver_active
static

Definition at line 52 of file gfx_win32.c.

CRITICAL_SECTION update_lock
static

Definition at line 50 of file gfx_win32.c.

struct { ... } user32_procs[]
Initial value:
= {
{"SetLayeredWindowAttributes", (FARPROC *)&fb_win32.SetLayeredWindowAttributes},
{"MonitorFromWindow", (FARPROC *)&fb_win32.MonitorFromWindow },
{"MonitorFromPoint", (FARPROC *)&fb_win32.MonitorFromPoint },
{"FlashWindowEx", (FARPROC *)&fb_win32.FlashWindowEx },
{"TrackMouseEvent", (FARPROC *)&fb_win32.TrackMouseEvent },
{"GetMonitorInfoA", (FARPROC *)&fb_win32.GetMonitorInfo },
{"ChangeDisplaySettingsExA", (FARPROC *)&fb_win32.ChangeDisplaySettingsEx }
}