/*
* Freeglut callbacks type definitions
*/
-typedef void (* FGCBdisplay )( void );
-typedef void (* FGCBreshape )( int, int );
-typedef void (* FGCBvisibility )( int );
-typedef void (* FGCBkeyboard )( unsigned char, int, int );
-typedef void (* FGCBspecial )( int, int, int );
-typedef void (* FGCBmouse )( int, int, int, int );
-typedef void (* FGCBmousewheel )( int, int, int, int );
-typedef void (* FGCBmotion )( int, int );
-typedef void (* FGCBpassive )( int, int );
-typedef void (* FGCBentry )( int );
-typedef void (* FGCBwindowStatus )( int );
-typedef void (* FGCBselect )( int, int, int );
-typedef void (* FGCBjoystick )( unsigned int, int, int, int );
-typedef void (* FGCBkeyboardUp )( unsigned char, int, int );
-typedef void (* FGCBspecialUp )( int, int, int );
-typedef void (* FGCBoverlayDisplay)( void );
-typedef void (* FGCBspaceMotion )( int, int, int );
-typedef void (* FGCBspaceRotate )( int, int, int );
-typedef void (* FGCBspaceButton )( int, int );
-typedef void (* FGCBdials )( int, int );
-typedef void (* FGCBbuttonBox )( int, int );
-typedef void (* FGCBtabletMotion )( int, int );
-typedef void (* FGCBtabletButton )( int, int, int, int );
-typedef void (* FGCBdestroy )( void );
+typedef void (* FGCBDisplay )( void );
+typedef void (* FGCBReshape )( int, int );
+typedef void (* FGCBVisibility )( int );
+typedef void (* FGCBKeyboard )( unsigned char, int, int );
+typedef void (* FGCBSpecial )( int, int, int );
+typedef void (* FGCBMouse )( int, int, int, int );
+typedef void (* FGCBMouseWheel )( int, int, int, int );
+typedef void (* FGCBMotion )( int, int );
+typedef void (* FGCBPassive )( int, int );
+typedef void (* FGCBEntry )( int );
+typedef void (* FGCBWindowStatus )( int );
+typedef void (* FGCBSelect )( int, int, int );
+typedef void (* FGCBJoystick )( unsigned int, int, int, int );
+typedef void (* FGCBKeyboardUp )( unsigned char, int, int );
+typedef void (* FGCBSpecialUp )( int, int, int );
+typedef void (* FGCBOverlayDisplay)( void );
+typedef void (* FGCBSpaceMotion )( int, int, int );
+typedef void (* FGCBSpaceRotation )( int, int, int );
+typedef void (* FGCBSpaceButton )( int, int );
+typedef void (* FGCBDials )( int, int );
+typedef void (* FGCBButtonBox )( int, int );
+typedef void (* FGCBTabletMotion )( int, int );
+typedef void (* FGCBTabletButton )( int, int, int, int );
+typedef void (* FGCBDestroy )( void );
/*
* The global callbacks type definitions
*/
-typedef void (* FGCBidle )( void );
-typedef void (* FGCBtimer )( int );
-typedef void (* FGCBmenuState )( int );
-typedef void (* FGCBmenuStatus )( int, int, int );
+typedef void (* FGCBIdle )( void );
+typedef void (* FGCBTimer )( int );
+typedef void (* FGCBMenuState )( int );
+typedef void (* FGCBMenuStatus )( int, int, int );
/*
* The callback used when creating/using menus
*/
-typedef void (* FGCBmenu )( int );
+typedef void (* FGCBMenu )( int );
/*
SFG_Time Time; /* The time that glutInit was called */
SFG_List Timers; /* The freeglut timer hooks */
- FGCBidle IdleCallback; /* The global idle callback */
+ FGCBIdle IdleCallback; /* The global idle callback */
GLboolean BuildingAMenu; /* True if we are presently making a menu */
int ActiveMenus; /* Number of currently active menus */
- FGCBmenuState MenuStateCallback; /* Menu callbacks are global */
- FGCBmenuStatus MenuStatusCallback;
+ FGCBMenuState MenuStateCallback; /* Menu callbacks are global */
+ FGCBMenuStatus MenuStatusCallback;
SFG_XYUse GameModeSize; /* The game mode screen's dimensions */
int GameModeDepth; /* The pixel depth for game mode */
{
SFG_Node Node;
int ID; /* The timer ID integer */
- FGCBtimer Callback; /* The timer callback */
+ FGCBTimer Callback; /* The timer callback */
long TriggerTime; /* The timer trigger time */
};
* Following callbacks are fully supported right now
* and are ready to be tested for GLUT conformance:
*/
- FGCBdisplay Display;
- FGCBreshape Reshape;
- FGCBkeyboard Keyboard;
- FGCBkeyboardUp KeyboardUp;
- FGCBspecial Special;
- FGCBspecialUp SpecialUp;
- FGCBmouse Mouse;
- FGCBmousewheel MouseWheel;
- FGCBmotion Motion;
- FGCBpassive Passive;
- FGCBentry Entry;
- FGCBvisibility Visibility;
- FGCBwindowStatus WindowStatus;
- FGCBjoystick Joystick;
- FGCBdestroy Destroy;
+ FGCBDisplay Display;
+ FGCBReshape Reshape;
+ FGCBKeyboard Keyboard;
+ FGCBKeyboardUp KeyboardUp;
+ FGCBSpecial Special;
+ FGCBSpecialUp SpecialUp;
+ FGCBMouse Mouse;
+ FGCBMouseWheel MouseWheel;
+ FGCBMotion Motion;
+ FGCBPassive Passive;
+ FGCBEntry Entry;
+ FGCBVisibility Visibility;
+ FGCBWindowStatus WindowStatus;
+ FGCBJoystick Joystick;
+ FGCBDestroy Destroy;
/*
* Those callbacks are being ignored for the moment
*/
- FGCBselect Select;
- FGCBoverlayDisplay OverlayDisplay;
- FGCBspaceMotion SpaceMotion;
- FGCBspaceRotate SpaceRotation;
- FGCBspaceButton SpaceButton;
- FGCBdials Dials;
- FGCBbuttonBox ButtonBox;
- FGCBtabletMotion TabletMotion;
- FGCBtabletButton TabletButton;
+ FGCBSelect Select;
+ FGCBOverlayDisplay OverlayDisplay;
+ FGCBSpaceMotion SpaceMotion;
+ FGCBSpaceRotation SpaceRotation;
+ FGCBSpaceButton SpaceButton;
+ FGCBDials Dials;
+ FGCBButtonBox ButtonBox;
+ FGCBTabletMotion TabletMotion;
+ FGCBTabletButton TabletButton;
};
+#define FETCH_WCB(window,cbname) \
+ ((FGCB ## cbname)((window).CallBacks[CB_ ## cbname]))
+
+/*
+ * INVOKE_WCB() is used as:
+ *
+ * INVOKE_WCB( window, Visibility, ( status ) );
+ *
+ * ...where {window} is the freeglut window,
+ * {Visibility} is the window-specific callback,
+ * {(status)} is the parameter list.
+ *
+ * The callback is invoked as:
+ *
+ * callback( status );
+ *
+ * ...so the parentheses are REQUIRED in the {arg_list}.
+ *
+ * NOTE that it does a sanity-check and also sets the
+ * current window.
+ *
+ */
+#define INVOKE_WCB(window,cbname,arg_list) \
+{ \
+ if( FETCH_WCB( window, cbname ) ) \
+ { \
+ fgSetWindow( &window ); \
+ FETCH_WCB( window, cbname ) arg_list; \
+ } \
+}
+enum
+{
+ CB_Display,
+ CB_Reshape,
+ CB_Keyboard,
+ CB_KeyboardUp,
+ CB_Special,
+ CB_SpecialUp,
+ CB_Mouse,
+ CB_MouseWheel,
+ CB_Motion,
+ CB_Passive,
+ CB_Entry,
+ CB_Visibility,
+ CB_WindowStatus,
+ CB_Joystick,
+ CB_Destroy,
+
+ /* Presently ignored */
+ CB_Select,
+ CB_OverlayDisplay,
+ CB_SpaceMotion,
+ CB_SpaceRotation,
+ CB_SpaceButton,
+ CB_Dials,
+ CB_ButtonBox,
+ CB_TabletMotion,
+ CB_TabletButton,
+
+ /* Always make this the LAST one */
+ TOTAL_CALLBACKS
+};
+
/*
* This structure holds the OpenGL rendering context for all the menu windows
void *UserData ; /* A. Donev: User data passed back at callback */
int ID; /* The global menu ID */
SFG_List Entries; /* The menu entries list */
- FGCBmenu Callback; /* The menu callback */
- FGCBdestroy Destroy; /* A. Donev: Destruction callback */
+ FGCBMenu Callback; /* The menu callback */
+ FGCBDestroy Destroy; /* A. Donev: Destruction callback */
GLboolean IsActive; /* Is the menu selected? */
int Width; /* Menu box width in pixels */
int Height; /* Menu box height in pixels */
SFG_Context Window; /* Window and OpenGL context */
SFG_WindowState State; /* The window state */
- SFG_WindowCallbacks Callbacks; /* The window callbacks */
+/* SFG_WindowCallbacks Callbacks; /* The window callbacks */
+ void *CallBacks[ TOTAL_CALLBACKS ]; /* Array of window callbacks */
void *UserData ; /* A. Donev: A pointer to user data used in rendering */
SFG_Menu* Menu[ FREEGLUT_MAX_MENUS ]; /* Menus appended to window */
GLboolean IsMenu; /* Set to 1 if we are a menu */
};
+
/*
* A linked list structure of windows
*/
/*
* Menu creation and destruction. Defined in freeglut_structure.c
*/
-SFG_Menu* fgCreateMenu( FGCBmenu menuCallback );
+SFG_Menu* fgCreateMenu( FGCBMenu menuCallback );
void fgDestroyMenu( SFG_Menu* menu );
/*
{
SFG_Window* window = fgWindowByHandle( handle );
freeglut_return_if_fail( window != NULL );
- freeglut_return_if_fail( window->Callbacks.Display != NULL );
+ freeglut_return_if_fail( FETCH_WCB( *window, Display ) );
freeglut_return_if_fail( window->State.Visible == TRUE );
- fgSetWindow( window );
+ /* fgSetWindow( window ); */
window->State.Redisplay = FALSE;
- window->Callbacks.Display( );
+ /* window->Callbacks.Display( ); */
+ INVOKE_WCB( *window, Display, ( ) );
}
/*
SFG_Window* window = fgWindowByHandle( handle );
freeglut_return_if_fail( window != NULL );
- fgSetWindow( window );
- if( window->Callbacks.Reshape != NULL )
- window->Callbacks.Reshape( width, height );
- else
+ /*
+ * fgSetWindow( window );
+ * if( window->Callbacks.Reshape != NULL )
+ * window->Callbacks.Reshape( width, height );
+ * else
+ * glViewport( 0, 0, width, height );
+ */
+ if( !( FETCH_WCB( *window, Reshape ) ) )
+ {
+ fgSetWindow( window );
glViewport( 0, 0, width, height );
+ }
+ else
+ INVOKE_WCB( *window, Reshape, ( width, height ) );
/*
* Force a window redraw. In Windows at least this is only a partial
static void fghcbDisplayWindow( SFG_Window *window, SFG_Enumerator *enumerator )
{
#if TARGET_HOST_UNIX_X11
- if( (window->Callbacks.Display != NULL) &&
- (window->State.Redisplay == TRUE) &&
- (window->State.Visible == TRUE) )
+ if( ( FETCH_WCB( *window, Display ) ) &&
+ ( window->State.Redisplay == TRUE ) &&
+ ( window->State.Visible == TRUE ) )
{
SFG_Window *current_window = fgStructure.Window ;
- fgSetWindow( window );
+ /* fgSetWindow( window ); */
window->State.Redisplay = FALSE;
- window->Callbacks.Display( );
+ /* window->Callbacks.Display( ); */
+ INVOKE_WCB( *window, Display, ( ) );
fgSetWindow( current_window );
}
fgSetWindow ( current_window );
}
- if( (window->Callbacks.Display != NULL) &&
- (window->State.Redisplay == TRUE) &&
- (window->State.Visible == TRUE) )
+ if( ( FETCH_WCB( *window, Display ) ) &&
+ ( window->State.Redisplay == TRUE ) &&
+ ( window->State.Visible == TRUE ) )
{
window->State.Redisplay = FALSE;
- RedrawWindow(
+ RedrawWindow(
window->Window.Handle, NULL, NULL,
RDW_NOERASE | RDW_INTERNALPAINT | RDW_INVALIDATE | RDW_UPDATENOW
);
*/
static void fgCheckJoystickCallback( SFG_Window* w, SFG_Enumerator* e)
{
- if( w->Callbacks.Joystick )
+ if( FETCH_WCB( *w, Joystick ) )
{
e->found = TRUE;
e->data = w;
case VisibilityNotify:
{
GETWINDOW( xvisibility );
- if( window->Callbacks.WindowStatus == NULL )
+ if( ! FETCH_WCB( *window, WindowStatus ) )
break;
fgSetWindow( window );
switch( event.xvisibility.state )
{
case VisibilityUnobscured:
- window->Callbacks.WindowStatus( GLUT_FULLY_RETAINED );
+ INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );
window->State.Visible = TRUE;
break;
case VisibilityPartiallyObscured:
- window->Callbacks.WindowStatus( GLUT_PARTIALLY_RETAINED );
+ INVOKE_WCB( *window, WindowStatus,
+ ( GLUT_PARTIALLY_RETAINED ) );
window->State.Visible = TRUE;
break;
case VisibilityFullyObscured:
- window->Callbacks.WindowStatus( GLUT_FULLY_COVERED );
+ INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_COVERED ) );
window->State.Visible = FALSE;
break;
{
GETWINDOW( xcrossing );
GETMOUSE( xcrossing );
- if( window->Callbacks.Entry )
- {
- fgSetWindow( window ) ;
- window->Callbacks.Entry( GLUT_ENTERED );
- }
+ /*
+ * if( window->Callbacks.Entry )
+ * {
+ * fgSetWindow( window ) ;
+ * window->Callbacks.Entry( GLUT_ENTERED );
+ * }
+ */
+ INVOKE_WCB( *window, Entry, ( GLUT_ENTERED ) );
}
break;
-
+ /* XXX Combine EnterNotify and LeaveNotify */
case LeaveNotify:
{
GETWINDOW( xcrossing );
GETMOUSE( xcrossing );
- if( window->Callbacks.Entry )
- {
- fgSetWindow( window ) ;
- window->Callbacks.Entry( GLUT_LEFT );
- }
+ /*
+ * if( window->Callbacks.Entry )
+ * {
+ * fgSetWindow( window ) ;
+ * window->Callbacks.Entry( GLUT_LEFT );
+ * }
+ */
+ INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) );
}
break;
* A mouse button was pressed during the movement...
* Is there a motion callback hooked to the window?
*/
- if( window->Callbacks.Motion )
- {
- fgSetWindow ( window ) ;
- window->Callbacks.Motion( event.xmotion.x,
- event.xmotion.y );
- }
+ /*
+ * if( window->Callbacks.Motion )
+ * {
+ * fgSetWindow ( window ) ;
+ * window->Callbacks.Motion( event.xmotion.x,
+ * event.xmotion.y );
+ * }
+ */
+ INVOKE_WCB( *window, Motion, ( event.xmotion.x,
+ event.xmotion.y ) );
}
else
{
- if( window->Callbacks.Passive )
- {
- fgSetWindow( window );
- window->Callbacks.Passive( event.xmotion.x,
- event.xmotion.y );
- }
+ /*
+ * if( window->Callbacks.Passive )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.Passive( event.xmotion.x,
+ * event.xmotion.y );
+ * }
+ */
+ INVOKE_WCB( *window, Passive, ( event.xmotion.x,
+ event.xmotion.y ) );
}
}
break;
* Check if there is a mouse or mouse wheel callback hooked to the
* window
*/
- if( ( window->Callbacks.Mouse == NULL ) &&
- ( window->Callbacks.MouseWheel == NULL ) )
+ if( ! FETCH_WCB( *window, Mouse ) &&
+ ! FETCH_WCB( *window, MouseWheel ) )
break;
- fgSetWindow( window );
+ /* fgSetWindow( window ); */
/*
* XXX Why don't we use {window}? Other code here does...
*
* XXX Use a symbolic constant, *not* "4"!
*/
- if( ( button < 4 ) || ( !( window->Callbacks.MouseWheel ) ) )
+ if( ( button < 4 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) )
{
- if( window->Callbacks.Mouse )
- fgStructure.Window->Callbacks.Mouse(
- button,
- pressed ? GLUT_DOWN : GLUT_UP,
- event.xbutton.x,
- event.xbutton.y
- );
+ /*
+ * if( window->Callbacks.Mouse )
+ * fgStructure.Window->Callbacks.Mouse(
+ * button,
+ * pressed ? GLUT_DOWN : GLUT_UP,
+ * event.xbutton.x,
+ * event.xbutton.y
+ * );
+ */
+ INVOKE_WCB( *window, Mouse, ( button,
+ pressed ? GLUT_DOWN : GLUT_UP,
+ event.xbutton.x,
+ event.xbutton.y )
+ );
}
else
{
int wheel_number = (button - 4) / 2;
int direction = (button & 1)*2 - 1;
+ /*
+ * if( pressed )
+ * fgStructure.Window->Callbacks.MouseWheel(
+ * wheel_number,
+ * direction,
+ * event.xbutton.x,
+ * event.xbutton.y
+ * );
+ */
if( pressed )
- fgStructure.Window->Callbacks.MouseWheel(
- wheel_number,
- direction,
- event.xbutton.x,
- event.xbutton.y
+ INVOKE_WCB( *window, MouseWheel, ( wheel_number,
+ direction,
+ event.xbutton.x,
+ event.xbutton.y )
);
}
case KeyRelease:
case KeyPress:
{
- FGCBkeyboard keyboard_cb;
- FGCBspecial special_cb;
+ FGCBKeyboard keyboard_cb;
+ FGCBSpecial special_cb;
GETWINDOW( xkey );
GETMOUSE( xkey );
if( event.type == KeyPress )
{
- keyboard_cb = window->Callbacks.Keyboard;
- special_cb = window->Callbacks.Special;
+ keyboard_cb = FETCH_WCB( *window, Keyboard );
+ special_cb = FETCH_WCB( *window, Special );
}
else
{
- keyboard_cb = window->Callbacks.KeyboardUp;
- special_cb = window->Callbacks.SpecialUp;
+ keyboard_cb = FETCH_WCB( *window, KeyboardUp );
+ special_cb = FETCH_WCB( *window, SpecialUp );
}
/*
*/
while( window )
{
- if ( window->Callbacks.Visibility )
+ if ( FETCH_WCB( *window, Visibility ) )
{
SFG_Window *current_window = fgStructure.Window ;
- fgSetWindow( window );
- window->Callbacks.Visibility ( window->State.Visible ) ;
+ /*
+ * fgSetWindow( window );
+ * window->Callbacks.Visibility ( window->State.Visible ) ;
+ */
+ INVOKE_WCB( *window, Visibility, ( window->State.Visible ) );
fgSetWindow( current_window );
}
( wParam & MK_MBUTTON ) ||
( wParam & MK_RBUTTON ) )
{
- if( window->Callbacks.Motion )
- {
- fgSetWindow( window );
- window->Callbacks.Motion( window->State.MouseX,
- window->State.MouseY );
- }
+ /*
+ * if( window->Callbacks.Motion )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.Motion( window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ INVOKE_WCB( *window, Motion, ( window->State.MouseX,
+ window->State.MouseY ) );
}
else
{
- if( window->Callbacks.Passive )
- {
- fgSetWindow( window );
- window->Callbacks.Passive( window->State.MouseX,
- window->State.MouseY );
- }
+ /*
+ * if( window->Callbacks.Passive )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.Passive( window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ INVOKE_WCB( *window, Passive, ( window->State.MouseX,
+ window->State.MouseY ) );
}
window->State.Modifiers = 0xffffffff;
break;
}
- if( window->Callbacks.Mouse == NULL )
+ if( ! FETCH_WCB( *window, Mouse ) )
break;
fgSetWindow( window );
fgStructure.Window->State.Modifiers = fgGetWin32Modifiers( );
- window->Callbacks.Mouse(
- button,
- pressed == TRUE ? GLUT_DOWN : GLUT_UP,
- window->State.MouseX,
- window->State.MouseY
+ INVOKE_WCB(
+ *window, Mouse,
+ ( button,
+ pressed == TRUE ? GLUT_DOWN : GLUT_UP,
+ window->State.MouseX,
+ window->State.MouseY
+ )
);
+ /*
+ * window->Callbacks.Mouse(
+ * button,
+ * pressed == TRUE ? GLUT_DOWN : GLUT_UP,
+ * window->State.MouseX,
+ * window->State.MouseY
+ * );
+ */
fgStructure.Window->State.Modifiers = 0xffffffff;
}
/* window->State.MouseY = HIWORD( lParam ); */
/* change "lParam" to other parameter */
- if( ( window->Callbacks.MouseWheel == NULL ) &&
- ( window->Callbacks.Mouse == NULL ) )
+ if( ! FETCH_WCB( *window, MouseWheel ) &&
+ ! FETCH_WCB( *window, Mouse ) )
break;
fgSetWindow( window );
fgStructure.Window->State.Modifiers = fgGetWin32Modifiers( );
while( ticks-- )
- if( window->Callbacks.MouseWheel )
- window->Callbacks.MouseWheel(
- wheel_number,
- direction,
- window->State.MouseX,
- window->State.MouseY
+ if( FETCH_WCB( *window, MouseWheel ) )
+ {
+ INVOKE_WCB( *window, MouseWheel,
+ ( wheel_number,
+ direction,
+ window->State.MouseX,
+ window->State.MouseY
+ )
);
+ }
+ /*
+ * if( window->Callbacks.MouseWheel )
+ * window->Callbacks.MouseWheel(
+ * wheel_number,
+ * direction,
+ * window->State.MouseX,
+ * window->State.MouseY
+ * );
+ */
else /* No mouse wheel, call the mouse button callback twice */
{
/*
int button = wheel_number*2 + 4;
if( direction > 0 )
++button;
- window->Callbacks.Mouse( button, GLUT_DOWN,
- window->State.MouseX,
- window->State.MouseY
+ INVOKE_WCB( *window, Mouse,
+ ( button, GLUT_DOWN,
+ window->State.MouseX, window->State.MouseY )
);
- window->Callbacks.Mouse( button, GLUT_UP,
- window->State.MouseX,
- window->State.MouseY
+ INVOKE_WCB( *window, Mouse,
+ ( button, GLUT_UP,
+ window->State.MouseX, window->State.MouseX )
);
+
+ /*
+ * window->Callbacks.Mouse( button, GLUT_DOWN,
+ * window->State.MouseX,
+ * window->State.MouseY
+ * );
+ * window->Callbacks.Mouse( button, GLUT_UP,
+ * window->State.MouseX,
+ * window->State.MouseY
+ * );
+ */
}
fgStructure.Window->State.Modifiers = 0xffffffff;
/*
* The delete key should be treated as an ASCII keypress:
*/
- if( window->Callbacks.Keyboard )
- {
- fgSetWindow( window );
- window->Callbacks.Keyboard( 127, window->State.MouseX,
- window->State.MouseY );
- }
+ /*
+ * if( window->Callbacks.Keyboard )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.Keyboard( 127, window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ INVOKE_WCB( *window, Keyboard,
+ ( 127, window->State.MouseX, window->State.MouseY )
+ );
}
- if( ( keypress != -1 ) && window->Callbacks.Special )
- {
- fgSetWindow( window );
- window->Callbacks.Special( keypress, window->State.MouseX,
- window->State.MouseY );
- }
+ /* if( ( keypress != -1 ) && window->Callbacks.Special )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.Special( keypress, window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ if( keypress != -1 )
+ INVOKE_WCB( *window, Special,
+ ( keypress, window->State.MouseX, window->State.MouseY )
+ );
window->State.Modifiers = 0xffffffff;
}
/*
* The delete key should be treated as an ASCII keypress:
*/
- if( window->Callbacks.KeyboardUp )
- {
- fgSetWindow( window );
- window->Callbacks.KeyboardUp( 127, window->State.MouseX,
- window->State.MouseY );
- }
-
+ /* if( window->Callbacks.KeyboardUp )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.KeyboardUp( 127, window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ INVOKE_WCB( *window, KeyboardUp,
+ ( 127, window->State.MouseX, window->State.MouseY )
+ );
break;
default:
if( ToAscii( wParam, 0, state, code, 0 ) == 1 )
wParam=code[ 0 ];
- if( window->Callbacks.KeyboardUp )
- {
- fgSetWindow( window );
- window->Callbacks.KeyboardUp( (char)wParam,
- window->State.MouseX,
- window->State.MouseY );
- }
+ /*
+ * if( window->Callbacks.KeyboardUp )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.KeyboardUp( (char)wParam,
+ * window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ INVOKE_WCB( *window, KeyboardUp,
+ ( (char)wParam,
+ window->State.MouseX, window->State.MouseY )
+ );
}
}
- if( (keypress != -1) && window->Callbacks.SpecialUp )
- {
- fgSetWindow( window );
- window->Callbacks.SpecialUp( keypress, window->State.MouseX,
- window->State.MouseY );
- }
+ /*
+ * if( (keypress != -1) && window->Callbacks.SpecialUp )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.SpecialUp( keypress, window->State.MouseX,
+ * window->State.MouseY );
+ * }
+ */
+ if( keypress != -1 )
+ INVOKE_WCB( *window, SpecialUp,
+ ( keypress,
+ window->State.MouseX, window->State.MouseY )
+ );
window->State.Modifiers = 0xffffffff;
}
if( fgState.IgnoreKeyRepeat && (lParam & KF_REPEAT) )
break;
- if( window->Callbacks.Keyboard )
+ if( FETCH_WCB( *window, Keyboard ) )
{
- fgSetWindow( window );
+ /* fgSetWindow( window ); */
window->State.Modifiers = fgGetWin32Modifiers( );
- window->Callbacks.Keyboard( (char)wParam, window->State.MouseX,
- window->State.MouseY );
+ /* window->Callbacks.Keyboard( (char)wParam, window->State.MouseX,
+ window->State.MouseY ); */
+ INVOKE_WCB( *window, Keyboard,
+ ( (char)wParam,
+ window->State.MouseX, window->State.MouseY )
+ );
window->State.Modifiers = 0xffffffff;
}
}
case WM_CAPTURECHANGED:
/* User has finished resizing the window, force a redraw */
- if( window->Callbacks.Display )
- {
- fgSetWindow( window );
- window->Callbacks.Display( );
- }
+ /*
+ * if( window->Callbacks.Display )
+ * {
+ * fgSetWindow( window );
+ * window->Callbacks.Display( );
+ * }
+ */
+ INVOKE_WCB( *window, Display, ( ) );
/*lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ) ; */
break;