2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2006 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
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
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 /* Include file for SDL custom system window manager hooks */
28 #include "SDL_stdinc.h"
29 #include "SDL_error.h"
30 #include "SDL_version.h"
32 #include "begin_code.h"
33 /* Set up for C function definitions, even when using C++ */
38 /* Your application has access to a special type of event 'SDL_SYSWMEVENT',
39 which contains window-manager specific information and arrives whenever
40 an unhandled window event occurs. This event is ignored by default, but
41 you can enable it with SDL_EventState()
43 #ifdef SDL_PROTOTYPES_ONLY
45 typedef struct SDL_SysWMinfo SDL_SysWMinfo;
48 /* This is the structure for custom window manager events */
49 #if defined(SDL_VIDEO_DRIVER_X11)
50 #if defined(__APPLE__) && defined(__MACH__)
51 /* conflicts with Quickdraw.h */
52 #define Cursor X11Cursor
56 #include <X11/Xatom.h>
58 #if defined(__APPLE__) && defined(__MACH__)
59 /* matches the re-define above */
63 /* These are the various supported subsystems under UNIX */
68 /* The UNIX custom event structure */
71 SDL_SYSWM_TYPE subsystem;
77 /* The UNIX custom window manager information structure.
78 When this structure is returned, it holds information about which
79 low level system it is using, and will be one of SDL_SYSWM_TYPE.
81 typedef struct SDL_SysWMinfo {
83 SDL_SYSWM_TYPE subsystem;
86 Display *display; /* The X11 display */
87 Window window; /* The X11 display window */
88 /* These locking functions should be called around
89 any X11 functions using the display variable.
90 They lock the event thread, so should not be
91 called around event functions or from event filters.
93 void (*lock_func)(void);
94 void (*unlock_func)(void);
96 /* Introduced in SDL 1.0.2 */
97 Window fswindow; /* The X11 fullscreen window */
98 Window wmwindow; /* The X11 managed input window */
103 #elif defined(SDL_VIDEO_DRIVER_NANOX)
104 #include <microwin/nano-X.h>
106 /* The generic custom event structure */
107 struct SDL_SysWMmsg {
112 /* The windows custom window manager information structure */
113 typedef struct SDL_SysWMinfo {
114 SDL_version version ;
115 GR_WINDOW_ID window ; /* The display window */
118 #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
119 #define WIN32_LEAN_AND_MEAN
122 /* The windows custom event structure */
123 struct SDL_SysWMmsg {
125 HWND hwnd; /* The window for the message */
126 UINT msg; /* The type of message */
127 WPARAM wParam; /* WORD message parameter */
128 LPARAM lParam; /* LONG message parameter */
131 /* The windows custom window manager information structure */
132 typedef struct SDL_SysWMinfo {
134 HWND window; /* The Win32 display window */
135 HGLRC hglrc; /* The OpenGL context, if any */
138 #elif defined(SDL_VIDEO_DRIVER_RISCOS)
140 /* RISC OS custom event structure */
141 struct SDL_SysWMmsg {
143 int eventCode; /* The window for the message */
147 /* The RISC OS custom window manager information structure */
148 typedef struct SDL_SysWMinfo {
150 int wimpVersion; /* Wimp version running under */
151 int taskHandle; /* The RISC OS task handle */
152 int window; /* The RISC OS display window */
155 #elif defined(SDL_VIDEO_DRIVER_PHOTON)
156 #include <sys/neutrino.h>
159 /* The QNX custom event structure */
160 struct SDL_SysWMmsg {
165 /* The QNX custom window manager information structure */
166 typedef struct SDL_SysWMinfo {
173 /* The generic custom event structure */
174 struct SDL_SysWMmsg {
179 /* The generic custom window manager information structure */
180 typedef struct SDL_SysWMinfo {
185 #endif /* video driver type */
187 #endif /* SDL_PROTOTYPES_ONLY */
189 /* Function prototypes */
191 * This function gives you custom hooks into the window manager information.
192 * It fills the structure pointed to by 'info' with custom information and
193 * returns 1 if the function is implemented. If it's not implemented, or
194 * the version member of the 'info' structure is invalid, it returns 0.
196 * You typically use this function like this:
197 * SDL_SysWMInfo info;
198 * SDL_VERSION(&info.version);
199 * if ( SDL_GetWMInfo(&info) ) { ... }
201 extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
204 /* Ends C function definitions when using C++ */
208 #include "close_code.h"
210 #endif /* _SDL_syswm_h */