Skip to content

Latest commit

 

History

History
232 lines (194 loc) · 6.33 KB

SDL_syswm.h

File metadata and controls

232 lines (194 loc) · 6.33 KB
 
Apr 26, 2001
Apr 26, 2001
1
2
/*
SDL - Simple DirectMedia Layer
Dec 31, 2011
Dec 31, 2011
3
Copyright (C) 1997-2012 Sam Lantinga
Apr 26, 2001
Apr 26, 2001
4
5
This library is free software; you can redistribute it and/or
Feb 1, 2006
Feb 1, 2006
6
modify it under the terms of the GNU Lesser General Public
Apr 26, 2001
Apr 26, 2001
7
License as published by the Free Software Foundation; either
Feb 1, 2006
Feb 1, 2006
8
version 2.1 of the License, or (at your option) any later version.
Apr 26, 2001
Apr 26, 2001
9
10
11
12
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Feb 1, 2006
Feb 1, 2006
13
Lesser General Public License for more details.
Apr 26, 2001
Apr 26, 2001
14
Feb 1, 2006
Feb 1, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Apr 26, 2001
Apr 26, 2001
18
19
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Apr 26, 2001
Apr 26, 2001
21
22
*/
Sep 21, 2009
Sep 21, 2009
23
24
25
/** @file SDL_syswm.h
* Include file for SDL custom system window manager hooks
*/
Apr 26, 2001
Apr 26, 2001
26
27
28
29
#ifndef _SDL_syswm_h
#define _SDL_syswm_h
Feb 10, 2006
Feb 10, 2006
30
#include "SDL_stdinc.h"
Feb 10, 2006
Feb 10, 2006
31
#include "SDL_error.h"
Apr 26, 2001
Apr 26, 2001
32
33
#include "SDL_version.h"
May 10, 2018
May 10, 2018
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef SDL_PROTOTYPES_ONLY
# if defined(SDL_VIDEO_DRIVER_X11)
# if defined(__APPLE__) && defined(__MACH__)
# define Cursor X11Cursor /* conflicts with Quickdraw.h */
# endif
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# if defined(__APPLE__) && defined(__MACH__)
# undef Cursor
# endif
# elif defined(SDL_VIDEO_DRIVER_NANOX)
# include <microwin/nano-X.h>
# elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# elif defined(SDL_VIDEO_DRIVER_PHOTON)
# include <sys/neutrino.h>
# include <Ph.h>
# endif
#endif
Apr 26, 2001
Apr 26, 2001
57
58
59
60
61
62
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
Sep 21, 2009
Sep 21, 2009
63
64
65
66
67
68
/** @file SDL_syswm.h
* Your application has access to a special type of event 'SDL_SYSWMEVENT',
* which contains window-manager specific information and arrives whenever
* an unhandled window event occurs. This event is ignored by default, but
* you can enable it with SDL_EventState()
*/
Apr 26, 2001
Apr 26, 2001
69
70
struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
May 10, 2018
May 10, 2018
71
72
#ifndef SDL_PROTOTYPES_ONLY
Apr 26, 2001
Apr 26, 2001
73
Feb 16, 2006
Feb 16, 2006
74
/* This is the structure for custom window manager events */
Apr 13, 2006
Apr 13, 2006
75
#if defined(SDL_VIDEO_DRIVER_X11)
Sep 8, 2005
Sep 8, 2005
76
Sep 21, 2009
Sep 21, 2009
77
/** These are the various supported subsystems under UNIX */
Apr 26, 2001
Apr 26, 2001
78
79
80
81
typedef enum {
SDL_SYSWM_X11
} SDL_SYSWM_TYPE;
Sep 21, 2009
Sep 21, 2009
82
/** The UNIX custom event structure */
Apr 26, 2001
Apr 26, 2001
83
84
85
86
87
88
89
90
struct SDL_SysWMmsg {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
XEvent xevent;
} event;
};
Sep 21, 2009
Sep 21, 2009
91
92
93
/** The UNIX custom window manager information structure.
* When this structure is returned, it holds information about which
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
Apr 26, 2001
Apr 26, 2001
94
*/
May 10, 2018
May 10, 2018
95
struct SDL_SysWMinfo {
Apr 26, 2001
Apr 26, 2001
96
97
98
99
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
struct {
Sep 21, 2009
Sep 21, 2009
100
101
102
103
104
105
106
Display *display; /**< The X11 display */
Window window; /**< The X11 display window */
/** These locking functions should be called around
* any X11 functions using the display variable,
* but not the gfxdisplay variable.
* They lock the event thread, so should not be
* called around event functions or from event filters.
Apr 26, 2001
Apr 26, 2001
107
*/
Sep 21, 2009
Sep 21, 2009
108
/*@{*/
Apr 26, 2001
Apr 26, 2001
109
110
void (*lock_func)(void);
void (*unlock_func)(void);
Sep 21, 2009
Sep 21, 2009
111
112
113
114
115
116
117
118
119
120
121
122
/*@}*/
/** @name Introduced in SDL 1.0.2 */
/*@{*/
Window fswindow; /**< The X11 fullscreen window */
Window wmwindow; /**< The X11 managed input window */
/*@}*/
/** @name Introduced in SDL 1.2.12 */
/*@{*/
Display *gfxdisplay; /**< The X11 display to which rendering is done */
/*@}*/
Apr 26, 2001
Apr 26, 2001
123
124
} x11;
} info;
May 10, 2018
May 10, 2018
125
};
Apr 26, 2001
Apr 26, 2001
126
Apr 13, 2006
Apr 13, 2006
127
#elif defined(SDL_VIDEO_DRIVER_NANOX)
May 11, 2001
May 11, 2001
128
Sep 21, 2009
Sep 21, 2009
129
/** The generic custom event structure */
May 11, 2001
May 11, 2001
130
131
132
133
134
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
Sep 21, 2009
Sep 21, 2009
135
/** The windows custom window manager information structure */
May 10, 2018
May 10, 2018
136
struct SDL_SysWMinfo {
May 11, 2001
May 11, 2001
137
138
SDL_version version ;
GR_WINDOW_ID window ; /* The display window */
May 10, 2018
May 10, 2018
139
};
May 11, 2001
May 11, 2001
140
May 3, 2006
May 3, 2006
141
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
Apr 26, 2001
Apr 26, 2001
142
Sep 21, 2009
Sep 21, 2009
143
/** The windows custom event structure */
Apr 26, 2001
Apr 26, 2001
144
145
struct SDL_SysWMmsg {
SDL_version version;
Sep 21, 2009
Sep 21, 2009
146
147
148
149
HWND hwnd; /**< The window for the message */
UINT msg; /**< The type of message */
WPARAM wParam; /**< WORD message parameter */
LPARAM lParam; /**< LONG message parameter */
Apr 26, 2001
Apr 26, 2001
150
151
};
Sep 21, 2009
Sep 21, 2009
152
/** The windows custom window manager information structure */
May 10, 2018
May 10, 2018
153
struct SDL_SysWMinfo {
Apr 26, 2001
Apr 26, 2001
154
SDL_version version;
Sep 21, 2009
Sep 21, 2009
155
156
HWND window; /**< The Win32 display window */
HGLRC hglrc; /**< The OpenGL context, if any */
May 10, 2018
May 10, 2018
157
};
Apr 26, 2001
Apr 26, 2001
158
Apr 13, 2006
Apr 13, 2006
159
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
May 29, 2003
May 29, 2003
160
Sep 21, 2009
Sep 21, 2009
161
/** RISC OS custom event structure */
May 29, 2003
May 29, 2003
162
163
struct SDL_SysWMmsg {
SDL_version version;
Sep 21, 2009
Sep 21, 2009
164
int eventCode; /**< The window for the message */
May 29, 2003
May 29, 2003
165
166
167
int pollBlock[64];
};
Sep 21, 2009
Sep 21, 2009
168
/** The RISC OS custom window manager information structure */
May 10, 2018
May 10, 2018
169
struct SDL_SysWMinfo {
May 29, 2003
May 29, 2003
170
SDL_version version;
Sep 21, 2009
Sep 21, 2009
171
172
173
int wimpVersion; /**< Wimp version running under */
int taskHandle; /**< The RISC OS task handle */
int window; /**< The RISC OS display window */
May 10, 2018
May 10, 2018
174
};
May 29, 2003
May 29, 2003
175
Apr 13, 2006
Apr 13, 2006
176
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
Mar 4, 2004
Mar 4, 2004
177
Sep 21, 2009
Sep 21, 2009
178
/** The QNX custom event structure */
Mar 4, 2004
Mar 4, 2004
179
180
181
182
183
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
Sep 21, 2009
Sep 21, 2009
184
/** The QNX custom window manager information structure */
May 10, 2018
May 10, 2018
185
struct SDL_SysWMinfo {
Mar 4, 2004
Mar 4, 2004
186
187
SDL_version version;
int data;
May 10, 2018
May 10, 2018
188
};
Mar 4, 2004
Mar 4, 2004
189
Apr 26, 2001
Apr 26, 2001
190
191
#else
Sep 21, 2009
Sep 21, 2009
192
/** The generic custom event structure */
Apr 26, 2001
Apr 26, 2001
193
194
195
196
197
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
Sep 21, 2009
Sep 21, 2009
198
/** The generic custom window manager information structure */
May 10, 2018
May 10, 2018
199
struct SDL_SysWMinfo {
Apr 26, 2001
Apr 26, 2001
200
201
SDL_version version;
int data;
May 10, 2018
May 10, 2018
202
};
Apr 26, 2001
Apr 26, 2001
203
Feb 16, 2006
Feb 16, 2006
204
#endif /* video driver type */
Apr 26, 2001
Apr 26, 2001
205
206
207
208
#endif /* SDL_PROTOTYPES_ONLY */
/* Function prototypes */
Sep 21, 2009
Sep 21, 2009
209
/**
Apr 26, 2001
Apr 26, 2001
210
211
* This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and
Jul 18, 2010
Jul 18, 2010
212
213
214
* returns 0 if the function is not implemented, 1 if the function is
* implemented and no error occurred, and -1 if the version member of
* the 'info' structure is not filled in or not supported.
Nov 30, 2004
Nov 30, 2004
215
216
*
* You typically use this function like this:
Sep 21, 2009
Sep 21, 2009
217
* @code
Jul 20, 2011
Jul 20, 2011
218
* SDL_SysWMinfo info;
Nov 30, 2004
Nov 30, 2004
219
220
* SDL_VERSION(&info.version);
* if ( SDL_GetWMInfo(&info) ) { ... }
Sep 21, 2009
Sep 21, 2009
221
* @endcode
Apr 26, 2001
Apr 26, 2001
222
*/
Apr 11, 2002
Apr 11, 2002
223
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
Apr 26, 2001
Apr 26, 2001
224
225
226
227
228
229
230
231
232
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_syswm_h */