Mercurial > sdl-ios-xcode
annotate include/SDL_syswm.h @ 1356:67114343400d
*** empty log message ***
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 10 Feb 2006 03:19:02 +0000 |
parents | 450721ad5436 |
children | c71e05b4dc2e |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1133
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
0 | 4 |
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 | 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 | 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 | |
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 | 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 | 18 |
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 | 21 */ |
22 | |
23 /* Include file for SDL custom system window manager hooks */ | |
24 | |
25 #ifndef _SDL_syswm_h | |
26 #define _SDL_syswm_h | |
27 | |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
28 #include "SDL_stdinc.h" |
0 | 29 #include "SDL_version.h" |
30 | |
31 #include "begin_code.h" | |
32 /* Set up for C function definitions, even when using C++ */ | |
33 #ifdef __cplusplus | |
34 extern "C" { | |
35 #endif | |
36 | |
37 /* Your application has access to a special type of event 'SDL_SYSWMEVENT', | |
38 which contains window-manager specific information and arrives whenever | |
39 an unhandled window event occurs. This event is ignored by default, but | |
40 you can enable it with SDL_EventState() | |
41 */ | |
42 #ifdef SDL_PROTOTYPES_ONLY | |
43 struct SDL_SysWMinfo; | |
44 typedef struct SDL_SysWMinfo SDL_SysWMinfo; | |
45 #else | |
46 | |
1133
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
47 #if defined(__APPLE__) && defined(__MACH__) |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
48 // conflicts with Quickdraw.h |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
49 #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
|
50 #endif |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
51 |
0 | 52 /* This is the structure for custom window manager events */ |
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(unix) || defined(__unix__) || defined(_AIX) || \ |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
54 defined(__OpenBSD__) || defined(__NetBSD__) || \ |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
55 (defined(__APPLE__) && defined(__MACH__))) && \ |
870
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
56 (!defined(DISABLE_X11) && !defined(__CYGWIN32__) && !defined(ENABLE_NANOX) && \ |
1133
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
57 !defined(__QNXNTO__)) |
0 | 58 /* AIX is unix, of course, but the native compiler CSet doesn't define unix */ |
59 #include <X11/Xlib.h> | |
60 #include <X11/Xatom.h> | |
61 | |
1133
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
62 #if defined(__APPLE__) && defined(__MACH__) |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
63 // matches the re-define above |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
64 #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
|
65 #endif |
609c060fd2a2
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents:
1035
diff
changeset
|
66 |
0 | 67 /* These are the various supported subsystems under UNIX */ |
68 typedef enum { | |
69 SDL_SYSWM_X11 | |
70 } SDL_SYSWM_TYPE; | |
71 | |
72 /* The UNIX custom event structure */ | |
73 struct SDL_SysWMmsg { | |
74 SDL_version version; | |
75 SDL_SYSWM_TYPE subsystem; | |
76 union { | |
77 XEvent xevent; | |
78 } event; | |
79 }; | |
80 | |
81 /* The UNIX custom window manager information structure. | |
82 When this structure is returned, it holds information about which | |
83 low level system it is using, and will be one of SDL_SYSWM_TYPE. | |
84 */ | |
911
04a403e4ccf5
Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
870
diff
changeset
|
85 typedef struct SDL_SysWMinfo { |
0 | 86 SDL_version version; |
87 SDL_SYSWM_TYPE subsystem; | |
88 union { | |
89 struct { | |
90 Display *display; /* The X11 display */ | |
91 Window window; /* The X11 display window */ | |
92 /* These locking functions should be called around | |
93 any X11 functions using the display variable. | |
94 They lock the event thread, so should not be | |
95 called around event functions or from event filters. | |
96 */ | |
97 void (*lock_func)(void); | |
98 void (*unlock_func)(void); | |
99 | |
100 /* Introduced in SDL 1.0.2 */ | |
101 Window fswindow; /* The X11 fullscreen window */ | |
102 Window wmwindow; /* The X11 managed input window */ | |
103 } x11; | |
104 } info; | |
105 } SDL_SysWMinfo; | |
106 | |
30
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
107 #elif defined(ENABLE_NANOX) |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
108 #include <microwin/nano-X.h> |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
109 |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
110 /* The generic custom event structure */ |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
111 struct SDL_SysWMmsg { |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
112 SDL_version version; |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
113 int data; |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
114 }; |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
115 |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
116 /* 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
|
117 typedef struct SDL_SysWMinfo { |
30
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
118 SDL_version version ; |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
119 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
|
120 } SDL_SysWMinfo; |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
121 |
0 | 122 #elif defined(WIN32) |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
123 #include "SDL_windows.h" |
0 | 124 |
125 /* The windows custom event structure */ | |
126 struct SDL_SysWMmsg { | |
127 SDL_version version; | |
128 HWND hwnd; /* The window for the message */ | |
129 UINT msg; /* The type of message */ | |
130 WPARAM wParam; /* WORD message parameter */ | |
131 LPARAM lParam; /* LONG message parameter */ | |
132 }; | |
133 | |
134 /* 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
|
135 typedef struct SDL_SysWMinfo { |
0 | 136 SDL_version version; |
137 HWND window; /* The Win32 display window */ | |
438
f9c5f135a8b9
Added a way to get the Windows OpenGL context in SDL_syswm.h
Sam Lantinga <slouken@libsdl.org>
parents:
337
diff
changeset
|
138 HGLRC hglrc; /* The OpenGL context, if any */ |
0 | 139 } SDL_SysWMinfo; |
140 | |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
141 #elif defined(__riscos__) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
142 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
143 /* RISC OS custom event structure */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
144 struct SDL_SysWMmsg { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
145 SDL_version version; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
146 int eventCode; /* The window for the message */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
147 int pollBlock[64]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
148 }; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
149 |
1035
974ba6ae0fa3
Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents:
1026
diff
changeset
|
150 /* 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
|
151 typedef struct SDL_SysWMinfo { |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
152 SDL_version version; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
153 int wimpVersion; /* Wimp version running under */ |
1035
974ba6ae0fa3
Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents:
1026
diff
changeset
|
154 int taskHandle; /* The RISC OS task handle */ |
974ba6ae0fa3
Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents:
1026
diff
changeset
|
155 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
|
156 } SDL_SysWMinfo; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
471
diff
changeset
|
157 |
870
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
158 #elif defined(__QNXNTO__) |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
159 #include <sys/neutrino.h> |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
160 #include <Ph.h> |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
161 |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
162 /* The QNX custom event structure */ |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
163 struct SDL_SysWMmsg { |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
164 SDL_version version; |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
165 int data; |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
166 }; |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
167 |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
168 /* 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
|
169 typedef struct SDL_SysWMinfo { |
870
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
170 SDL_version version; |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
171 int data; |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
172 } SDL_SysWMinfo; |
95f22f17e44a
Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
173 |
0 | 174 #else |
175 | |
176 /* The generic custom event structure */ | |
177 struct SDL_SysWMmsg { | |
178 SDL_version version; | |
179 int data; | |
180 }; | |
181 | |
182 /* 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
|
183 typedef struct SDL_SysWMinfo { |
0 | 184 SDL_version version; |
185 int data; | |
186 } SDL_SysWMinfo; | |
187 | |
188 #endif /* OS type */ | |
189 | |
190 #endif /* SDL_PROTOTYPES_ONLY */ | |
191 | |
192 /* Function prototypes */ | |
193 /* | |
194 * This function gives you custom hooks into the window manager information. | |
195 * It fills the structure pointed to by 'info' with custom information and | |
196 * returns 1 if the function is implemented. If it's not implemented, or | |
197 * 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
|
198 * |
8be85fa59cf3
Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents:
911
diff
changeset
|
199 * You typically use this function like this: |
8be85fa59cf3
Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents:
911
diff
changeset
|
200 * SDL_SysWMInfo info; |
8be85fa59cf3
Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents:
911
diff
changeset
|
201 * SDL_VERSION(&info.version); |
8be85fa59cf3
Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents:
911
diff
changeset
|
202 * if ( SDL_GetWMInfo(&info) ) { ... } |
0 | 203 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
204 extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); |
0 | 205 |
206 | |
207 /* Ends C function definitions when using C++ */ | |
208 #ifdef __cplusplus | |
209 } | |
210 #endif | |
211 #include "close_code.h" | |
212 | |
213 #endif /* _SDL_syswm_h */ |