comparison src/video/win32/SDL_win32events.c @ 1951:7177581dc9fa

Initial work on X11 window code in.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 27 Jul 2006 06:53:23 +0000
parents 83420da906a5
children 3bcc26b74e42
comparison
equal deleted inserted replaced
1950:a344e42bce3b 1951:7177581dc9fa
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 #include "SDL_config.h" 22 #include "SDL_config.h"
23 23
24 #include "SDL_win32video.h" 24 #include "SDL_win32video.h"
25 #include "SDL_version.h"
26 #include "SDL_syswm.h" 25 #include "SDL_syswm.h"
27 #include "SDL_vkeys.h" 26 #include "SDL_vkeys.h"
28 #include "../../events/SDL_events_c.h" 27 #include "../../events/SDL_events_c.h"
29 28
30 /*#define WMMSG_DEBUG*/ 29 /*#define WMMSG_DEBUG*/
390 389
391 LRESULT CALLBACK 390 LRESULT CALLBACK
392 WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 391 WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
393 { 392 {
394 SDL_WindowData *data; 393 SDL_WindowData *data;
394
395 /* Send a SDL_SYSWMEVENT if the application wants them */
396 if (SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE) {
397 SDL_SysWMmsg wmmsg;
398
399 SDL_VERSION(&wmmsg.version);
400 wmmsg.hwnd = hwnd;
401 wmmsg.msg = msg;
402 wmmsg.wParam = wParam;
403 wmmsg.lParam = lParam;
404 SDL_SendSysWMEvent(&wmmsg);
405 }
395 406
396 /* Get the window data for the window */ 407 /* Get the window data for the window */
397 data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData")); 408 data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData"));
398 if (!data) { 409 if (!data) {
399 return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam); 410 return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
409 } 420 }
410 fprintf(log, " -- 0x%X, 0x%X\n", wParam, lParam); 421 fprintf(log, " -- 0x%X, 0x%X\n", wParam, lParam);
411 fclose(log); 422 fclose(log);
412 } 423 }
413 #endif 424 #endif
414
415 /* Send a SDL_SYSWMEVENT if the application wants them */
416 if (SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE) {
417 SDL_SysWMmsg wmmsg;
418
419 SDL_VERSION(&wmmsg.version);
420 wmmsg.hwnd = hwnd;
421 wmmsg.msg = msg;
422 wmmsg.wParam = wParam;
423 wmmsg.lParam = lParam;
424 SDL_SendSysWMEvent(&wmmsg);
425 }
426 425
427 switch (msg) { 426 switch (msg) {
428 427
429 case WM_SHOWWINDOW: 428 case WM_SHOWWINDOW:
430 { 429 {