X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_internal.h;h=8e27f5421c055c105f04d18a3043906def8008d3;hb=76bb5e2f2b60a3cb15fe7fa0142d80a89065cf30;hp=3f0dc42833827a21ea9d3556da1bfea3c5cd2ad5;hpb=11f8762b68489ab1caf2507e372fde63d2131560;p=freeglut diff --git a/src/fg_internal.h b/src/fg_internal.h index 3f0dc42..8e27f54 100644 --- a/src/fg_internal.h +++ b/src/fg_internal.h @@ -51,7 +51,11 @@ # define TARGET_HOST_BLACKBERRY 1 #elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun) -# define TARGET_HOST_POSIX_X11 1 +# if defined(FREEGLUT_WAYLAND) +# define TARGET_HOST_POSIX_WAYLAND 1 +# else +# define TARGET_HOST_POSIX_X11 1 +# endif #elif defined(__APPLE__) /* This is a placeholder until we get native OSX support ironed out -- JFF 11/18/09 */ @@ -70,32 +74,36 @@ #endif #ifndef TARGET_HOST_MS_WINDOWS -# define TARGET_HOST_MS_WINDOWS 0 +# define TARGET_HOST_MS_WINDOWS 0 #endif #ifndef TARGET_HOST_ANDROID -# define TARGET_HOST_ANDROID 0 +# define TARGET_HOST_ANDROID 0 #endif #ifndef TARGET_HOST_BLACKBERRY -# define TARGET_HOST_BLACKBERRY 0 +# define TARGET_HOST_BLACKBERRY 0 +#endif + +#ifndef TARGET_HOST_POSIX_WAYLAND +# define TARGET_HOST_POSIX_WAYLAND 0 #endif #ifndef TARGET_HOST_POSIX_X11 -# define TARGET_HOST_POSIX_X11 0 +# define TARGET_HOST_POSIX_X11 0 #endif #ifndef TARGET_HOST_MAC_OSX -# define TARGET_HOST_MAC_OSX 0 +# define TARGET_HOST_MAC_OSX 0 #endif #ifndef TARGET_HOST_SOLARIS -# define TARGET_HOST_SOLARIS 0 +# define TARGET_HOST_SOLARIS 0 #endif /* -- FIXED CONFIGURATION LIMITS ------------------------------------------- */ -#define FREEGLUT_MAX_MENUS 3 +#define FREEGLUT_MAX_MENUS 3 /* These files should be available on every platform. */ #include @@ -188,6 +196,9 @@ #endif /* Platform-specific includes */ +#if TARGET_HOST_POSIX_WAYLAND +#include "wayland/fg_internal_wl.h" +#endif #if TARGET_HOST_POSIX_X11 #include "x11/fg_internal_x11.h" #endif @@ -205,6 +216,8 @@ /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */ /* Freeglut callbacks type definitions */ +typedef void* FGCBUserData; + typedef void (* FGCBDisplay )( void ); typedef void (* FGCBReshape )( int, int ); typedef void (* FGCBPosition )( int, int ); @@ -240,12 +253,15 @@ typedef void (* FGCBAppStatus)(int); /* The global callbacks type definitions */ typedef void (* FGCBIdle )( void ); +typedef void (* FGCBIdleUC )( FGCBUserData ); typedef void (* FGCBTimer )( int ); +typedef void (* FGCBTimerUC )( int, FGCBUserData ); typedef void (* FGCBMenuState )( int ); typedef void (* FGCBMenuStatus )( int, int, int ); /* The callback used when creating/using menus */ typedef void (* FGCBMenu )( int ); +typedef void (* FGCBMenuUC )( int, FGCBUserData ); /* The FreeGLUT error/warning handler type definition */ typedef void (* FGError ) ( const char *fmt, va_list ap); @@ -316,7 +332,8 @@ struct tagSFG_State SFG_List Timers; /* The freeglut timer hooks */ SFG_List FreeTimers; /* The unused timer hooks */ - FGCBIdle IdleCallback; /* The global idle callback */ + FGCBIdleUC IdleCallback; /* The global idle callback */ + FGCBUserData IdleCallbackData; /* The global idle callback data */ int ActiveMenus; /* Num. of currently active menus */ FGCBMenuState MenuStateCallback; /* Menu callbacks are global */ @@ -343,6 +360,7 @@ struct tagSFG_State GLboolean SkipStaleMotion; /* skip stale motion events */ GLboolean StrokeFontDrawJoinDots;/* Draw dots between line segments of stroke fonts? */ + GLboolean AllowNegativeWindowPosition; /* GLUT, by default, doesn't allow negative window positions. Enable it? */ int MajorVersion; /* Major OpenGL context version */ int MinorVersion; /* Minor OpenGL context version */ @@ -372,7 +390,8 @@ struct tagSFG_Timer { SFG_Node Node; int ID; /* The timer ID integer */ - FGCBTimer Callback; /* The timer callback */ + FGCBTimerUC Callback; /* The timer callback */ + FGCBUserData CallbackData; /* The timer callback user data */ fg_time_t TriggerTime; /* The timer trigger time */ }; @@ -413,8 +432,7 @@ struct tagSFG_Context #define GLUT_DISPLAY_WORK (1<<6) /* - * An enumeration containing the state of the GLUT execution: - * initializing, running, or stopping + * An enumeration containing the desired mapping state of a window */ typedef enum { @@ -621,9 +639,9 @@ enum /* Presently ignored */ WCB_Select, WCB_OverlayDisplay, - WCB_SpaceMotion, /* presently implemented only on UNIX/X11 */ - WCB_SpaceRotation, /* presently implemented only on UNIX/X11 */ - WCB_SpaceButton, /* presently implemented only on UNIX/X11 */ + WCB_SpaceMotion, /* presently implemented only on UNIX/X11 and Windows */ + WCB_SpaceRotation, /* presently implemented only on UNIX/X11 and Windows */ + WCB_SpaceButton, /* presently implemented only on UNIX/X11 and Windows */ WCB_Dials, WCB_ButtonBox, WCB_TabletMotion, @@ -651,7 +669,8 @@ struct tagSFG_Menu void *UserData; /* User data passed back at callback */ int ID; /* The global menu ID */ SFG_List Entries; /* The menu entries list */ - FGCBMenu Callback; /* The menu callback */ + FGCBMenuUC Callback; /* The menu callback */ + FGCBUserData CallbackData; /* The menu callback user data */ FGCBDestroy Destroy; /* Destruction callback */ GLboolean IsActive; /* Is the menu selected? */ void* Font; /* Font to be used for displaying this menu */ @@ -959,7 +978,7 @@ void fgCloseWindows (); void fgDestroyWindow( SFG_Window* window ); /* Menu creation and destruction. Defined in fg_structure.c */ -SFG_Menu* fgCreateMenu( FGCBMenu menuCallback ); +SFG_Menu* fgCreateMenu( FGCBMenuUC menuCallback, FGCBUserData userData ); void fgDestroyMenu( SFG_Menu* menu ); /* Joystick device management functions, defined in fg_joystick.c */