src/video/wincommon/SDL_lowvideo.h
author Sam Lantinga <slouken@libsdl.org>
Thu, 19 Jan 2006 09:09:32 +0000
changeset 1253 7c7ddaf195bf
parent 1251 86d0d01290ea
child 1280 f61f045343d3
permissions -rw-r--r--
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
This is a collaborative effort between Alex Volkov and John Popplewell.
Thanks guys! (Fixes bug #39)
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2004 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Library General Public
     7     License as published by the Free Software Foundation; either
     8     version 2 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     Library General Public License for more details.
    14 
    15     You should have received a copy of the GNU Library General Public
    16     License along with this library; if not, write to the Free
    17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #ifdef SAVE_RCSID
    24 static char rcsid =
    25  "@(#) $Id$";
    26 #endif
    27 
    28 #ifndef _SDL_lowvideo_h
    29 #define _SDL_lowvideo_h
    30 
    31 #include <windows.h>
    32 
    33 #include "SDL_sysvideo.h"
    34 
    35 /* Hidden "this" pointer for the video functions */
    36 #define _THIS	SDL_VideoDevice *this
    37 
    38 #define WINDIB_FULLSCREEN()						\
    39 (									\
    40 	SDL_VideoSurface &&						\
    41 	((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
    42 	(((SDL_VideoSurface->flags & SDL_OPENGL   ) == SDL_OPENGL    ) || \
    43 	((strcmp(this->name, "windib") == 0) || \
    44 	 (strcmp(this->name, "gapi") == 0))) \
    45 )
    46 #define DDRAW_FULLSCREEN() 						\
    47 (									\
    48 	SDL_VideoSurface &&						\
    49 	((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
    50 	((SDL_VideoSurface->flags & SDL_OPENGL    ) != SDL_OPENGL    ) && \
    51 	(strcmp(this->name, "directx") == 0)				\
    52 )
    53 
    54 #define DINPUT_FULLSCREEN()	DDRAW_FULLSCREEN()
    55 
    56 /* The main window -- and a function to set it for the audio */
    57 #ifdef _WIN32_WCE
    58 extern LPWSTR SDL_Appname;
    59 #else
    60 extern LPSTR SDL_Appname;
    61 #endif
    62 extern HINSTANCE SDL_Instance;
    63 extern HWND SDL_Window;
    64 extern const char *SDL_windowid;
    65 
    66 /* Variables and functions exported to other parts of the native video
    67    subsystem (SDL_sysevents.c)
    68 */
    69 /* Called by windows message loop when system palette is available */
    70 extern void (*WIN_RealizePalette)(_THIS);
    71 
    72 /* Called by windows message loop when the system palette changes */
    73 extern void (*WIN_PaletteChanged)(_THIS, HWND window);
    74 
    75 /* Called by windows message loop when a portion of the screen needs update */
    76 extern void (*WIN_WinPAINT)(_THIS, HDC hdc);
    77 
    78 /* Called by windows message loop when the message isn't handled */
    79 extern LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
    80 
    81 /* The window cursor (from SDL_sysmouse.c) */
    82 extern HCURSOR SDL_hcursor;
    83 
    84 /* The bounds of the window in screen coordinates */
    85 extern RECT SDL_bounds;
    86 
    87 /* The position of the window in windowed mode */
    88 extern int SDL_windowX;
    89 extern int SDL_windowY;
    90 
    91 /* Flag -- SDL is performing a resize, rather than the user */
    92 extern int SDL_resizing;
    93 
    94 /* Flag -- the mouse is in relative motion mode */
    95 extern int mouse_relative;
    96 
    97 /* The GDI fullscreen mode currently active */
    98 #ifndef NO_CHANGEDISPLAYSETTINGS
    99 extern DEVMODE SDL_fullscreen_mode;
   100 #endif
   101 
   102 /* The system gamma ramp for GDI modes */
   103 extern WORD *gamma_saved;
   104 
   105 /* This is really from SDL_dx5audio.c */
   106 extern void DX5_SoundFocus(HWND window);
   107 
   108 /* DJM: This is really from SDL_sysevents.c, we need it in
   109    GDL_CreateWindow as well */
   110 LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
   111 
   112 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
   113 typedef int (WINAPI *ToUnicodeFN)(UINT, UINT, PBYTE, LPWSTR, int, UINT);
   114 
   115 extern ToUnicodeFN SDL_ToUnicode;
   116 
   117 #endif /* SDL_lowvideo_h */