DEADSOFTWARE

migrating from PanelIDs to panel GUIDs; part two
[d2df-sdl.git] / src / lib / sdl2 / sdlsyswm.inc
1 // from sdl_syswm.h
3 {$IFDEF WINDOWS}
4 {$DEFINE SDL_VIDEO_DRIVER_WINDOWS}
5 {$ENDIF}
7 {$IF DEFINED (LINUX) OR DEFINED(UNIX)}
8 {$DEFINE SDL_VIDEO_DRIVER_X11}
9 {$IFEND}
11 {$IFDEF DARWIN}
12 {$DEFINE SDL_VIDEO_DRIVER_COCOA}
13 {$ENDIF}
15 {**
16 * These are the various supported windowing subsystems
17 *}
18 Type
19 TSDL_SYSWM_TYPE = (
20 SDL_SYSWM_UNKNOWN,
21 SDL_SYSWM_WINDOWS,
22 SDL_SYSWM_X11,
23 SDL_SYSWM_DIRECTFB,
24 SDL_SYSWM_COCOA,
25 SDL_SYSWM_UIKIT,
26 SDL_SYSWM_WAYLAND, // Since SDL 2.0.2
27 SDL_SYSWM_MIR, // Since SDL 2.0.2
28 SDL_SYSWM_WINRT, // Since SDL 2.0.3
29 SDL_SYSWM_ANDROID // Planned for SDL 2.0.4
30 );
32 /// sdl_syswm.h uses anonymous structs, declared right in SDL_SysWMmsg.
33 /// Since Pascal does not allow this, we workaround by introducing named types
34 /// before the proper TSDL_SysWMmsg definition.
35 {$IFDEF SDL_VIDEO_DRIVER_WINDOWS}
36 __SYSWM_WINDOWS = record
37 hwnd: HWND; {**< The window for the message }
38 msg: uInt; {**< The type of message *}
39 wParam: WPARAM; {**< WORD message parameter *}
40 lParam: LPARAM; {**< WORD message parameter *}
41 end;
42 {$ENDIF}
43 {$IFDEF SDL_VIDEO_DRIVER_X11}
44 __SYSWM_X11 = record
45 event: {$IFDEF FPC} TXEvent {$ELSE} XEvent {$ENDIF};
46 end;
47 {$ENDIF}
48 {$IFDEF SDL_VIDEO_DRIVER_DIRECTFB}
49 __SYSWM_DIRECTFB = record
50 event: DFBEvent;
51 end;
52 {$ENDIF}
53 {$IFDEF SDL_VIDEO_DRIVER_COCOA}
54 __SYSWM_COCOA = record
55 (* No Cocoa window events yet *)
56 end;
57 {$ENDIF}
58 {$IFDEF SDL_VIDEO_DRIVER_UIKIT}
59 __SYSWM_UIKIT = record
60 (* No UIKit window events yet *)
61 end;
62 {$ENDIF}
64 {**
65 * The custom event structure.
66 *}
67 PSDL_SysWMmsg = ^TSDL_SysWMmsg;
68 TSDL_SysWMmsg = record
69 version: TSDL_version;
70 Case subsystem: TSDL_SYSWM_TYPE of
71 (* Cannot have empty record case *)
72 SDL_SYSWM_UNKNOWN: (dummy: sInt32);
73 {$IFDEF SDL_VIDEO_DRIVER_WINDOWS}
74 SDL_SYSWM_WINDOWS: (win: __SYSWM_WINDOWS);
75 {$ENDIF}
76 {$IFDEF SDL_VIDEO_DRIVER_X11}
77 SDL_SYSWM_X11: (x11: __SYSWM_X11);
78 {$ENDIF}
79 {$IFDEF SDL_VIDEO_DRIVER_DIRECTFB}
80 SDL_SYSWM_DIRECTFB: (dfb: __SYSWM_DIRECTFB);
81 {$ENDIF}
82 {$IFDEF SDL_VIDEO_DRIVER_COCOA}
83 SDL_SYSWM_COCOA: (cocoa: __SYSWM_COCOA);
84 {$ENDIF}
85 {$IFDEF SDL_VIDEO_DRIVER_UIKIT}
86 SDL_SYSWM_UIKIT: (uikit: __SYSWM_UIKIT);
87 {$ENDIF}
88 end;
90 /// Once again, sdl_syswm.h uses anonymous structs, declared right in SDL_SysWMinfo.
91 /// We workaround by introducing named types before the proper TSDL_SysWMinfo definition.
92 {$IFDEF SDL_VIDEO_DRIVER_WINDOWS}
93 __WMINFO_WINDOWS = record
94 window: HWND; {**< The window handle *}
95 end;
96 {$ENDIF}
97 {$IFDEF SDL_VIDEO_DRIVER_WINRT} // Since SDL 2.0.3
98 __WMINFO_WINRT = record
99 window: IInspectable; {**< The WinRT CoreWindow *}
100 end;
101 {$ENDIF}
102 {$IFDEF SDL_VIDEO_DRIVER_X11}
103 __WMINFO_X11 = record
104 display: PDisplay; {**< The X11 display *}
105 window: TWindow; {**< The X11 window *}
106 end;
107 {$ENDIF}
108 {$IFDEF SDL_VIDEO_DRIVER_DIRECTFB}
109 __WMINFO_DFB = record
110 dfb: IDirectFB; {**< The directfb main interface *}
111 window: IDirectFBWindow; {**< The directfb window handle *}
112 surface: IDirectFBSurface; {**< The directfb client surface *}
113 end;
114 {$ENDIF}
115 {$IFDEF SDL_VIDEO_DRIVER_COCOA}
116 __WMINFO_COCOA = record
117 window: NSWindow; {* The Cocoa window *}
118 end;
119 {$ENDIF}
120 {$IFDEF SDL_VIDEO_DRIVER_UIKIT}
121 __WMINFO_UIKIT = record
122 window: UIWindow; {* The UIKit window *}
123 end;
124 {$ENDIF}
125 {$IFDEF SDL_VIDEO_DRIVER_WAYLAND} // Since SDL 2.0.2
126 __WMINFO_WAYLAND = record
127 display: wl_display; {**< Wayland display *}
128 surface: wl_surface; {**< Wayland surface *}
129 shell_surface: wl_shell_surface; {**< Wayland shell_surface (window manager handle) *}
130 end;
131 {$ENDIF}
132 {$IFDEF SDL_VIDEO_DRIVER_MIR} // Since SDL 2.0.2
133 __WMINFO_MIR = record
134 connection: PMirConnection; {**< Mir display server connection *}
135 surface: PMirSurface; {**< Mir surface *}
136 end;
137 {$ENDIF}
138 {$IFDEF SDL_VIDEO_DRIVER_ANDROID} // Planned for SDL 2.0.4
139 __WMINFO_ANDROID = record
140 window : PANativeWindow;
141 surface: PEGLSurface;
142 end;
143 {$ENDIF}
145 {**
146 * The custom window manager information structure.
148 * When this structure is returned, it holds information about which
149 * low level system it is using, and will be one of SDL_SYSWM_TYPE.
150 *}
151 PSDL_SysWMinfo = ^TSDL_SysWMinfo;
152 TSDL_SysWMinfo = record
153 version: TSDL_version;
154 Case subsystem: TSDL_SYSWM_TYPE of
155 (* Cannot have empty record case *)
156 SDL_SYSWM_UNKNOWN: (dummy: sInt32);
157 {$IFDEF SDL_VIDEO_DRIVER_WINDOWS}
158 SDL_SYSWM_WINDOWS: (win : __WMINFO_WINDOWS);
159 {$ENDIF}
160 {$IFDEF SDL_VIDEO_DRIVER_WINRT}
161 SDL_SYSWM_WINRT: (winrt : __WMINFO_WINRT);
162 {$ENDIF}
163 {$IFDEF SDL_VIDEO_DRIVER_X11}
164 SDL_SYSWM_X11: (x11 : __WMINFO_X11);
165 {$ENDIF}
166 {$IFDEF SDL_VIDEO_DRIVER_DIRECTFB}
167 SDL_SYSWM_DIRECTFB: (dfb : __WMINFO_DFB);
168 {$ENDIF}
169 {$IFDEF SDL_VIDEO_DRIVER_COCOA}
170 SDL_SYSWM_COCOA: (cocoa : __WMINFO_COCOA);
171 {$ENDIF}
172 {$IFDEF SDL_VIDEO_DRIVER_UIKIT}
173 SDL_SYSWM_UIKIT: (uikit : __WMINFO_UIKIT);
174 {$ENDIF}
175 {$IFDEF SDL_VIDEO_DRIVER_WAYLAND}
176 SDL_SYSWM_WAYLAND: (wl : __WMINFO_WAYLAND);
177 {$ENDIF}
178 {$IFDEF SDL_VIDEO_DRIVER_MIR}
179 SDL_SYSWM_MIR: (mir : __WMINFO_MIR);
180 {$ENDIF}
181 end;
183 {* Function prototypes *}
184 (**
185 * \brief This function allows access to driver-dependent window information.
187 * \param window The window about which information is being requested
188 * \param info This structure must be initialized with the SDL version, and is
189 * then filled in with information about the given window.
191 * \return SDL_TRUE if the function is implemented and the version member of
192 * the \c info struct is valid, SDL_FALSE otherwise.
194 * You typically use this function like this:
195 * \code
196 * SDL_SysWMinfo info;
197 * SDL_VERSION(&info.version);
198 * if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
199 * \endcode
200 *)
201 Function SDL_GetWindowWMInfo(window:PSDL_Window; info : PSDL_SysWMinfo):TSDL_bool; cdecl;
202 external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowWMInfo' {$ENDIF} {$ENDIF};