World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
SDL_syswm.h
См. документацию.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 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)
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! */
138 
143 {
146  union
147  {
148 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
149  struct {
150  HWND hwnd;
151  UINT msg;
152  WPARAM wParam;
153  LPARAM lParam;
154  } win;
155 #endif
156 #if defined(SDL_VIDEO_DRIVER_X11)
157  struct {
158  XEvent event;
159  } x11;
160 #endif
161 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
162  struct {
163  DFBEvent event;
164  } dfb;
165 #endif
166 #if defined(SDL_VIDEO_DRIVER_COCOA)
167  struct
168  {
169  /* Latest version of Xcode clang complains about empty structs in C v. C++:
170  error: empty struct has size 0 in C, size 1 in C++
171  */
172  int dummy;
173  /* No Cocoa window events yet */
174  } cocoa;
175 #endif
176 #if defined(SDL_VIDEO_DRIVER_UIKIT)
177  struct
178  {
179  int dummy;
180  /* No UIKit window events yet */
181  } uikit;
182 #endif
183 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
184  struct
185  {
186  int dummy;
187  /* No Vivante window events yet */
188  } vivante;
189 #endif
190  /* Can't have an empty union */
191  int dummy;
192  } msg;
193 };
194 
202 {
205  union
206  {
207 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
208  struct
209  {
210  HWND window;
211  HDC hdc;
212  HINSTANCE hinstance;
213  } win;
214 #endif
215 #if defined(SDL_VIDEO_DRIVER_WINRT)
216  struct
217  {
218  IInspectable * window;
219  } winrt;
220 #endif
221 #if defined(SDL_VIDEO_DRIVER_X11)
222  struct
223  {
224  Display *display;
225  Window window;
226  } x11;
227 #endif
228 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
229  struct
230  {
231  IDirectFB *dfb;
232  IDirectFBWindow *window;
233  IDirectFBSurface *surface;
234  } dfb;
235 #endif
236 #if defined(SDL_VIDEO_DRIVER_COCOA)
237  struct
238  {
239 #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
240  NSWindow __unsafe_unretained *window;
241 #else
243 #endif
244  } cocoa;
245 #endif
246 #if defined(SDL_VIDEO_DRIVER_UIKIT)
247  struct
248  {
249 #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
250  UIWindow __unsafe_unretained *window;
251 #else
253 #endif
257  } uikit;
258 #endif
259 #if defined(SDL_VIDEO_DRIVER_WAYLAND)
260  struct
261  {
262  struct wl_display *display;
263  struct wl_surface *surface;
264  struct wl_shell_surface *shell_surface;
265  } wl;
266 #endif
267 #if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
268  struct
269  {
270  void *connection;
271  void *surface;
272  } mir;
273 #endif
274 
275 #if defined(SDL_VIDEO_DRIVER_ANDROID)
276  struct
277  {
280  } android;
281 #endif
282 
283 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
284  struct
285  {
288  } vivante;
289 #endif
290 
291  /* Make sure this union is always 64 bytes (8 64-bit pointers). */
292  /* Be careful not to overflow this if you add a new target! */
294  } info;
295 };
296 
297 #endif /* SDL_PROTOTYPES_ONLY */
298 
300 
301 /* Function prototypes */
319 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
320  SDL_SysWMinfo * info);
321 
322 
323 /* Ends C function definitions when using C++ */
324 #ifdef __cplusplus
325 }
326 #endif
327 #include "close_code.h"
328 
329 #endif /* SDL_syswm_h_ */
330 
331 /* vi: set ts=4 sw=4 expandtab: */
SDL_SYSWM_UNKNOWN
@ SDL_SYSWM_UNKNOWN
Definition: SDL_syswm.h:124
SDL_SysWMmsg
Definition: SDL_syswm.h:142
SDL_SysWMmsg::win
struct SDL_SysWMmsg::@100::@101 win
SDL_SysWMinfo::vivante
struct SDL_SysWMinfo::@107::@117 vivante
SDL_SysWMinfo::win
struct SDL_SysWMinfo::@107::@108 win
UIViewController
struct _UIViewController UIViewController
Definition: SDL_syswm.h:96
SDL_SysWMmsg::subsystem
SDL_SYSWM_TYPE subsystem
Definition: SDL_syswm.h:145
SDL_SysWMinfo::display
Display * display
Definition: SDL_syswm.h:224
SDL_SYSWM_WINRT
@ SDL_SYSWM_WINRT
Definition: SDL_syswm.h:132
SDL_SYSWM_HAIKU
@ SDL_SYSWM_HAIKU
Definition: SDL_syswm.h:136
NSWindow
struct _NSWindow NSWindow
Definition: SDL_syswm.h:87
SDL_SysWMmsg::wParam
WPARAM wParam
Definition: SDL_syswm.h:152
SDL_SysWMinfo::resolveFramebuffer
GLuint resolveFramebuffer
Definition: SDL_syswm.h:256
SDL_SysWMinfo::dfb
IDirectFB * dfb
Definition: SDL_syswm.h:231
SDL_version
Information the version of SDL in use.
Definition: SDL_version.h:51
SDL_SysWMinfo::window
UIWindow * window
Definition: SDL_syswm.h:252
SDL_SYSWM_DIRECTFB
@ SDL_SYSWM_DIRECTFB
Definition: SDL_syswm.h:127
SDL_SysWMinfo::winrt
struct SDL_SysWMinfo::@107::@109 winrt
SDL_SysWMinfo::mir
struct SDL_SysWMinfo::@107::@115 mir
SDL_error.h
SDL_SysWMinfo
Definition: SDL_syswm.h:201
SDL_SysWMmsg::version
SDL_version version
Definition: SDL_syswm.h:144
SDL_SysWMinfo::window
UIWindow __unsafe_unretained * window
Definition: SDL_syswm.h:250
SDL_SysWMinfo::window
NSWindow * window
Definition: SDL_syswm.h:242
SDL_SYSWM_TYPE
SDL_SYSWM_TYPE
Definition: SDL_syswm.h:122
SDL_SysWMinfo::window
Window window
Definition: SDL_syswm.h:225
SDL_SysWMinfo::window
IDirectFBWindow * window
Definition: SDL_syswm.h:232
SDL_SYSWM_ANDROID
@ SDL_SYSWM_ANDROID
Definition: SDL_syswm.h:133
SDL_SYSWM_WAYLAND
@ SDL_SYSWM_WAYLAND
Definition: SDL_syswm.h:130
SDL_SysWMmsg::uikit
struct SDL_SysWMmsg::@100::@105 uikit
SDL_SysWMinfo::surface
EGLSurface surface
Definition: SDL_syswm.h:279
close_code.h
begin_code.h
SDL_SysWMinfo::connection
void * connection
Definition: SDL_syswm.h:270
SDL_SysWMinfo::cocoa
struct SDL_SysWMinfo::@107::@112 cocoa
SDL_SysWMinfo::window
IInspectable * window
Definition: SDL_syswm.h:218
EGLNativeWindowType
IUnknown * EGLNativeWindowType
Definition: SDL_egl.h:400
SDL_SysWMinfo::info
union SDL_SysWMinfo::@107 info
SDL_SysWMinfo::window
HWND window
Definition: SDL_syswm.h:210
SDL_SysWMmsg::lParam
LPARAM lParam
Definition: SDL_syswm.h:153
SDL_SYSWM_COCOA
@ SDL_SYSWM_COCOA
Definition: SDL_syswm.h:128
SDL_SysWMinfo::subsystem
SDL_SYSWM_TYPE subsystem
Definition: SDL_syswm.h:204
SDL_SysWMinfo::window
EGLNativeWindowType window
Definition: SDL_syswm.h:287
ANativeWindow
struct ANativeWindow ANativeWindow
Definition: SDL_syswm.h:102
SDL_SysWMinfo::window
ANativeWindow * window
Definition: SDL_syswm.h:278
SDL_SYSWM_X11
@ SDL_SYSWM_X11
Definition: SDL_syswm.h:126
SDL_SysWMinfo::surface
void * surface
Definition: SDL_syswm.h:271
EGLSurface
void * EGLSurface
Definition: SDL_syswm.h:103
SDL_SysWMmsg::hwnd
HWND hwnd
Definition: SDL_syswm.h:150
GLuint
Uint32 GLuint
Definition: SDL_syswm.h:98
SDL_SysWMmsg::x11
struct SDL_SysWMmsg::@100::@102 x11
SDL_SysWMinfo::x11
struct SDL_SysWMinfo::@107::@110 x11
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
SDL_SysWMmsg::msg
UINT msg
Definition: SDL_syswm.h:151
SDL_SysWMinfo::display
EGLNativeDisplayType display
Definition: SDL_syswm.h:286
SDL_SYSWM_UIKIT
@ SDL_SYSWM_UIKIT
Definition: SDL_syswm.h:129
SDL_SysWMinfo::colorbuffer
GLuint colorbuffer
Definition: SDL_syswm.h:255
SDL_SysWMmsg::event
XEvent event
Definition: SDL_syswm.h:158
SDL_SysWMmsg::dfb
struct SDL_SysWMmsg::@100::@103 dfb
SDL_SysWMmsg::vivante
struct SDL_SysWMmsg::@100::@106 vivante
SDL_SysWMinfo::window
NSWindow __unsafe_unretained * window
Definition: SDL_syswm.h:240
UIWindow
struct _UIWindow UIWindow
Definition: SDL_syswm.h:95
EGLSurface
void * EGLSurface
Definition: SDL_egl.h:540
SDL_SysWMinfo::hinstance
HINSTANCE hinstance
Definition: SDL_syswm.h:212
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_SysWMinfo::shell_surface
struct wl_shell_surface * shell_surface
Definition: SDL_syswm.h:264
SDL_SysWMinfo::version
SDL_version version
Definition: SDL_syswm.h:203
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_Window
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
SDL_SysWMmsg::cocoa
struct SDL_SysWMmsg::@100::@104 cocoa
SDL_stdinc.h
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_video.h
SDL_SysWMinfo::uikit
struct SDL_SysWMinfo::@107::@113 uikit
GLuint
unsigned int GLuint
Definition: SDL_opengl.h:185
SDL_version.h
EGLNativeDisplayType
IUnknown * EGLNativeDisplayType
Definition: SDL_egl.h:402
SDL_SysWMinfo::android
struct SDL_SysWMinfo::@107::@116 android
SDL_SYSWM_MIR
@ SDL_SYSWM_MIR
Definition: SDL_syswm.h:131
SDL_SysWMinfo::framebuffer
GLuint framebuffer
Definition: SDL_syswm.h:254
SDL_SysWMinfo::surface
IDirectFBSurface * surface
Definition: SDL_syswm.h:233
SDL_SysWMmsg::event
DFBEvent event
Definition: SDL_syswm.h:163
SDL_SYSWM_VIVANTE
@ SDL_SYSWM_VIVANTE
Definition: SDL_syswm.h:134
SDL_SysWMinfo::display
struct wl_display * display
Definition: SDL_syswm.h:262
SDL_SysWMmsg::dummy
int dummy
Definition: SDL_syswm.h:172
SDL_SysWMinfo::wl
struct SDL_SysWMinfo::@107::@114 wl
SDL_egl.h
SDL_SysWMinfo::hdc
HDC hdc
Definition: SDL_syswm.h:211
SDL_SysWMinfo::surface
struct wl_surface * surface
Definition: SDL_syswm.h:263
SDL_GetWindowWMInfo
DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window *window, SDL_SysWMinfo *info)
This function allows access to driver-dependent window information.
SDL_SysWMinfo::dummy
Uint8 dummy[64]
Definition: SDL_syswm.h:293
SDL_SYSWM_OS2
@ SDL_SYSWM_OS2
Definition: SDL_syswm.h:135
SDL_SYSWM_WINDOWS
@ SDL_SYSWM_WINDOWS
Definition: SDL_syswm.h:125