Moving the platform-specific window state fields into their own substructure
[freeglut] / src / Common / freeglut_internal.h
index 7199da7..ebd9340 100644 (file)
 \r
 /* -- PLATFORM-SPECIFIC INCLUDES ------------------------------------------- */\r
 \r
-/* All Win32 headers depend on the huge windows.h recursive include.\r
- * Note: Lower-case header names are used, for best cross-platform\r
- * compatibility.\r
- */\r
-#if TARGET_HOST_MS_WINDOWS && !defined(_WIN32_WCE)\r
-#    include <windows.h>\r
-#    include <windowsx.h>\r
-#    include <mmsystem.h>\r
-/* CYGWIN does not have tchar.h, but has TEXT(x), defined in winnt.h. */\r
-#    ifndef __CYGWIN__\r
-#      include <tchar.h>\r
-#    else\r
-#      define _TEXT(x) TEXT(x)\r
-#      define _T(x)    TEXT(x)\r
-#    endif\r
-\r
-#elif TARGET_HOST_POSIX_X11\r
+#if TARGET_HOST_POSIX_X11\r
 #    include <GL/glx.h>\r
 #    include <X11/Xlib.h>\r
 #    include <X11/Xatom.h>\r
 #    endif\r
 #endif\r
 \r
-#if TARGET_HOST_MS_WINDOWS\r
-#    define  HAVE_VFPRINTF 1\r
-#endif\r
-\r
-/* MinGW may lack a prototype for ChangeDisplaySettingsEx() (depending on the version?) */\r
-#if TARGET_HOST_MS_WINDOWS && !defined(ChangeDisplaySettingsEx)\r
-LONG WINAPI ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);\r
-LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);\r
-#    ifdef UNICODE\r
-#        define ChangeDisplaySettingsEx ChangeDisplaySettingsExW\r
-#    else\r
-#        define ChangeDisplaySettingsEx ChangeDisplaySettingsExA\r
-#    endif\r
-#endif\r
-\r
 #if defined(_MSC_VER) || defined(__WATCOMC__)\r
 /* strdup() is non-standard, for all but POSIX-2001 */\r
 #define strdup   _strdup\r
@@ -450,19 +419,24 @@ struct tagSFG_Context
 };\r
 \r
 /* Window's state description. This structure should be kept portable. */\r
+#if TARGET_HOST_POSIX_X11\r
+typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;\r
+struct tagSFG_PlatformWindowState\r
+{\r
+    int             OldWidth;           /* Window width from before a resize */\r
+    int             OldHeight;          /*   "    height  "    "    "   "    */\r
+};\r
+#endif\r
+\r
+\r
 typedef struct tagSFG_WindowState SFG_WindowState;\r
 struct tagSFG_WindowState\r
 {\r
     /* Note that on Windows, sizes always refer to the client area, thus without the window decorations */\r
     int             Width;              /* Window's width in pixels          */\r
     int             Height;             /* The same about the height         */\r
-#if TARGET_HOST_POSIX_X11\r
-    int             OldWidth;           /* Window width from before a resize */\r
-    int             OldHeight;          /*   "    height  "    "    "   "    */\r
-#elif TARGET_HOST_MS_WINDOWS\r
-    RECT            OldRect;            /* window rect - stored before the window is made fullscreen */\r
-    DWORD           OldStyle;           /* window style - stored before the window is made fullscreen */\r
-#endif\r
+\r
+       SFG_PlatformWindowState pWState;    /* Window width/height (X11) or rectangle/style (Windows) from before a resize */\r
 \r
     GLboolean       Redisplay;          /* Do we have to redisplay?          */\r
     GLboolean       Visible;            /* Is the window visible now         */\r