DEADSOFTWARE

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