2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
25 * Include file for SDL custom system window manager hooks.
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34 #include "SDL_version.h"
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
45 * Your application has access to a special type of event ::SDL_SYSWMEVENT,
46 * which contains window-manager specific information and arrives whenever
47 * an unhandled window event occurs. This event is ignored by default, but
48 * you can enable it with SDL_EventState().
50 #ifdef SDL_PROTOTYPES_ONLY
54 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
55 #define WIN32_LEAN_AND_MEAN
59 /* This is the structure for custom window manager events */
60 #if defined(SDL_VIDEO_DRIVER_X11)
61 #if defined(__APPLE__) && defined(__MACH__)
62 /* conflicts with Quickdraw.h */
63 #define Cursor X11Cursor
67 #include <X11/Xatom.h>
69 #if defined(__APPLE__) && defined(__MACH__)
70 /* matches the re-define above */
74 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
76 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
80 #if defined(SDL_VIDEO_DRIVER_COCOA)
82 #include <Cocoa/Cocoa.h>
84 typedef struct _NSWindow NSWindow
;
88 #if defined(SDL_VIDEO_DRIVER_UIKIT)
90 #include <UIKit/UIKit.h>
92 typedef struct _UIWindow UIWindow
;
97 * These are the various supported windowing subsystems
110 * The custom event structure.
115 SDL_SYSWM_TYPE subsystem
;
118 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
120 HWND hwnd
; /**< The window for the message */
121 UINT msg
; /**< The type of message */
122 WPARAM wParam
; /**< WORD message parameter */
123 LPARAM lParam
; /**< LONG message parameter */
126 #if defined(SDL_VIDEO_DRIVER_X11)
131 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
136 #if defined(SDL_VIDEO_DRIVER_COCOA)
139 /* No Cocoa window events yet */
142 #if defined(SDL_VIDEO_DRIVER_UIKIT)
145 /* No UIKit window events yet */
148 /* Can't have an empty union */
154 * The custom window manager information structure.
156 * When this structure is returned, it holds information about which
157 * low level system it is using, and will be one of SDL_SYSWM_TYPE.
162 SDL_SYSWM_TYPE subsystem
;
165 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
168 HWND window
; /**< The window handle */
171 #if defined(SDL_VIDEO_DRIVER_X11)
174 Display
*display
; /**< The X11 display */
175 Window window
; /**< The X11 window */
178 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
181 IDirectFB
*dfb
; /**< The directfb main interface */
182 IDirectFBWindow
*window
; /**< The directfb window handle */
183 IDirectFBSurface
*surface
; /**< The directfb client surface */
186 #if defined(SDL_VIDEO_DRIVER_COCOA)
189 NSWindow
*window
; /* The Cocoa window */
192 #if defined(SDL_VIDEO_DRIVER_UIKIT)
195 UIWindow
*window
; /* The UIKit window */
198 /* Can't have an empty union */
203 #endif /* SDL_PROTOTYPES_ONLY */
205 typedef struct SDL_SysWMinfo SDL_SysWMinfo
;
207 /* Function prototypes */
209 * \brief This function allows access to driver-dependent window information.
211 * \param window The window about which information is being requested
212 * \param info This structure must be initialized with the SDL version, and is
213 * then filled in with information about the given window.
215 * \return SDL_TRUE if the function is implemented and the version member of
216 * the \c info struct is valid, SDL_FALSE otherwise.
218 * You typically use this function like this:
220 * SDL_SysWMinfo info;
221 * SDL_VERSION(&info.version);
222 * if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
225 extern DECLSPEC SDL_bool SDLCALL
SDL_GetWindowWMInfo(SDL_Window
* window
,
226 SDL_SysWMinfo
* info
);
229 /* Ends C function definitions when using C++ */
233 #include "close_code.h"
235 #endif /* _SDL_syswm_h */
237 /* vi: set ts=4 sw=4 expandtab: */