Putting in Diederick Niehorster's patch from e-mail dated 1/23/12 at 6:48 AM to fix...
[freeglut] / src / Common / freeglut_main.c
index e7b4cb8..b1654a5 100644 (file)
@@ -70,18 +70,11 @@ struct GXKeyList gxKeyList;
 #    define MIN(a,b) (((a)<(b)) ? (a) : (b))\r
 #endif\r
 \r
-#ifdef WM_TOUCH\r
-    typedef BOOL (WINAPI *pGetTouchInputInfo)(HTOUCHINPUT,UINT,PTOUCHINPUT,int);\r
-    typedef BOOL (WINAPI *pCloseTouchInputHandle)(HTOUCHINPUT);\r
-       static pGetTouchInputInfo fghGetTouchInputInfo = (pGetTouchInputInfo)0xDEADBEEF;\r
-       static pCloseTouchInputHandle fghCloseTouchInputHandle = (pCloseTouchInputHandle)0xDEADBEEF;\r
-#endif\r
-\r
-extern void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height );\r
-extern void fghcbPlatformDisplayWindow ( SFG_Window *window );\r
-extern void fghPlatformSleepForEvents( long msec );\r
-extern void fghProcessSingleEvent ( void );\r
-extern void fghMainLoopPreliminaryWork ( void );\r
+extern void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height );\r
+extern void fgPlatformDisplayWindow ( SFG_Window *window );\r
+extern void fgPlatformSleepForEvents( long msec );\r
+extern void fgPlatformProcessSingleEvent ( void );\r
+extern void fgPlatformMainLoopPreliminaryWork ( void );\r
 \r
 \r
 /*\r
@@ -103,7 +96,7 @@ extern void fghMainLoopPreliminaryWork ( void );
  * match the new window size.\r
  */\r
 #if TARGET_HOST_POSIX_X11\r
-static void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height )\r
+static void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )\r
 {\r
     XResizeWindow( fgDisplay.Display, window->Window.Handle,\r
                    width, height );\r
@@ -117,7 +110,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height )
 \r
     freeglut_return_if_fail( window != NULL );\r
 \r
-       fghPlatformReshapeWindow ( window, width, height );\r
+       fgPlatformReshapeWindow ( window, width, height );\r
 \r
     if( FETCH_WCB( *window, Reshape ) )\r
         INVOKE_WCB( *window, Reshape, ( width, height ) );\r
@@ -177,7 +170,7 @@ void fghRedrawWindow ( SFG_Window *window )
  * A static helper function to execute display callback for a window\r
  */\r
 #if TARGET_HOST_POSIX_X11\r
-static void fghcbPlatformDisplayWindow ( SFG_Window *window )\r
+static void fgPlatformDisplayWindow ( SFG_Window *window )\r
 {\r
         fghRedrawWindow ( window ) ;\r
 }\r
@@ -190,7 +183,7 @@ static void fghcbDisplayWindow( SFG_Window *window,
         window->State.Visible )\r
     {\r
         window->State.Redisplay = GL_FALSE;\r
-               fghcbPlatformDisplayWindow ( window );\r
+               fgPlatformDisplayWindow ( window );\r
     }\r
 \r
     fgEnumSubWindows( window, fghcbDisplayWindow, enumerator );\r
@@ -423,7 +416,7 @@ static long fghNextTimer( void )
  */\r
 \r
 #if TARGET_HOST_POSIX_X11\r
-static void fghPlatformSleepForEvents( long msec )\r
+static void fgPlatformSleepForEvents( long msec )\r
 {\r
     /*\r
      * Possibly due to aggressive use of XFlush() and friends,\r
@@ -469,14 +462,14 @@ static void fghSleepForEvents( void )
     if( fghHaveJoystick( ) && ( msec > 10 ) )     \r
         msec = 10;\r
 \r
-       fghPlatformSleepForEvents ( msec );\r
+       fgPlatformSleepForEvents ( msec );\r
 }\r
 \r
 #if TARGET_HOST_POSIX_X11\r
 /*\r
  * Returns GLUT modifier mask for the state field of an X11 event.\r
  */\r
-int fghGetModifiers( int state )\r
+int fgPlatformGetModifiers( int state )\r
 {\r
     int ret = 0;\r
 \r
@@ -933,7 +926,7 @@ static void fghPrintEvent( XEvent *event )
 }\r
 \r
 \r
-void fghProcessSingleEvent ( void )\r
+void fgPlatformProcessSingleEvent ( void )\r
 {\r
     SFG_Window* window;\r
     XEvent event;\r
@@ -1147,7 +1140,7 @@ void fghProcessSingleEvent ( void )
              * XXX track ButtonPress/ButtonRelease events in our own\r
              * XXX bit-mask?\r
              */\r
-            fgState.Modifiers = fghGetModifiers( event.xmotion.state );\r
+            fgState.Modifiers = fgPlatformGetModifiers( event.xmotion.state );\r
             if ( event.xmotion.state & ( Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) ) {\r
                 INVOKE_WCB( *window, Motion, ( event.xmotion.x,\r
                                                event.xmotion.y ) );\r
@@ -1201,7 +1194,7 @@ void fghProcessSingleEvent ( void )
                 ! FETCH_WCB( *window, MouseWheel ) )\r
                 break;\r
 \r
-            fgState.Modifiers = fghGetModifiers( event.xbutton.state );\r
+            fgState.Modifiers = fgPlatformGetModifiers( event.xbutton.state );\r
 \r
             /* Finally execute the mouse or mouse wheel callback */\r
             if( ( button < glutDeviceGet ( GLUT_NUM_MOUSE_BUTTONS ) ) || ( ! FETCH_WCB( *window, MouseWheel ) ) )\r
@@ -1316,7 +1309,7 @@ void fghProcessSingleEvent ( void )
                     if( keyboard_cb )\r
                     {\r
                         fgSetWindow( window );\r
-                        fgState.Modifiers = fghGetModifiers( event.xkey.state );\r
+                        fgState.Modifiers = fgPlatformGetModifiers( event.xkey.state );\r
                         keyboard_cb( asciiCode[ 0 ],\r
                                      event.xkey.x, event.xkey.y\r
                         );\r
@@ -1385,7 +1378,7 @@ void fghProcessSingleEvent ( void )
                     if( special_cb && (special != -1) )\r
                     {\r
                         fgSetWindow( window );\r
-                        fgState.Modifiers = fghGetModifiers( event.xkey.state );\r
+                        fgState.Modifiers = fgPlatformGetModifiers( event.xkey.state );\r
                         special_cb( special, event.xkey.x, event.xkey.y );\r
                         fgState.Modifiers = INVALID_MODIFIERS;\r
                     }\r
@@ -1412,7 +1405,7 @@ void fghProcessSingleEvent ( void )
 }\r
 \r
 \r
-static void fghMainLoopPreliminaryWork ( void )\r
+static void fgPlatformMainLoopPreliminaryWork ( void )\r
 {\r
 }\r
 #endif\r
@@ -1424,7 +1417,7 @@ static void fghMainLoopPreliminaryWork ( void )
  */\r
 void FGAPIENTRY glutMainLoopEvent( void )\r
 {\r
-       fghProcessSingleEvent ();\r
+       fgPlatformProcessSingleEvent ();\r
 \r
     if( fgState.Timers.First )\r
         fghCheckTimers( );\r
@@ -1444,7 +1437,7 @@ void FGAPIENTRY glutMainLoop( void )
 \r
     FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoop" );\r
 \r
-       fghMainLoopPreliminaryWork ();\r
+       fgPlatformMainLoopPreliminaryWork ();\r
 \r
     fgState.ExecState = GLUT_EXEC_STATE_RUNNING ;\r
     while( fgState.ExecState == GLUT_EXEC_STATE_RUNNING )\r