arsa  2.7
SDL_syswm.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
4 
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.
8 
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:
12 
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.
20 */
21 
28 #ifndef SDL_syswm_h_
29 #define SDL_syswm_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34 #include "SDL_version.h"
35 
44 struct SDL_SysWMinfo;
45 
46 #if !defined(SDL_PROTOTYPES_ONLY)
47 
48 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
49 #ifndef WIN32_LEAN_AND_MEAN
50 #define WIN32_LEAN_AND_MEAN
51 #endif
52 #ifndef NOMINMAX /* don't define min() and max(). */
53 #define NOMINMAX
54 #endif
55 #include <windows.h>
56 #endif
57 
58 #if defined(SDL_VIDEO_DRIVER_WINRT)
59 #include <Inspectable.h>
60 #endif
61 
62 /* This is the structure for custom window manager events */
63 #if defined(SDL_VIDEO_DRIVER_X11)
64 #if defined(__APPLE__) && defined(__MACH__)
65 /* conflicts with Quickdraw.h */
66 #define Cursor X11Cursor
67 #endif
68 
69 #include <X11/Xlib.h>
70 #include <X11/Xatom.h>
71 
72 #if defined(__APPLE__) && defined(__MACH__)
73 /* matches the re-define above */
74 #undef Cursor
75 #endif
76 
77 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
78 
79 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
80 #include <directfb.h>
81 #endif
82 
83 #if defined(SDL_VIDEO_DRIVER_COCOA)
84 #ifdef __OBJC__
85 @class NSWindow;
86 #else
87 typedef struct _NSWindow NSWindow;
88 #endif
89 #endif
90 
91 #if defined(SDL_VIDEO_DRIVER_UIKIT)
92 #ifdef __OBJC__
93 #include <UIKit/UIKit.h>
94 #else
95 typedef struct _UIWindow UIWindow;
96 typedef struct _UIViewController UIViewController;
97 #endif
98 typedef Uint32 GLuint;
99 #endif
100 
101 #if defined(SDL_VIDEO_DRIVER_ANDROID)
102 typedef struct ANativeWindow ANativeWindow;
103 typedef void *EGLSurface;
104 #endif
105 
106 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
107 #include "SDL_egl.h"
108 #endif
109 #endif /* SDL_PROTOTYPES_ONLY */
110 
111 
112 #include "begin_code.h"
113 /* Set up for C function definitions, even when using C++ */
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
118 #if !defined(SDL_PROTOTYPES_ONLY)
119 
122 typedef enum
123 {
131  SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
137 
142 {
145  union
146  {
147 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
148  struct {
149  HWND hwnd;
150  UINT msg;
151  WPARAM wParam;
152  LPARAM lParam;
153  } win;
154 #endif
155 #if defined(SDL_VIDEO_DRIVER_X11)
156  struct {
157  XEvent event;
158  } x11;
159 #endif
160 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
161  struct {
162  DFBEvent event;
163  } dfb;
164 #endif
165 #if defined(SDL_VIDEO_DRIVER_COCOA)
166  struct
167  {
168  /* Latest version of Xcode clang complains about empty structs in C v. C++:
169  error: empty struct has size 0 in C, size 1 in C++
170  */
171  int dummy;
172  /* No Cocoa window events yet */
173  } cocoa;
174 #endif
175 #if defined(SDL_VIDEO_DRIVER_UIKIT)
176  struct
177  {
178  int dummy;
179  /* No UIKit window events yet */
180  } uikit;
181 #endif
182 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
183  struct
184  {
185  int dummy;
186  /* No Vivante window events yet */
187  } vivante;
188 #endif
189  /* Can't have an empty union */
190  int dummy;
191  } msg;
192 };
193 
201 {
204  union
205  {
206 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
207  struct
208  {
209  HWND window;
210  HDC hdc;
211  HINSTANCE hinstance;
212  } win;
213 #endif
214 #if defined(SDL_VIDEO_DRIVER_WINRT)
215  struct
216  {
217  IInspectable * window;
218  } winrt;
219 #endif
220 #if defined(SDL_VIDEO_DRIVER_X11)
221  struct
222  {
223  Display *display;
224  Window window;
225  } x11;
226 #endif
227 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
228  struct
229  {
230  IDirectFB *dfb;
231  IDirectFBWindow *window;
232  IDirectFBSurface *surface;
233  } dfb;
234 #endif
235 #if defined(SDL_VIDEO_DRIVER_COCOA)
236  struct
237  {
238 #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
239  NSWindow __unsafe_unretained *window;
240 #else
241  NSWindow *window;
242 #endif
243  } cocoa;
244 #endif
245 #if defined(SDL_VIDEO_DRIVER_UIKIT)
246  struct
247  {
248 #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
249  UIWindow __unsafe_unretained *window;
250 #else
251  UIWindow *window;
252 #endif
254  GLuint colorbuffer;
255  GLuint resolveFramebuffer;
256  } uikit;
257 #endif
258 #if defined(SDL_VIDEO_DRIVER_WAYLAND)
259  struct
260  {
261  struct wl_display *display;
262  struct wl_surface *surface;
263  struct wl_shell_surface *shell_surface;
264  } wl;
265 #endif
266 #if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
267  struct
268  {
269  void *connection;
270  void *surface;
271  } mir;
272 #endif
273 
274 #if defined(SDL_VIDEO_DRIVER_ANDROID)
275  struct
276  {
277  ANativeWindow *window;
278  EGLSurface surface;
279  } android;
280 #endif
281 
282 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
283  struct
284  {
285  EGLNativeDisplayType display;
286  EGLNativeWindowType window;
287  } vivante;
288 #endif
289 
290  /* Make sure this union is always 64 bytes (8 64-bit pointers). */
291  /* Be careful not to overflow this if you add a new target! */
293  } info;
294 };
295 
296 #endif /* SDL_PROTOTYPES_ONLY */
297 
299 
300 /* Function prototypes */
319  SDL_SysWMinfo * info);
320 
321 
322 /* Ends C function definitions when using C++ */
323 #ifdef __cplusplus
324 }
325 #endif
326 #include "close_code.h"
327 
328 #endif /* SDL_syswm_h_ */
329 
330 /* vi: set ts=4 sw=4 expandtab: */
SDL_version version
Definition: SDL_syswm.h:143
DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window *window, SDL_SysWMinfo *info)
This function allows access to driver-dependent window information.
SDL_bool
Definition: SDL_stdinc.h:161
SDL_SYSWM_TYPE
Definition: SDL_syswm.h:122
SDL_version version
Definition: SDL_syswm.h:202
#define DECLSPEC
Definition: begin_code.h:74
SDL_SYSWM_TYPE subsystem
Definition: SDL_syswm.h:203
uint32_t Uint32
Definition: SDL_stdinc.h:203
#define SDLCALL
Definition: begin_code.h:89
Information the version of SDL in use.
Definition: SDL_version.h:51
Uint8 dummy[64]
Definition: SDL_syswm.h:292
struct _cl_event * event
#define UINT
Definition: cdx.h:159
union SDL_SysWMinfo::@21 info
SDL_SYSWM_TYPE subsystem
Definition: SDL_syswm.h:144
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
GLuint framebuffer
unsigned int GLuint
Definition: SDL_opengl.h:185
union SDL_SysWMmsg::@20 msg
uint8_t Uint8
Definition: SDL_stdinc.h:179