X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Ffg_main_x11.c;h=80fd2c8257bd882e1a08323200578129e217a10f;hb=c5fa24956f3db8df3f658b5dc64353dede2e10ea;hp=6d2d8a72ab011c90e866d29105f0266ee749a9d2;hpb=67f242b7dd68bea7dea467f9b5265c8448b6655e;p=freeglut diff --git a/src/x11/fg_main_x11.c b/src/x11/fg_main_x11.c index 6d2d8a7..80fd2c8 100644 --- a/src/x11/fg_main_x11.c +++ b/src/x11/fg_main_x11.c @@ -28,17 +28,8 @@ #include #include "../fg_internal.h" -#ifdef HAVE_ERRNO_H -# include -#endif +#include #include -#ifdef HAVE_VFPRINTF -# define VFPRINTF(s,f,a) vfprintf((s),(f),(a)) -#elif defined(HAVE__DOPRNT) -# define VFPRINTF(s,f,a) _doprnt((f),(a),(s)) -#else -# define VFPRINTF(s,f,a) -#endif /* @@ -125,10 +116,8 @@ void fgPlatformSleepForEvents( fg_time_t msec ) wait.tv_usec = (msec % 1000) * 1000; err = select( socket+1, &fdset, NULL, NULL, &wait ); -#ifdef HAVE_ERRNO_H if( ( -1 == err ) && ( errno != EINTR ) ) fgWarning ( "freeglut select() error: %d", errno ); -#endif } } @@ -901,8 +890,10 @@ void fgPlatformProcessSingleEvent ( void ) case KeyRelease: case KeyPress: { - FGCBKeyboard keyboard_cb; - FGCBSpecial special_cb; + FGCBKeyboardUC keyboard_cb; + FGCBSpecialUC special_cb; + FGCBUserData keyboard_ud; + FGCBUserData special_ud; GETWINDOW( xkey ); GETMOUSE( xkey ); @@ -943,13 +934,17 @@ void fgPlatformProcessSingleEvent ( void ) if( event.type == KeyPress ) { - keyboard_cb = (FGCBKeyboard)( FETCH_WCB( *window, Keyboard )); - special_cb = (FGCBSpecial) ( FETCH_WCB( *window, Special )); + keyboard_cb = (FGCBKeyboardUC)( FETCH_WCB( *window, Keyboard )); + special_cb = (FGCBSpecialUC) ( FETCH_WCB( *window, Special )); + keyboard_ud = FETCH_USER_DATA_WCB( *window, Keyboard ); + special_ud = FETCH_USER_DATA_WCB( *window, Special ); } else { - keyboard_cb = (FGCBKeyboard)( FETCH_WCB( *window, KeyboardUp )); - special_cb = (FGCBSpecial) ( FETCH_WCB( *window, SpecialUp )); + keyboard_cb = (FGCBKeyboardUC)( FETCH_WCB( *window, KeyboardUp )); + special_cb = (FGCBSpecialUC) ( FETCH_WCB( *window, SpecialUp )); + keyboard_ud = FETCH_USER_DATA_WCB( *window, KeyboardUp ); + special_ud = FETCH_USER_DATA_WCB( *window, SpecialUp ); } /* Is there a keyboard/special callback hooked for this window? */ @@ -974,7 +969,8 @@ void fgPlatformProcessSingleEvent ( void ) fgSetWindow( window ); fgState.Modifiers = fgPlatformGetModifiers( event.xkey.state ); keyboard_cb( asciiCode[ 0 ], - event.xkey.x, event.xkey.y + event.xkey.x, event.xkey.y, + keyboard_ud ); fgState.Modifiers = INVALID_MODIFIERS; } @@ -1042,7 +1038,7 @@ void fgPlatformProcessSingleEvent ( void ) { fgSetWindow( window ); fgState.Modifiers = fgPlatformGetModifiers( event.xkey.state ); - special_cb( special, event.xkey.x, event.xkey.y ); + special_cb( special, event.xkey.x, event.xkey.y, special_ud ); fgState.Modifiers = INVALID_MODIFIERS; } }