src/video/wincommon/SDL_lowvideo.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 29 May 2006 04:04:35 +0000
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
permissions -rw-r--r--
more tweaking indent options
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_lowvideo_h
    25 #define _SDL_lowvideo_h
    26 
    27 #define WIN32_LEAN_AND_MEAN
    28 #include <windows.h>
    29 
    30 #ifndef SetClassLongPtr
    31 #define SetClassLongPtr	SetClassLong
    32 #endif
    33 #ifndef GetWindowLongPtr
    34 #define GetWindowLongPtr	GetWindowLong
    35 #endif
    36 #ifndef SetWindowLongPtr
    37 #define SetWindowLongPtr	SetWindowLong
    38 #endif
    39 #ifndef GWLP_WNDPROC
    40 #define GWLP_WNDPROC	GWL_WNDPROC
    41 #endif
    42 #ifndef GCLP_HICON
    43 #define GCLP_HICON GCL_HICON
    44 #endif
    45 
    46 #include "../SDL_sysvideo.h"
    47 
    48 /* Hidden "this" pointer for the video functions */
    49 #define _THIS	SDL_VideoDevice *this
    50 
    51 #define WINDIB_FULLSCREEN()						\
    52 (									\
    53 	SDL_VideoSurface &&						\
    54 	(SDL_VideoSurface->flags & SDL_FULLSCREEN) &&			\
    55 	((SDL_VideoSurface->flags & SDL_INTERNALOPENGL) ||		\
    56 	((SDL_strcmp(this->name, "windib") == 0) ||			\
    57 	 (SDL_strcmp(this->name, "gapi") == 0)))			\
    58 )
    59 #define DDRAW_FULLSCREEN() 						\
    60 (									\
    61 	SDL_VideoSurface &&						\
    62 	(SDL_VideoSurface->flags & SDL_FULLSCREEN) &&			\
    63 	(SDL_VideoSurface->flags & SDL_INTERNALOPENGL) &&		\
    64 	(SDL_strcmp(this->name, "directx") == 0)			\
    65 )
    66 
    67 #define DINPUT_FULLSCREEN()	DDRAW_FULLSCREEN()
    68 
    69 /* The main window -- and a function to set it for the audio */
    70 #ifdef _WIN32_WCE
    71 extern LPWSTR SDL_Appname;
    72 #else
    73 extern LPSTR SDL_Appname;
    74 #endif
    75 extern HINSTANCE SDL_Instance;
    76 extern HWND SDL_Window;
    77 extern BOOL SDL_windowid;
    78 
    79 /* Variables and functions exported to other parts of the native video
    80    subsystem (SDL_sysevents.c)
    81 */
    82 extern void WIN_FlushMessageQueue();
    83 
    84 /* Called by windows message loop when system palette is available */
    85 extern void (*WIN_RealizePalette) (_THIS);
    86 
    87 /* Called by windows message loop when the system palette changes */
    88 extern void (*WIN_PaletteChanged) (_THIS, HWND window);
    89 
    90 /* Called by windows message loop when a portion of the screen needs update */
    91 extern void (*WIN_WinPAINT) (_THIS, HDC hdc);
    92 
    93 /* Called by windows message loop when the message isn't handled */
    94 extern LONG(*HandleMessage) (_THIS, HWND hwnd, UINT msg, WPARAM wParam,
    95                              LPARAM lParam);
    96 
    97 /* The window cursor (from SDL_sysmouse.c) */
    98 extern HCURSOR SDL_hcursor;
    99 
   100 /* The bounds of the window in screen coordinates */
   101 extern RECT SDL_bounds;
   102 
   103 /* The position of the window in windowed mode */
   104 extern int SDL_windowX;
   105 extern int SDL_windowY;
   106 
   107 /* Flag -- SDL is performing a resize, rather than the user */
   108 extern int SDL_resizing;
   109 
   110 /* Flag -- the mouse is in relative motion mode */
   111 extern int mouse_relative;
   112 
   113 /* The GDI fullscreen mode currently active */
   114 #ifndef NO_CHANGEDISPLAYSETTINGS
   115 extern DEVMODE SDL_desktop_mode;
   116 extern DEVMODE SDL_fullscreen_mode;
   117 #endif
   118 
   119 /* The system gamma ramp for GDI modes */
   120 extern WORD *gamma_saved;
   121 
   122 /* This is really from SDL_dx5audio.c */
   123 extern void DX5_SoundFocus(HWND window);
   124 
   125 /* DJM: This is really from SDL_sysevents.c, we need it in
   126    GDL_CreateWindow as well */
   127 LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam,
   128                             LPARAM lParam);
   129 
   130 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
   131 typedef int (WINAPI * ToUnicodeFN) (UINT, UINT, PBYTE, LPWSTR, int, UINT);
   132 
   133 extern ToUnicodeFN SDL_ToUnicode;
   134 
   135 #endif /* SDL_lowvideo_h */
   136 /* vi: set ts=4 sw=4 expandtab: */