SDL Library

Dependents:   H261_decoder

Committer:
miruga27
Date:
Thu Sep 22 00:03:09 2016 +0000
Revision:
0:7fb6877b5d7c
SDL

Who changed what in which revision?

UserRevisionLine numberNew contents of line
miruga27 0:7fb6877b5d7c 1 /*
miruga27 0:7fb6877b5d7c 2 Simple DirectMedia Layer
miruga27 0:7fb6877b5d7c 3 Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
miruga27 0:7fb6877b5d7c 4
miruga27 0:7fb6877b5d7c 5 This software is provided 'as-is', without any express or implied
miruga27 0:7fb6877b5d7c 6 warranty. In no event will the authors be held liable for any damages
miruga27 0:7fb6877b5d7c 7 arising from the use of this software.
miruga27 0:7fb6877b5d7c 8
miruga27 0:7fb6877b5d7c 9 Permission is granted to anyone to use this software for any purpose,
miruga27 0:7fb6877b5d7c 10 including commercial applications, and to alter it and redistribute it
miruga27 0:7fb6877b5d7c 11 freely, subject to the following restrictions:
miruga27 0:7fb6877b5d7c 12
miruga27 0:7fb6877b5d7c 13 1. The origin of this software must not be misrepresented; you must not
miruga27 0:7fb6877b5d7c 14 claim that you wrote the original software. If you use this software
miruga27 0:7fb6877b5d7c 15 in a product, an acknowledgment in the product documentation would be
miruga27 0:7fb6877b5d7c 16 appreciated but is not required.
miruga27 0:7fb6877b5d7c 17 2. Altered source versions must be plainly marked as such, and must not be
miruga27 0:7fb6877b5d7c 18 misrepresented as being the original software.
miruga27 0:7fb6877b5d7c 19 3. This notice may not be removed or altered from any source distribution.
miruga27 0:7fb6877b5d7c 20 */
miruga27 0:7fb6877b5d7c 21
miruga27 0:7fb6877b5d7c 22 /**
miruga27 0:7fb6877b5d7c 23 * \file SDL_syswm.h
miruga27 0:7fb6877b5d7c 24 *
miruga27 0:7fb6877b5d7c 25 * Include file for SDL custom system window manager hooks.
miruga27 0:7fb6877b5d7c 26 */
miruga27 0:7fb6877b5d7c 27
miruga27 0:7fb6877b5d7c 28 #ifndef _SDL_syswm_h
miruga27 0:7fb6877b5d7c 29 #define _SDL_syswm_h
miruga27 0:7fb6877b5d7c 30
miruga27 0:7fb6877b5d7c 31 #include "SDL_stdinc.h"
miruga27 0:7fb6877b5d7c 32 #include "SDL_error.h"
miruga27 0:7fb6877b5d7c 33 #include "SDL_video.h"
miruga27 0:7fb6877b5d7c 34 #include "SDL_version.h"
miruga27 0:7fb6877b5d7c 35
miruga27 0:7fb6877b5d7c 36 #include "begin_code.h"
miruga27 0:7fb6877b5d7c 37 /* Set up for C function definitions, even when using C++ */
miruga27 0:7fb6877b5d7c 38 #ifdef __cplusplus
miruga27 0:7fb6877b5d7c 39 extern "C" {
miruga27 0:7fb6877b5d7c 40 #endif
miruga27 0:7fb6877b5d7c 41
miruga27 0:7fb6877b5d7c 42 /**
miruga27 0:7fb6877b5d7c 43 * \file SDL_syswm.h
miruga27 0:7fb6877b5d7c 44 *
miruga27 0:7fb6877b5d7c 45 * Your application has access to a special type of event ::SDL_SYSWMEVENT,
miruga27 0:7fb6877b5d7c 46 * which contains window-manager specific information and arrives whenever
miruga27 0:7fb6877b5d7c 47 * an unhandled window event occurs. This event is ignored by default, but
miruga27 0:7fb6877b5d7c 48 * you can enable it with SDL_EventState().
miruga27 0:7fb6877b5d7c 49 */
miruga27 0:7fb6877b5d7c 50 #ifdef SDL_PROTOTYPES_ONLY
miruga27 0:7fb6877b5d7c 51 struct SDL_SysWMinfo;
miruga27 0:7fb6877b5d7c 52 #else
miruga27 0:7fb6877b5d7c 53
miruga27 0:7fb6877b5d7c 54 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
miruga27 0:7fb6877b5d7c 55 #define WIN32_LEAN_AND_MEAN
miruga27 0:7fb6877b5d7c 56 #include <windows.h>
miruga27 0:7fb6877b5d7c 57 #endif
miruga27 0:7fb6877b5d7c 58
miruga27 0:7fb6877b5d7c 59 /* This is the structure for custom window manager events */
miruga27 0:7fb6877b5d7c 60 #if defined(SDL_VIDEO_DRIVER_X11)
miruga27 0:7fb6877b5d7c 61 #if defined(__APPLE__) && defined(__MACH__)
miruga27 0:7fb6877b5d7c 62 /* conflicts with Quickdraw.h */
miruga27 0:7fb6877b5d7c 63 #define Cursor X11Cursor
miruga27 0:7fb6877b5d7c 64 #endif
miruga27 0:7fb6877b5d7c 65
miruga27 0:7fb6877b5d7c 66 #include <X11/Xlib.h>
miruga27 0:7fb6877b5d7c 67 #include <X11/Xatom.h>
miruga27 0:7fb6877b5d7c 68
miruga27 0:7fb6877b5d7c 69 #if defined(__APPLE__) && defined(__MACH__)
miruga27 0:7fb6877b5d7c 70 /* matches the re-define above */
miruga27 0:7fb6877b5d7c 71 #undef Cursor
miruga27 0:7fb6877b5d7c 72 #endif
miruga27 0:7fb6877b5d7c 73
miruga27 0:7fb6877b5d7c 74 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
miruga27 0:7fb6877b5d7c 75
miruga27 0:7fb6877b5d7c 76 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
miruga27 0:7fb6877b5d7c 77 #include <directfb.h>
miruga27 0:7fb6877b5d7c 78 #endif
miruga27 0:7fb6877b5d7c 79
miruga27 0:7fb6877b5d7c 80 #if defined(SDL_VIDEO_DRIVER_COCOA)
miruga27 0:7fb6877b5d7c 81 #ifdef __OBJC__
miruga27 0:7fb6877b5d7c 82 #include <Cocoa/Cocoa.h>
miruga27 0:7fb6877b5d7c 83 #else
miruga27 0:7fb6877b5d7c 84 typedef struct _NSWindow NSWindow;
miruga27 0:7fb6877b5d7c 85 #endif
miruga27 0:7fb6877b5d7c 86 #endif
miruga27 0:7fb6877b5d7c 87
miruga27 0:7fb6877b5d7c 88 #if defined(SDL_VIDEO_DRIVER_UIKIT)
miruga27 0:7fb6877b5d7c 89 #ifdef __OBJC__
miruga27 0:7fb6877b5d7c 90 #include <UIKit/UIKit.h>
miruga27 0:7fb6877b5d7c 91 #else
miruga27 0:7fb6877b5d7c 92 typedef struct _UIWindow UIWindow;
miruga27 0:7fb6877b5d7c 93 #endif
miruga27 0:7fb6877b5d7c 94 #endif
miruga27 0:7fb6877b5d7c 95
miruga27 0:7fb6877b5d7c 96 #if defined(SDL_VIDEO_DRIVER_MIR)
miruga27 0:7fb6877b5d7c 97 #include <mir_toolkit/mir_client_library.h>
miruga27 0:7fb6877b5d7c 98 #endif
miruga27 0:7fb6877b5d7c 99
miruga27 0:7fb6877b5d7c 100
miruga27 0:7fb6877b5d7c 101 /**
miruga27 0:7fb6877b5d7c 102 * These are the various supported windowing subsystems
miruga27 0:7fb6877b5d7c 103 */
miruga27 0:7fb6877b5d7c 104 typedef enum
miruga27 0:7fb6877b5d7c 105 {
miruga27 0:7fb6877b5d7c 106 SDL_SYSWM_UNKNOWN,
miruga27 0:7fb6877b5d7c 107 SDL_SYSWM_WINDOWS,
miruga27 0:7fb6877b5d7c 108 SDL_SYSWM_X11,
miruga27 0:7fb6877b5d7c 109 SDL_SYSWM_DIRECTFB,
miruga27 0:7fb6877b5d7c 110 SDL_SYSWM_COCOA,
miruga27 0:7fb6877b5d7c 111 SDL_SYSWM_UIKIT,
miruga27 0:7fb6877b5d7c 112 SDL_SYSWM_WAYLAND,
miruga27 0:7fb6877b5d7c 113 SDL_SYSWM_MIR,
miruga27 0:7fb6877b5d7c 114 } SDL_SYSWM_TYPE;
miruga27 0:7fb6877b5d7c 115
miruga27 0:7fb6877b5d7c 116 /**
miruga27 0:7fb6877b5d7c 117 * The custom event structure.
miruga27 0:7fb6877b5d7c 118 */
miruga27 0:7fb6877b5d7c 119 struct SDL_SysWMmsg
miruga27 0:7fb6877b5d7c 120 {
miruga27 0:7fb6877b5d7c 121 SDL_version version;
miruga27 0:7fb6877b5d7c 122 SDL_SYSWM_TYPE subsystem;
miruga27 0:7fb6877b5d7c 123 union
miruga27 0:7fb6877b5d7c 124 {
miruga27 0:7fb6877b5d7c 125 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
miruga27 0:7fb6877b5d7c 126 struct {
miruga27 0:7fb6877b5d7c 127 HWND hwnd; /**< The window for the message */
miruga27 0:7fb6877b5d7c 128 UINT msg; /**< The type of message */
miruga27 0:7fb6877b5d7c 129 WPARAM wParam; /**< WORD message parameter */
miruga27 0:7fb6877b5d7c 130 LPARAM lParam; /**< LONG message parameter */
miruga27 0:7fb6877b5d7c 131 } win;
miruga27 0:7fb6877b5d7c 132 #endif
miruga27 0:7fb6877b5d7c 133 #if defined(SDL_VIDEO_DRIVER_X11)
miruga27 0:7fb6877b5d7c 134 struct {
miruga27 0:7fb6877b5d7c 135 XEvent event;
miruga27 0:7fb6877b5d7c 136 } x11;
miruga27 0:7fb6877b5d7c 137 #endif
miruga27 0:7fb6877b5d7c 138 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
miruga27 0:7fb6877b5d7c 139 struct {
miruga27 0:7fb6877b5d7c 140 DFBEvent event;
miruga27 0:7fb6877b5d7c 141 } dfb;
miruga27 0:7fb6877b5d7c 142 #endif
miruga27 0:7fb6877b5d7c 143 #if defined(SDL_VIDEO_DRIVER_COCOA)
miruga27 0:7fb6877b5d7c 144 struct
miruga27 0:7fb6877b5d7c 145 {
miruga27 0:7fb6877b5d7c 146 /* No Cocoa window events yet */
miruga27 0:7fb6877b5d7c 147 } cocoa;
miruga27 0:7fb6877b5d7c 148 #endif
miruga27 0:7fb6877b5d7c 149 #if defined(SDL_VIDEO_DRIVER_UIKIT)
miruga27 0:7fb6877b5d7c 150 struct
miruga27 0:7fb6877b5d7c 151 {
miruga27 0:7fb6877b5d7c 152 /* No UIKit window events yet */
miruga27 0:7fb6877b5d7c 153 } uikit;
miruga27 0:7fb6877b5d7c 154 #endif
miruga27 0:7fb6877b5d7c 155 /* Can't have an empty union */
miruga27 0:7fb6877b5d7c 156 int dummy;
miruga27 0:7fb6877b5d7c 157 } msg;
miruga27 0:7fb6877b5d7c 158 };
miruga27 0:7fb6877b5d7c 159
miruga27 0:7fb6877b5d7c 160 /**
miruga27 0:7fb6877b5d7c 161 * The custom window manager information structure.
miruga27 0:7fb6877b5d7c 162 *
miruga27 0:7fb6877b5d7c 163 * When this structure is returned, it holds information about which
miruga27 0:7fb6877b5d7c 164 * low level system it is using, and will be one of SDL_SYSWM_TYPE.
miruga27 0:7fb6877b5d7c 165 */
miruga27 0:7fb6877b5d7c 166 struct SDL_SysWMinfo
miruga27 0:7fb6877b5d7c 167 {
miruga27 0:7fb6877b5d7c 168 SDL_version version;
miruga27 0:7fb6877b5d7c 169 SDL_SYSWM_TYPE subsystem;
miruga27 0:7fb6877b5d7c 170 union
miruga27 0:7fb6877b5d7c 171 {
miruga27 0:7fb6877b5d7c 172 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
miruga27 0:7fb6877b5d7c 173 struct
miruga27 0:7fb6877b5d7c 174 {
miruga27 0:7fb6877b5d7c 175 HWND window; /**< The window handle */
miruga27 0:7fb6877b5d7c 176 } win;
miruga27 0:7fb6877b5d7c 177 #endif
miruga27 0:7fb6877b5d7c 178 #if defined(SDL_VIDEO_DRIVER_X11)
miruga27 0:7fb6877b5d7c 179 struct
miruga27 0:7fb6877b5d7c 180 {
miruga27 0:7fb6877b5d7c 181 Display *display; /**< The X11 display */
miruga27 0:7fb6877b5d7c 182 Window window; /**< The X11 window */
miruga27 0:7fb6877b5d7c 183 } x11;
miruga27 0:7fb6877b5d7c 184 #endif
miruga27 0:7fb6877b5d7c 185 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
miruga27 0:7fb6877b5d7c 186 struct
miruga27 0:7fb6877b5d7c 187 {
miruga27 0:7fb6877b5d7c 188 IDirectFB *dfb; /**< The directfb main interface */
miruga27 0:7fb6877b5d7c 189 IDirectFBWindow *window; /**< The directfb window handle */
miruga27 0:7fb6877b5d7c 190 IDirectFBSurface *surface; /**< The directfb client surface */
miruga27 0:7fb6877b5d7c 191 } dfb;
miruga27 0:7fb6877b5d7c 192 #endif
miruga27 0:7fb6877b5d7c 193 #if defined(SDL_VIDEO_DRIVER_COCOA)
miruga27 0:7fb6877b5d7c 194 struct
miruga27 0:7fb6877b5d7c 195 {
miruga27 0:7fb6877b5d7c 196 NSWindow *window; /* The Cocoa window */
miruga27 0:7fb6877b5d7c 197 } cocoa;
miruga27 0:7fb6877b5d7c 198 #endif
miruga27 0:7fb6877b5d7c 199 #if defined(SDL_VIDEO_DRIVER_UIKIT)
miruga27 0:7fb6877b5d7c 200 struct
miruga27 0:7fb6877b5d7c 201 {
miruga27 0:7fb6877b5d7c 202 UIWindow *window; /* The UIKit window */
miruga27 0:7fb6877b5d7c 203 } uikit;
miruga27 0:7fb6877b5d7c 204 #endif
miruga27 0:7fb6877b5d7c 205 #if defined(SDL_VIDEO_DRIVER_WAYLAND)
miruga27 0:7fb6877b5d7c 206 struct
miruga27 0:7fb6877b5d7c 207 {
miruga27 0:7fb6877b5d7c 208 struct wl_display *display; /**< Wayland display */
miruga27 0:7fb6877b5d7c 209 struct wl_surface *surface; /**< Wayland surface */
miruga27 0:7fb6877b5d7c 210 struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
miruga27 0:7fb6877b5d7c 211 } wl;
miruga27 0:7fb6877b5d7c 212 #endif
miruga27 0:7fb6877b5d7c 213 #if defined(SDL_VIDEO_DRIVER_MIR)
miruga27 0:7fb6877b5d7c 214 struct
miruga27 0:7fb6877b5d7c 215 {
miruga27 0:7fb6877b5d7c 216 MirConnection *connection; /**< Mir display server connection */
miruga27 0:7fb6877b5d7c 217 MirSurface *surface; /**< Mir surface */
miruga27 0:7fb6877b5d7c 218 } mir;
miruga27 0:7fb6877b5d7c 219 #endif
miruga27 0:7fb6877b5d7c 220
miruga27 0:7fb6877b5d7c 221 /* Can't have an empty union */
miruga27 0:7fb6877b5d7c 222 int dummy;
miruga27 0:7fb6877b5d7c 223 } info;
miruga27 0:7fb6877b5d7c 224 };
miruga27 0:7fb6877b5d7c 225
miruga27 0:7fb6877b5d7c 226 #endif /* SDL_PROTOTYPES_ONLY */
miruga27 0:7fb6877b5d7c 227
miruga27 0:7fb6877b5d7c 228 typedef struct SDL_SysWMinfo SDL_SysWMinfo;
miruga27 0:7fb6877b5d7c 229
miruga27 0:7fb6877b5d7c 230 /* Function prototypes */
miruga27 0:7fb6877b5d7c 231 /**
miruga27 0:7fb6877b5d7c 232 * \brief This function allows access to driver-dependent window information.
miruga27 0:7fb6877b5d7c 233 *
miruga27 0:7fb6877b5d7c 234 * \param window The window about which information is being requested
miruga27 0:7fb6877b5d7c 235 * \param info This structure must be initialized with the SDL version, and is
miruga27 0:7fb6877b5d7c 236 * then filled in with information about the given window.
miruga27 0:7fb6877b5d7c 237 *
miruga27 0:7fb6877b5d7c 238 * \return SDL_TRUE if the function is implemented and the version member of
miruga27 0:7fb6877b5d7c 239 * the \c info struct is valid, SDL_FALSE otherwise.
miruga27 0:7fb6877b5d7c 240 *
miruga27 0:7fb6877b5d7c 241 * You typically use this function like this:
miruga27 0:7fb6877b5d7c 242 * \code
miruga27 0:7fb6877b5d7c 243 * SDL_SysWMinfo info;
miruga27 0:7fb6877b5d7c 244 * SDL_VERSION(&info.version);
miruga27 0:7fb6877b5d7c 245 * if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
miruga27 0:7fb6877b5d7c 246 * \endcode
miruga27 0:7fb6877b5d7c 247 */
miruga27 0:7fb6877b5d7c 248 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
miruga27 0:7fb6877b5d7c 249 SDL_SysWMinfo * info);
miruga27 0:7fb6877b5d7c 250
miruga27 0:7fb6877b5d7c 251
miruga27 0:7fb6877b5d7c 252 /* Ends C function definitions when using C++ */
miruga27 0:7fb6877b5d7c 253 #ifdef __cplusplus
miruga27 0:7fb6877b5d7c 254 }
miruga27 0:7fb6877b5d7c 255 #endif
miruga27 0:7fb6877b5d7c 256 #include "close_code.h"
miruga27 0:7fb6877b5d7c 257
miruga27 0:7fb6877b5d7c 258 #endif /* _SDL_syswm_h */
miruga27 0:7fb6877b5d7c 259
miruga27 0:7fb6877b5d7c 260 /* vi: set ts=4 sw=4 expandtab: */