comparison src/video/wincommon/SDL_sysevents.c @ 4162:3b7fc3416601 SDL-1.2

GAPI fixes from Stefan Klug
author Sam Lantinga <slouken@libsdl.org>
date Mon, 16 Feb 2009 22:32:34 +0000
parents a1b03ba2fcd0
children a6f635e5eaa6
comparison
equal deleted inserted replaced
4161:bd91db0b0b5d 4162:3b7fc3416601
48 48
49 #ifdef WMMSG_DEBUG 49 #ifdef WMMSG_DEBUG
50 #include "wmmsg.h" 50 #include "wmmsg.h"
51 #endif 51 #endif
52 52
53 #include "../windib/SDL_gapidibvideo.h"
54
55 #ifdef SDL_VIDEO_DRIVER_GAPI
56 #include "../gapi/SDL_gapivideo.h"
57 #endif
58
53 #ifdef _WIN32_WCE 59 #ifdef _WIN32_WCE
54 #include "../gapi/SDL_gapivideo.h"
55
56 #define IsZoomed(HWND) 1 60 #define IsZoomed(HWND) 1
57 #define NO_GETKEYBOARDSTATE 61 #define NO_GETKEYBOARDSTATE
58 #if _WIN32_WCE < 420 62 #if _WIN32_WCE < 420
59 #define NO_CHANGEDISPLAYSETTINGS 63 #define NO_CHANGEDISPLAYSETTINGS
60 #endif 64 #endif
100 ToUnicodeFN SDL_ToUnicode = ToUnicode9xME; 104 ToUnicodeFN SDL_ToUnicode = ToUnicode9xME;
101 #endif /* !NO_GETKEYBOARDSTATE */ 105 #endif /* !NO_GETKEYBOARDSTATE */
102 106
103 107
104 #if defined(_WIN32_WCE) 108 #if defined(_WIN32_WCE)
109
110 //AdjustWindowRect is not available under WinCE 2003
111 #define AdjustWindowRect(a,b,c) (AdjustWindowRectEx((a),(b),(c),0))
105 112
106 // dynamically load aygshell dll because we want SDL to work on HPC and be300 113 // dynamically load aygshell dll because we want SDL to work on HPC and be300
107 HINSTANCE aygshell = NULL; 114 HINSTANCE aygshell = NULL;
108 BOOL (WINAPI *SHFullScreen)(HWND hwndRequester, DWORD dwState) = 0; 115 BOOL (WINAPI *SHFullScreen)(HWND hwndRequester, DWORD dwState) = 0;
109 116
209 } 216 }
210 } 217 }
211 218
212 static void SDL_RestoreGameMode(void) 219 static void SDL_RestoreGameMode(void)
213 { 220 {
214 #ifdef _WIN32_WCE 221 #ifdef _WIN32_WCE //Under ce we don't minimize, therefore no restore
222
223 #ifdef SDL_VIDEO_DRIVER_GAPI
215 SDL_VideoDevice *this = current_video; 224 SDL_VideoDevice *this = current_video;
216 if(SDL_strcmp(this->name, "gapi") == 0) 225 if(SDL_strcmp(this->name, "gapi") == 0)
217 { 226 {
218 if( this->hidden->suspended ) 227 if( this->hidden->gapiInfo->suspended )
219 { 228 {
220 this->hidden->suspended = 0; 229 this->hidden->gapiInfo->suspended = 0;
221 } 230 }
222 } 231 }
232 #endif
233
223 #else 234 #else
224 ShowWindow(SDL_Window, SW_RESTORE); 235 ShowWindow(SDL_Window, SW_RESTORE);
225 #endif 236 #endif
226 237
227 #ifndef NO_CHANGEDISPLAYSETTINGS 238 #ifndef NO_CHANGEDISPLAYSETTINGS
232 } 243 }
233 static void SDL_RestoreDesktopMode(void) 244 static void SDL_RestoreDesktopMode(void)
234 { 245 {
235 246
236 #ifdef _WIN32_WCE 247 #ifdef _WIN32_WCE
248
249 #ifdef SDL_VIDEO_DRIVER_GAPI
237 SDL_VideoDevice *this = current_video; 250 SDL_VideoDevice *this = current_video;
238 if(SDL_strcmp(this->name, "gapi") == 0) 251 if(SDL_strcmp(this->name, "gapi") == 0)
239 { 252 {
240 if( !this->hidden->suspended ) 253 if( !this->hidden->gapiInfo->suspended )
241 { 254 {
242 this->hidden->suspended = 1; 255 this->hidden->gapiInfo->suspended = 1;
243 } 256 }
244 } 257 }
258 #endif
259
245 #else 260 #else
246 /* WinCE does not have a taskbar, so minimizing is not convenient */ 261 /* WinCE does not have a taskbar, so minimizing is not convenient */
247 ShowWindow(SDL_Window, SW_MINIMIZE); 262 ShowWindow(SDL_Window, SW_MINIMIZE);
248 #endif 263 #endif
249 264
457 ClientToScreen(SDL_Window, &center); 472 ClientToScreen(SDL_Window, &center);
458 SetCursorPos(center.x, center.y); 473 SetCursorPos(center.x, center.y);
459 posted = SDL_PrivateMouseMotion(0, 1, x, y); 474 posted = SDL_PrivateMouseMotion(0, 1, x, y);
460 } 475 }
461 } else { 476 } else {
462 #ifdef _WIN32_WCE 477 #ifdef SDL_VIDEO_DRIVER_GAPI
463 if (SDL_VideoSurface) 478 if (SDL_VideoSurface && this->hidden->gapiInfo)
464 GapiTransform(this->hidden->userOrientation, this->hidden->hiresFix, &x, &y); 479 GapiTransform(this->hidden->gapiInfo->coordinateTransform, this->hidden->gapiInfo->hiresFix, &x, &y);
465 #endif 480 #endif
466 posted = SDL_PrivateMouseMotion(0, 0, x, y); 481 posted = SDL_PrivateMouseMotion(0, 0, x, y);
467 } 482 }
468 } 483 }
469 } 484 }
562 report internal mouse position if in relative mode */ 577 report internal mouse position if in relative mode */
563 x = 0; y = 0; 578 x = 0; y = 0;
564 } else { 579 } else {
565 x = (Sint16)LOWORD(lParam); 580 x = (Sint16)LOWORD(lParam);
566 y = (Sint16)HIWORD(lParam); 581 y = (Sint16)HIWORD(lParam);
567 #ifdef _WIN32_WCE 582 #ifdef SDL_VIDEO_DRIVER_GAPI
568 if (SDL_VideoSurface) 583 if (SDL_VideoSurface && this->hidden->gapiInfo)
569 GapiTransform(this->hidden->userOrientation, this->hidden->hiresFix, &x, &y); 584 GapiTransform(this->hidden->gapiInfo->coordinateTransform, this->hidden->gapiInfo->hiresFix, &x, &y);
570 #endif 585 #endif
571 } 586 }
572 posted = SDL_PrivateMouseButton( 587 posted = SDL_PrivateMouseButton(
573 state, button, x, y); 588 state, button, x, y);
574 589