annotate include/SDL_syswm.h @ 4393:9afe12fb4c41 SDL-1.2

Fixed bug #901 Tim Angus 2009-12-11 11:45:46 PST Disable mouse event generation when state is not SDL_APPMOUSEFOCUS If a Windows SDL application is minimised by using alt-tab, SDL_APPMOUSEFOCUS is lost as part of the minimisation. Unfortunately, the directx driver doesn't pay any attention to this state when generating mouse button events, so clicking on the Desktop can cause mouse clicks in the SDL application, while it's still minimised. The attached patch fixes this. It looks much more complicated than it actually is due to indentation; here it is ignoring whitespace: tma@abraxas:~/sources/SDL-1.2-svn$ svn diff -x -b Index: src/video/windx5/SDL_dx5events.c =================================================================== --- src/video/windx5/SDL_dx5events.c (revision 5376) +++ src/video/windx5/SDL_dx5events.c (working copy) @@ -374,10 +374,9 @@ if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { mouse_lost = 1; ClipCursor(NULL); - } - + } else { /* If the mouse was lost, regain some sense of mouse state */ - if ( mouse_lost && (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { + if ( mouse_lost ) { POINT mouse_pos; Uint8 old_state; Uint8 new_state; @@ -548,6 +547,7 @@ if ( xrel || yrel ) { post_mouse_motion(1, xrel, yrel); } + } } /* The main Win32 event handler */
author Sam Lantinga <slouken@libsdl.org>
date Mon, 14 Dec 2009 22:41:31 +0000
parents 4c4113c2162c
children 3f2d351d8274
rev   line source
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1 /*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
4159
a1b03ba2fcd0 Updated copyright date
Sam Lantinga <slouken@libsdl.org>
parents: 3872
diff changeset
3 Copyright (C) 1997-2009 Sam Lantinga
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1133
diff changeset
6 modify it under the terms of the GNU Lesser General Public
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1133
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1133
diff changeset
13 Lesser General Public License for more details.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
14
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1133
diff changeset
15 You should have received a copy of the GNU Lesser General Public
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1133
diff changeset
16 License along with this library; if not, write to the Free Software
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1133
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
18
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
19 Sam Lantinga
251
b8688cfdc232 Updated the headers with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents: 94
diff changeset
20 slouken@libsdl.org
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
21 */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
22
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
23 /** @file SDL_syswm.h
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
24 * Include file for SDL custom system window manager hooks
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
25 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
26
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
27 #ifndef _SDL_syswm_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
28 #define _SDL_syswm_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
29
1356
67114343400d *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
30 #include "SDL_stdinc.h"
1358
c71e05b4dc2e More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents: 1356
diff changeset
31 #include "SDL_error.h"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
32 #include "SDL_version.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
34 #include "begin_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
35 /* Set up for C function definitions, even when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
36 #ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
37 extern "C" {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
38 #endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
39
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
40 /** @file SDL_syswm.h
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
41 * Your application has access to a special type of event 'SDL_SYSWMEVENT',
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
42 * which contains window-manager specific information and arrives whenever
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
43 * an unhandled window event occurs. This event is ignored by default, but
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
44 * you can enable it with SDL_EventState()
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
45 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
46 #ifdef SDL_PROTOTYPES_ONLY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
47 struct SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
48 typedef struct SDL_SysWMinfo SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
49 #else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
50
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
51 /* This is the structure for custom window manager events */
1626
a80e1e0880b8 Fixed bug #176
Sam Lantinga <slouken@libsdl.org>
parents: 1487
diff changeset
52 #if defined(SDL_VIDEO_DRIVER_X11)
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
53 #if defined(__APPLE__) && defined(__MACH__)
1487
dc6b59e925a2 Cleaning up warnings on MacOS X
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
54 /* conflicts with Quickdraw.h */
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
55 #define Cursor X11Cursor
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
56 #endif
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
57
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
58 #include <X11/Xlib.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
59 #include <X11/Xatom.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
60
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
61 #if defined(__APPLE__) && defined(__MACH__)
1487
dc6b59e925a2 Cleaning up warnings on MacOS X
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
62 /* matches the re-define above */
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
63 #undef Cursor
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
64 #endif
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
65
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
66 /** These are the various supported subsystems under UNIX */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
67 typedef enum {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
68 SDL_SYSWM_X11
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
69 } SDL_SYSWM_TYPE;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
70
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
71 /** The UNIX custom event structure */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
72 struct SDL_SysWMmsg {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
73 SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
74 SDL_SYSWM_TYPE subsystem;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
75 union {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
76 XEvent xevent;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
77 } event;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
78 };
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
79
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
80 /** The UNIX custom window manager information structure.
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
81 * When this structure is returned, it holds information about which
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
82 * low level system it is using, and will be one of SDL_SYSWM_TYPE.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
83 */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
84 typedef struct SDL_SysWMinfo {
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
85 SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
86 SDL_SYSWM_TYPE subsystem;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
87 union {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
88 struct {
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
89 Display *display; /**< The X11 display */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
90 Window window; /**< The X11 display window */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
91 /** These locking functions should be called around
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
92 * any X11 functions using the display variable,
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
93 * but not the gfxdisplay variable.
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
94 * They lock the event thread, so should not be
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
95 * called around event functions or from event filters.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
96 */
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
97 /*@{*/
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
98 void (*lock_func)(void);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
99 void (*unlock_func)(void);
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
100 /*@}*/
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
101
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
102 /** @name Introduced in SDL 1.0.2 */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
103 /*@{*/
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
104 Window fswindow; /**< The X11 fullscreen window */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
105 Window wmwindow; /**< The X11 managed input window */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
106 /*@}*/
3872
be84332e761e Fixed bug #278
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
107
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
108 /** @name Introduced in SDL 1.2.12 */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
109 /*@{*/
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
110 Display *gfxdisplay; /**< The X11 display to which rendering is done */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
111 /*@}*/
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
112 } x11;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
113 } info;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
114 } SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
115
1626
a80e1e0880b8 Fixed bug #176
Sam Lantinga <slouken@libsdl.org>
parents: 1487
diff changeset
116 #elif defined(SDL_VIDEO_DRIVER_NANOX)
30
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
117 #include <microwin/nano-X.h>
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
118
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
119 /** The generic custom event structure */
30
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
120 struct SDL_SysWMmsg {
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
121 SDL_version version;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
122 int data;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
123 };
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
124
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
125 /** The windows custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
126 typedef struct SDL_SysWMinfo {
30
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
127 SDL_version version ;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
128 GR_WINDOW_ID window ; /* The display window */
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
129 } SDL_SysWMinfo;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
130
1760
a9be6a3a51d1 Patch from Dmitry Yakimov to fix building on WinCE
Sam Lantinga <slouken@libsdl.org>
parents: 1626
diff changeset
131 #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
1433
bb6839704ed6 SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
132 #define WIN32_LEAN_AND_MEAN
bb6839704ed6 SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
133 #include <windows.h>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
134
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
135 /** The windows custom event structure */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
136 struct SDL_SysWMmsg {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
137 SDL_version version;
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
138 HWND hwnd; /**< The window for the message */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
139 UINT msg; /**< The type of message */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
140 WPARAM wParam; /**< WORD message parameter */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
141 LPARAM lParam; /**< LONG message parameter */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
142 };
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
143
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
144 /** The windows custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
145 typedef struct SDL_SysWMinfo {
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
146 SDL_version version;
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
147 HWND window; /**< The Win32 display window */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
148 HGLRC hglrc; /**< The OpenGL context, if any */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
149 } SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
150
1626
a80e1e0880b8 Fixed bug #176
Sam Lantinga <slouken@libsdl.org>
parents: 1487
diff changeset
151 #elif defined(SDL_VIDEO_DRIVER_RISCOS)
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
152
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
153 /** RISC OS custom event structure */
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
154 struct SDL_SysWMmsg {
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
155 SDL_version version;
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
156 int eventCode; /**< The window for the message */
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
157 int pollBlock[64];
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
158 };
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
159
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
160 /** The RISC OS custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
161 typedef struct SDL_SysWMinfo {
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
162 SDL_version version;
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
163 int wimpVersion; /**< Wimp version running under */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
164 int taskHandle; /**< The RISC OS task handle */
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
165 int window; /**< The RISC OS display window */
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
166 } SDL_SysWMinfo;
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
167
1626
a80e1e0880b8 Fixed bug #176
Sam Lantinga <slouken@libsdl.org>
parents: 1487
diff changeset
168 #elif defined(SDL_VIDEO_DRIVER_PHOTON)
870
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
169 #include <sys/neutrino.h>
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
170 #include <Ph.h>
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
171
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
172 /** The QNX custom event structure */
870
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
173 struct SDL_SysWMmsg {
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
174 SDL_version version;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
175 int data;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
176 };
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
177
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
178 /** The QNX custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
179 typedef struct SDL_SysWMinfo {
870
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
180 SDL_version version;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
181 int data;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
182 } SDL_SysWMinfo;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
183
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
184 #else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
185
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
186 /** The generic custom event structure */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
187 struct SDL_SysWMmsg {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
188 SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
189 int data;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
190 };
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
191
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
192 /** The generic custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
193 typedef struct SDL_SysWMinfo {
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
194 SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
195 int data;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
196 } SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
197
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
198 #endif /* video driver type */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
199
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
200 #endif /* SDL_PROTOTYPES_ONLY */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
201
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
202 /* Function prototypes */
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
203 /**
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
204 * This function gives you custom hooks into the window manager information.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
205 * It fills the structure pointed to by 'info' with custom information and
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
206 * returns 1 if the function is implemented. If it's not implemented, or
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
207 * the version member of the 'info' structure is invalid, it returns 0.
999
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
208 *
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
209 * You typically use this function like this:
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
210 * @code
999
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
211 * SDL_SysWMInfo info;
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
212 * SDL_VERSION(&info.version);
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
213 * if ( SDL_GetWMInfo(&info) ) { ... }
4217
4c4113c2162c Fixed bug #706
Sam Lantinga <slouken@libsdl.org>
parents: 4159
diff changeset
214 * @endcode
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
215 */
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
216 extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
217
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
218
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
219 /* Ends C function definitions when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
220 #ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
221 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
222 #endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
223 #include "close_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
224
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
225 #endif /* _SDL_syswm_h */