Removing some Windows-specific function prototypes from "freeglut_internal.h"
[freeglut] / src / mswin / freeglut_main_mswin.c
index 81013d3..e233ecf 100644 (file)
 \r
 extern void fghRedrawWindow ( SFG_Window *window );\r
 \r
+extern void fgNewWGLCreateContext( SFG_Window* window );\r
+extern GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,\r
+                                     unsigned char layer_type );\r
 \r
-void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height )\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
+/* \r
+ * Helper functions for getting client area from the window rect\r
+ * and the window rect from the client area given the style of the window\r
+ * (or a valid window pointer from which the style can be queried).\r
+ */\r
+extern void fghComputeWindowRectFromClientArea_QueryWindow( const SFG_Window *window, RECT *clientRect, BOOL posIsOutside );\r
+extern RECT fghGetClientArea                              ( const SFG_Window *window,                   BOOL wantPosOutside );\r
+\r
+\r
+void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )\r
 {\r
     RECT windowRect;\r
 \r
@@ -80,7 +99,7 @@ void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height )
 }\r
 \r
 \r
-void fghcbPlatformDisplayWindow ( SFG_Window *window )\r
+void fgPlatformDisplayWindow ( SFG_Window *window )\r
 {\r
     RedrawWindow(\r
         window->Window.Handle, NULL, NULL,\r
@@ -89,13 +108,13 @@ void fghcbPlatformDisplayWindow ( SFG_Window *window )
 }\r
 \r
 \r
-void fghPlatformSleepForEvents( long msec )\r
+void fgPlatformSleepForEvents( long msec )\r
 {\r
     MsgWaitForMultipleObjects( 0, NULL, FALSE, msec, QS_ALLINPUT );\r
 }\r
 \r
 \r
-void fghProcessSingleEvent ( void )\r
+void fgPlatformProcessSingleEvent ( void )\r
 {\r
     MSG stMsg;\r
 \r
@@ -123,7 +142,7 @@ void fghProcessSingleEvent ( void )
 \r
 \r
 \r
-void fghMainLoopPreliminaryWork ( void )\r
+void fgPlatformMainLoopPreliminaryWork ( void )\r
 {\r
     SFG_Window *window = (SFG_Window *)fgStructure.Windows.First ;\r
 \r
@@ -154,7 +173,7 @@ void fghMainLoopPreliminaryWork ( void )
 /*\r
  * Determine a GLUT modifer mask based on MS-WINDOWS system info.\r
  */\r
-static int fghGetModifiers (void)\r
+static int fgPlatformGetModifiers (void)\r
 {\r
     return\r
         ( ( ( GetKeyState( VK_LSHIFT   ) < 0 ) ||\r
@@ -168,8 +187,8 @@ static int fghGetModifiers (void)
 /*\r
  * The window procedure for handling Win32 events\r
  */\r
-LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,\r
-                               LPARAM lParam )\r
+LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,\r
+                                       LPARAM lParam )\r
 {\r
     static unsigned char lControl = 0, rControl = 0, lShift = 0,\r
                          rShift = 0, lAlt = 0, rAlt = 0;\r
@@ -307,7 +326,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
         /* The window structure is passed as the creation structure parameter... */\r
         window = (SFG_Window *) (((LPCREATESTRUCT) lParam)->lpCreateParams);\r
         FREEGLUT_INTERNAL_ERROR_EXIT ( ( window != NULL ), "Cannot create window",\r
-                                       "fgWindowProc" );\r
+                                       "fgPlatformWindowProc" );\r
 \r
         window->Window.Handle = hWnd;\r
         window->Window.Device = GetDC( hWnd );\r
@@ -497,7 +516,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
         }\r
         SetFocus(window->Window.Handle);\r
 \r
-        fgState.Modifiers = fghGetModifiers( );\r
+        fgState.Modifiers = fgPlatformGetModifiers( );\r
 \r
         if( ( wParam & MK_LBUTTON ) ||\r
             ( wParam & MK_MBUTTON ) ||\r
@@ -607,7 +626,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
             break;\r
 \r
         fgSetWindow( window );\r
-        fgState.Modifiers = fghGetModifiers( );\r
+        fgState.Modifiers = fgPlatformGetModifiers( );\r
 \r
         INVOKE_WCB(\r
             *window, Mouse,\r
@@ -641,7 +660,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
                 break;\r
 \r
             fgSetWindow( window );\r
-            fgState.Modifiers = fghGetModifiers( );\r
+            fgState.Modifiers = fgPlatformGetModifiers( );\r
 \r
             /*\r
              * XXX Should use WHEEL_DELTA instead of 120\r
@@ -702,7 +721,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
          * Remember the current modifiers state. This is done here in order\r
          * to make sure the VK_DELETE keyboard callback is executed properly.\r
          */\r
-        fgState.Modifiers = fghGetModifiers( );\r
+        fgState.Modifiers = fgPlatformGetModifiers( );\r
 \r
         GetCursorPos( &mouse_pos );\r
         ScreenToClient( window->Window.Handle, &mouse_pos );\r
@@ -792,7 +811,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
          * Remember the current modifiers state. This is done here in order\r
          * to make sure the VK_DELETE keyboard callback is executed properly.\r
          */\r
-        fgState.Modifiers = fghGetModifiers( );\r
+        fgState.Modifiers = fgPlatformGetModifiers( );\r
 \r
         GetCursorPos( &mouse_pos );\r
         ScreenToClient( window->Window.Handle, &mouse_pos );\r
@@ -877,7 +896,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
       if( (fgState.KeyRepeat==GLUT_KEY_REPEAT_OFF || window->State.IgnoreKeyRepeat==GL_TRUE) && (HIWORD(lParam) & KF_REPEAT) )\r
             break;\r
 \r
-        fgState.Modifiers = fghGetModifiers( );\r
+        fgState.Modifiers = fgPlatformGetModifiers( );\r
         INVOKE_WCB( *window, Keyboard,\r
                     ( (char)wParam,\r
                       window->State.MouseX, window->State.MouseY )\r