Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_sysevents.c @ 1152:51a8702d8ecd
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
activekitten.com.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 29 Sep 2005 09:43:00 +0000 |
parents | 7d8e1925f35b |
children | 86d0d01290ea |
comparison
equal
deleted
inserted
replaced
1151:be9c9c8f6d53 | 1152:51a8702d8ecd |
---|---|
38 #include "SDL_events_c.h" | 38 #include "SDL_events_c.h" |
39 #include "SDL_sysvideo.h" | 39 #include "SDL_sysvideo.h" |
40 #include "SDL_lowvideo.h" | 40 #include "SDL_lowvideo.h" |
41 #include "SDL_syswm_c.h" | 41 #include "SDL_syswm_c.h" |
42 #include "SDL_main.h" | 42 #include "SDL_main.h" |
43 #include "SDL_loadso.h" | |
43 | 44 |
44 #ifdef WMMSG_DEBUG | 45 #ifdef WMMSG_DEBUG |
45 #include "wmmsg.h" | 46 #include "wmmsg.h" |
46 #endif | 47 #endif |
47 | 48 |
69 #endif | 70 #endif |
70 WORD *gamma_saved = NULL; | 71 WORD *gamma_saved = NULL; |
71 | 72 |
72 | 73 |
73 /* Functions called by the message processing function */ | 74 /* Functions called by the message processing function */ |
74 LONG | 75 LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; |
75 (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; | |
76 void (*WIN_RealizePalette)(_THIS); | 76 void (*WIN_RealizePalette)(_THIS); |
77 void (*WIN_PaletteChanged)(_THIS, HWND window); | 77 void (*WIN_PaletteChanged)(_THIS, HWND window); |
78 void (*WIN_WinPAINT)(_THIS, HDC hdc); | 78 void (*WIN_WinPAINT)(_THIS, HDC hdc); |
79 extern void DIB_SwapGamma(_THIS); | 79 extern void DIB_SwapGamma(_THIS); |
80 | |
81 #if defined(_WIN32_WCE) | |
82 | |
83 // dynamically load aygshell dll because we want SDL to work on HPC and be300 | |
84 HINSTANCE aygshell = NULL; | |
85 BOOL (WINAPI *SHFullScreen)(HWND hwndRequester, DWORD dwState) = 0; | |
86 | |
87 #define SHFS_SHOWTASKBAR 0x0001 | |
88 #define SHFS_HIDETASKBAR 0x0002 | |
89 #define SHFS_SHOWSIPBUTTON 0x0004 | |
90 #define SHFS_HIDESIPBUTTON 0x0008 | |
91 #define SHFS_SHOWSTARTICON 0x0010 | |
92 #define SHFS_HIDESTARTICON 0x0020 | |
93 | |
94 static void LoadAygshell(void) | |
95 { | |
96 if( !aygshell ) | |
97 aygshell = SDL_LoadObject("aygshell.dll"); | |
98 if( aygshell ) | |
99 { | |
100 SHFullScreen = (int (WINAPI *)(struct HWND__ *,unsigned long)) SDL_LoadFunction(aygshell, "SHFullScreen"); | |
101 } | |
102 } | |
103 | |
104 #endif | |
80 | 105 |
81 static void SDL_RestoreGameMode(void) | 106 static void SDL_RestoreGameMode(void) |
82 { | 107 { |
83 #ifndef NO_CHANGEDISPLAYSETTINGS | 108 #ifndef NO_CHANGEDISPLAYSETTINGS |
84 ShowWindow(SDL_Window, SW_RESTORE); | 109 ShowWindow(SDL_Window, SW_RESTORE); |
211 } | 236 } |
212 if ( WINDIB_FULLSCREEN() ) { | 237 if ( WINDIB_FULLSCREEN() ) { |
213 SDL_RestoreGameMode(); | 238 SDL_RestoreGameMode(); |
214 } | 239 } |
215 } | 240 } |
241 #if defined(_WIN32_WCE) | |
242 if ( WINDIB_FULLSCREEN() ) | |
243 { | |
244 LoadAygshell(); | |
245 if( aygshell ) | |
246 SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON); | |
247 else | |
248 ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE); | |
249 | |
250 } | |
251 #endif | |
252 | |
216 posted = SDL_PrivateAppActive(1, appstate); | 253 posted = SDL_PrivateAppActive(1, appstate); |
217 WIN_GetKeyboardState(); | 254 WIN_GetKeyboardState(); |
218 } else { | 255 } else { |
219 /* Lose the following states */ | 256 /* Lose the following states */ |
220 appstate = SDL_APPINPUTFOCUS; | 257 appstate = SDL_APPINPUTFOCUS; |
228 if ( ! DDRAW_FULLSCREEN() ) { | 265 if ( ! DDRAW_FULLSCREEN() ) { |
229 DIB_SwapGamma(this); | 266 DIB_SwapGamma(this); |
230 } | 267 } |
231 if ( WINDIB_FULLSCREEN() ) { | 268 if ( WINDIB_FULLSCREEN() ) { |
232 SDL_RestoreDesktopMode(); | 269 SDL_RestoreDesktopMode(); |
270 #if defined(_WIN32_WCE) | |
271 LoadAygshell(); | |
272 if( aygshell ) | |
273 SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON); | |
274 else | |
275 ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW); | |
276 | |
277 #endif | |
233 } | 278 } |
234 } | 279 } |
235 posted = SDL_PrivateAppActive(0, appstate); | 280 posted = SDL_PrivateAppActive(0, appstate); |
236 } | 281 } |
237 return(0); | 282 return(0); |