display_server_windows.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /*************************************************************************/
  2. /* display_server_windows.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef DISPLAY_SERVER_WINDOWS_H
  31. #define DISPLAY_SERVER_WINDOWS_H
  32. #include "servers/display_server.h"
  33. #include "core/config/project_settings.h"
  34. #include "core/input/input.h"
  35. #include "core/os/os.h"
  36. #include "crash_handler_windows.h"
  37. #include "drivers/unix/ip_unix.h"
  38. #include "drivers/wasapi/audio_driver_wasapi.h"
  39. #include "drivers/winmidi/midi_driver_winmidi.h"
  40. #include "joypad_windows.h"
  41. #include "key_mapping_windows.h"
  42. #include "servers/audio_server.h"
  43. #include "servers/rendering/renderer_compositor.h"
  44. #include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
  45. #include "servers/rendering_server.h"
  46. #ifdef XAUDIO2_ENABLED
  47. #include "drivers/xaudio2/audio_driver_xaudio2.h"
  48. #endif
  49. #if defined(OPENGL_ENABLED)
  50. #include "context_gl_windows.h"
  51. #endif
  52. #if defined(VULKAN_ENABLED)
  53. #include "drivers/vulkan/rendering_device_vulkan.h"
  54. #include "platform/windows/vulkan_context_win.h"
  55. #endif
  56. #include <fcntl.h>
  57. #include <io.h>
  58. #include <stdio.h>
  59. #include <windows.h>
  60. #include <windowsx.h>
  61. // WinTab API
  62. #define WT_PACKET 0x7FF0
  63. #define WT_PROXIMITY 0x7FF5
  64. #define WT_INFOCHANGE 0x7FF6
  65. #define WT_CSRCHANGE 0x7FF7
  66. #define WTI_DEFSYSCTX 4
  67. #define WTI_DEVICES 100
  68. #define DVC_NPRESSURE 15
  69. #define DVC_TPRESSURE 16
  70. #define DVC_ORIENTATION 17
  71. #define DVC_ROTATION 18
  72. #define CXO_MESSAGES 0x0004
  73. #define PK_NORMAL_PRESSURE 0x0400
  74. #define PK_TANGENT_PRESSURE 0x0800
  75. #define PK_ORIENTATION 0x1000
  76. typedef struct tagLOGCONTEXTW {
  77. WCHAR lcName[40];
  78. UINT lcOptions;
  79. UINT lcStatus;
  80. UINT lcLocks;
  81. UINT lcMsgBase;
  82. UINT lcDevice;
  83. UINT lcPktRate;
  84. DWORD lcPktData;
  85. DWORD lcPktMode;
  86. DWORD lcMoveMask;
  87. DWORD lcBtnDnMask;
  88. DWORD lcBtnUpMask;
  89. LONG lcInOrgX;
  90. LONG lcInOrgY;
  91. LONG lcInOrgZ;
  92. LONG lcInExtX;
  93. LONG lcInExtY;
  94. LONG lcInExtZ;
  95. LONG lcOutOrgX;
  96. LONG lcOutOrgY;
  97. LONG lcOutOrgZ;
  98. LONG lcOutExtX;
  99. LONG lcOutExtY;
  100. LONG lcOutExtZ;
  101. DWORD lcSensX;
  102. DWORD lcSensY;
  103. DWORD lcSensZ;
  104. BOOL lcSysMode;
  105. int lcSysOrgX;
  106. int lcSysOrgY;
  107. int lcSysExtX;
  108. int lcSysExtY;
  109. DWORD lcSysSensX;
  110. DWORD lcSysSensY;
  111. } LOGCONTEXTW;
  112. typedef struct tagAXIS {
  113. LONG axMin;
  114. LONG axMax;
  115. UINT axUnits;
  116. DWORD axResolution;
  117. } AXIS;
  118. typedef struct tagORIENTATION {
  119. int orAzimuth;
  120. int orAltitude;
  121. int orTwist;
  122. } ORIENTATION;
  123. typedef struct tagPACKET {
  124. int pkNormalPressure;
  125. int pkTangentPressure;
  126. ORIENTATION pkOrientation;
  127. } PACKET;
  128. typedef HANDLE(WINAPI *WTOpenPtr)(HWND p_window, LOGCONTEXTW *p_ctx, BOOL p_enable);
  129. typedef BOOL(WINAPI *WTClosePtr)(HANDLE p_ctx);
  130. typedef UINT(WINAPI *WTInfoPtr)(UINT p_category, UINT p_index, LPVOID p_output);
  131. typedef BOOL(WINAPI *WTPacketPtr)(HANDLE p_ctx, UINT p_param, LPVOID p_packets);
  132. typedef BOOL(WINAPI *WTEnablePtr)(HANDLE p_ctx, BOOL p_enable);
  133. // Windows Ink API
  134. #ifndef POINTER_STRUCTURES
  135. #define POINTER_STRUCTURES
  136. typedef DWORD POINTER_INPUT_TYPE;
  137. typedef UINT32 POINTER_FLAGS;
  138. typedef UINT32 PEN_FLAGS;
  139. typedef UINT32 PEN_MASK;
  140. #ifndef PEN_MASK_PRESSURE
  141. #define PEN_MASK_PRESSURE 0x00000001
  142. #endif
  143. #ifndef PEN_MASK_TILT_X
  144. #define PEN_MASK_TILT_X 0x00000004
  145. #endif
  146. #ifndef PEN_MASK_TILT_Y
  147. #define PEN_MASK_TILT_Y 0x00000008
  148. #endif
  149. #ifndef POINTER_MESSAGE_FLAG_FIRSTBUTTON
  150. #define POINTER_MESSAGE_FLAG_FIRSTBUTTON 0x00000010
  151. #endif
  152. enum tagPOINTER_INPUT_TYPE {
  153. PT_POINTER = 0x00000001,
  154. PT_TOUCH = 0x00000002,
  155. PT_PEN = 0x00000003,
  156. PT_MOUSE = 0x00000004,
  157. PT_TOUCHPAD = 0x00000005
  158. };
  159. typedef enum tagPOINTER_BUTTON_CHANGE_TYPE {
  160. POINTER_CHANGE_NONE,
  161. POINTER_CHANGE_FIRSTBUTTON_DOWN,
  162. POINTER_CHANGE_FIRSTBUTTON_UP,
  163. POINTER_CHANGE_SECONDBUTTON_DOWN,
  164. POINTER_CHANGE_SECONDBUTTON_UP,
  165. POINTER_CHANGE_THIRDBUTTON_DOWN,
  166. POINTER_CHANGE_THIRDBUTTON_UP,
  167. POINTER_CHANGE_FOURTHBUTTON_DOWN,
  168. POINTER_CHANGE_FOURTHBUTTON_UP,
  169. POINTER_CHANGE_FIFTHBUTTON_DOWN,
  170. POINTER_CHANGE_FIFTHBUTTON_UP,
  171. } POINTER_BUTTON_CHANGE_TYPE;
  172. typedef struct tagPOINTER_INFO {
  173. POINTER_INPUT_TYPE pointerType;
  174. UINT32 pointerId;
  175. UINT32 frameId;
  176. POINTER_FLAGS pointerFlags;
  177. HANDLE sourceDevice;
  178. HWND hwndTarget;
  179. POINT ptPixelLocation;
  180. POINT ptHimetricLocation;
  181. POINT ptPixelLocationRaw;
  182. POINT ptHimetricLocationRaw;
  183. DWORD dwTime;
  184. UINT32 historyCount;
  185. INT32 InputData;
  186. DWORD dwKeyStates;
  187. UINT64 PerformanceCount;
  188. POINTER_BUTTON_CHANGE_TYPE ButtonChangeType;
  189. } POINTER_INFO;
  190. typedef struct tagPOINTER_PEN_INFO {
  191. POINTER_INFO pointerInfo;
  192. PEN_FLAGS penFlags;
  193. PEN_MASK penMask;
  194. UINT32 pressure;
  195. UINT32 rotation;
  196. INT32 tiltX;
  197. INT32 tiltY;
  198. } POINTER_PEN_INFO;
  199. #endif //POINTER_STRUCTURES
  200. #ifndef WM_POINTERUPDATE
  201. #define WM_POINTERUPDATE 0x0245
  202. #endif
  203. #ifndef WM_POINTERENTER
  204. #define WM_POINTERENTER 0x0249
  205. #endif
  206. #ifndef WM_POINTERLEAVE
  207. #define WM_POINTERLEAVE 0x024A
  208. #endif
  209. typedef BOOL(WINAPI *GetPointerTypePtr)(uint32_t p_id, POINTER_INPUT_TYPE *p_type);
  210. typedef BOOL(WINAPI *GetPointerPenInfoPtr)(uint32_t p_id, POINTER_PEN_INFO *p_pen_info);
  211. typedef struct {
  212. BYTE bWidth; // Width, in pixels, of the image
  213. BYTE bHeight; // Height, in pixels, of the image
  214. BYTE bColorCount; // Number of colors in image (0 if >=8bpp)
  215. BYTE bReserved; // Reserved ( must be 0)
  216. WORD wPlanes; // Color Planes
  217. WORD wBitCount; // Bits per pixel
  218. DWORD dwBytesInRes; // How many bytes in this resource?
  219. DWORD dwImageOffset; // Where in the file is this image?
  220. } ICONDIRENTRY, *LPICONDIRENTRY;
  221. typedef struct {
  222. WORD idReserved; // Reserved (must be 0)
  223. WORD idType; // Resource Type (1 for icons)
  224. WORD idCount; // How many images?
  225. ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em)
  226. } ICONDIR, *LPICONDIR;
  227. class DisplayServerWindows : public DisplayServer {
  228. //No need to register, it's platform-specific and nothing is added
  229. //GDCLASS(DisplayServerWindows, DisplayServer)
  230. _THREAD_SAFE_CLASS_
  231. // WinTab API
  232. static bool wintab_available;
  233. static WTOpenPtr wintab_WTOpen;
  234. static WTClosePtr wintab_WTClose;
  235. static WTInfoPtr wintab_WTInfo;
  236. static WTPacketPtr wintab_WTPacket;
  237. static WTEnablePtr wintab_WTEnable;
  238. // Windows Ink API
  239. static bool winink_available;
  240. static GetPointerTypePtr win8p_GetPointerType;
  241. static GetPointerPenInfoPtr win8p_GetPointerPenInfo;
  242. void _update_tablet_ctx(const String &p_old_driver, const String &p_new_driver);
  243. String tablet_driver;
  244. Vector<String> tablet_drivers;
  245. void GetMaskBitmaps(HBITMAP hSourceBitmap, COLORREF clrTransparent, OUT HBITMAP &hAndMaskBitmap, OUT HBITMAP &hXorMaskBitmap);
  246. enum {
  247. KEY_EVENT_BUFFER_SIZE = 512
  248. };
  249. struct KeyEvent {
  250. WindowID window_id;
  251. bool alt, shift, control, meta;
  252. UINT uMsg;
  253. WPARAM wParam;
  254. LPARAM lParam;
  255. };
  256. KeyEvent key_event_buffer[KEY_EVENT_BUFFER_SIZE];
  257. int key_event_pos;
  258. bool old_invalid;
  259. bool outside;
  260. int old_x, old_y;
  261. Point2i center;
  262. #if defined(OPENGL_ENABLED)
  263. ContextGL_Windows *context_gles2;
  264. #endif
  265. #if defined(VULKAN_ENABLED)
  266. VulkanContextWindows *context_vulkan;
  267. RenderingDeviceVulkan *rendering_device_vulkan;
  268. #endif
  269. Map<int, Vector2> touch_state;
  270. int pressrc;
  271. HINSTANCE hInstance; // Holds The Instance Of The Application
  272. String rendering_driver;
  273. bool app_focused = false;
  274. struct WindowData {
  275. HWND hWnd;
  276. //layered window
  277. Vector<Vector2> mpath;
  278. bool preserve_window_size = false;
  279. bool pre_fs_valid = false;
  280. RECT pre_fs_rect;
  281. bool maximized = false;
  282. bool minimized = false;
  283. bool fullscreen = false;
  284. bool borderless = false;
  285. bool resizable = true;
  286. bool window_focused = false;
  287. bool was_maximized = false;
  288. bool always_on_top = false;
  289. bool no_focus = false;
  290. bool window_has_focus = false;
  291. // Used to transfer data between events using timer.
  292. WPARAM saved_wparam;
  293. LPARAM saved_lparam;
  294. // Timers.
  295. uint32_t move_timer_id = 0U;
  296. uint32_t focus_timer_id = 0U;
  297. HANDLE wtctx;
  298. LOGCONTEXTW wtlc;
  299. int min_pressure;
  300. int max_pressure;
  301. bool tilt_supported;
  302. bool block_mm = false;
  303. int last_pressure_update;
  304. float last_pressure;
  305. Vector2 last_tilt;
  306. HBITMAP hBitmap; //DIB section for layered window
  307. uint8_t *dib_data = nullptr;
  308. Size2 dib_size;
  309. HDC hDC_dib;
  310. Size2 min_size;
  311. Size2 max_size;
  312. int width = 0, height = 0;
  313. Size2 window_rect;
  314. Point2 last_pos;
  315. ObjectID instance_id;
  316. // IME
  317. HIMC im_himc;
  318. Vector2 im_position;
  319. bool layered_window = false;
  320. Callable rect_changed_callback;
  321. Callable event_callback;
  322. Callable input_event_callback;
  323. Callable input_text_callback;
  324. Callable drop_files_callback;
  325. WindowID transient_parent = INVALID_WINDOW_ID;
  326. Set<WindowID> transient_children;
  327. };
  328. JoypadWindows *joypad;
  329. WindowID _create_window(WindowMode p_mode, uint32_t p_flags, const Rect2i &p_rect);
  330. WindowID window_id_counter = MAIN_WINDOW_ID;
  331. Map<WindowID, WindowData> windows;
  332. WindowID last_focused_window = INVALID_WINDOW_ID;
  333. HCURSOR hCursor;
  334. WNDPROC user_proc = nullptr;
  335. void _send_window_event(const WindowData &wd, WindowEvent p_event);
  336. void _get_window_style(bool p_main_window, bool p_fullscreen, bool p_borderless, bool p_resizable, bool p_maximized, bool p_no_activate_focus, DWORD &r_style, DWORD &r_style_ex);
  337. MouseMode mouse_mode;
  338. bool alt_mem = false;
  339. bool gr_mem = false;
  340. bool shift_mem = false;
  341. bool control_mem = false;
  342. bool meta_mem = false;
  343. uint32_t last_button_state = 0;
  344. bool use_raw_input = false;
  345. bool drop_events = false;
  346. bool in_dispatch_input_event = false;
  347. bool console_visible = false;
  348. WNDCLASSEXW wc;
  349. HCURSOR cursors[CURSOR_MAX] = { nullptr };
  350. CursorShape cursor_shape = CursorShape::CURSOR_ARROW;
  351. Map<CursorShape, Vector<Variant>> cursors_cache;
  352. void _drag_event(WindowID p_window, float p_x, float p_y, int idx);
  353. void _touch_event(WindowID p_window, bool p_pressed, float p_x, float p_y, int idx);
  354. void _update_window_style(WindowID p_window, bool p_repaint = true);
  355. void _update_window_mouse_passthrough(WindowID p_window);
  356. void _update_real_mouse_position(WindowID p_window);
  357. void _set_mouse_mode_impl(MouseMode p_mode);
  358. void _process_activate_event(WindowID p_window_id, WPARAM wParam, LPARAM lParam);
  359. void _process_key_events();
  360. static void _dispatch_input_events(const Ref<InputEvent> &p_event);
  361. void _dispatch_input_event(const Ref<InputEvent> &p_event);
  362. public:
  363. LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  364. virtual bool has_feature(Feature p_feature) const;
  365. virtual String get_name() const;
  366. virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
  367. virtual void mouse_set_mode(MouseMode p_mode);
  368. virtual MouseMode mouse_get_mode() const;
  369. virtual void mouse_warp_to_position(const Point2i &p_to);
  370. virtual Point2i mouse_get_position() const;
  371. virtual int mouse_get_button_state() const;
  372. virtual void clipboard_set(const String &p_text);
  373. virtual String clipboard_get() const;
  374. virtual int get_screen_count() const;
  375. virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
  376. virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
  377. virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
  378. virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
  379. virtual bool screen_is_touchscreen(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
  380. virtual void screen_set_orientation(ScreenOrientation p_orientation, int p_screen = SCREEN_OF_MAIN_WINDOW);
  381. ScreenOrientation screen_get_orientation(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
  382. virtual void screen_set_keep_on(bool p_enable); //disable screensaver
  383. virtual bool screen_is_kept_on() const;
  384. virtual Vector<DisplayServer::WindowID> get_window_list() const;
  385. virtual WindowID create_sub_window(WindowMode p_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i());
  386. virtual void show_window(WindowID p_window);
  387. virtual void delete_sub_window(WindowID p_window);
  388. virtual WindowID get_window_at_screen_position(const Point2i &p_position) const;
  389. virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID);
  390. virtual ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const;
  391. virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID);
  392. virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID);
  393. virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID);
  394. virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID);
  395. virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID);
  396. virtual void window_set_title(const String &p_title, WindowID p_window = MAIN_WINDOW_ID);
  397. virtual void window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window = MAIN_WINDOW_ID);
  398. virtual int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const;
  399. virtual void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID);
  400. virtual Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const;
  401. virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID);
  402. virtual void window_set_transient(WindowID p_window, WindowID p_parent);
  403. virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID);
  404. virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const;
  405. virtual void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID);
  406. virtual Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const;
  407. virtual void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID);
  408. virtual Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const;
  409. virtual Size2i window_get_real_size(WindowID p_window = MAIN_WINDOW_ID) const; //wtf is this? should probable use proper name
  410. virtual void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID);
  411. virtual WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const;
  412. virtual bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const;
  413. virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID);
  414. virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const;
  415. virtual void window_request_attention(WindowID p_window = MAIN_WINDOW_ID);
  416. virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID);
  417. virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const;
  418. virtual bool can_any_window_draw() const;
  419. virtual void window_set_ime_active(const bool p_active, WindowID p_window = MAIN_WINDOW_ID);
  420. virtual void window_set_ime_position(const Point2i &p_pos, WindowID p_window = MAIN_WINDOW_ID);
  421. virtual void console_set_visible(bool p_enabled);
  422. virtual bool is_console_visible() const;
  423. virtual void cursor_set_shape(CursorShape p_shape);
  424. virtual CursorShape cursor_get_shape() const;
  425. virtual void cursor_set_custom_image(const RES &p_cursor, CursorShape p_shape = CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
  426. virtual bool get_swap_cancel_ok();
  427. virtual void enable_for_stealing_focus(OS::ProcessID pid);
  428. virtual int keyboard_get_layout_count() const;
  429. virtual int keyboard_get_current_layout() const;
  430. virtual void keyboard_set_current_layout(int p_index);
  431. virtual String keyboard_get_layout_language(int p_index) const;
  432. virtual String keyboard_get_layout_name(int p_index) const;
  433. virtual int tablet_get_driver_count() const;
  434. virtual String tablet_get_driver_name(int p_driver) const;
  435. virtual String tablet_get_current_driver() const;
  436. virtual void tablet_set_current_driver(const String &p_driver);
  437. virtual void process_events();
  438. virtual void force_process_and_drop_events();
  439. virtual void release_rendering_thread();
  440. virtual void make_rendering_thread();
  441. virtual void swap_buffers();
  442. virtual void set_native_icon(const String &p_filename);
  443. virtual void set_icon(const Ref<Image> &p_icon);
  444. virtual void vsync_set_use_via_compositor(bool p_enable);
  445. virtual bool vsync_is_using_via_compositor() const;
  446. virtual void set_context(Context p_context);
  447. static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, uint32_t p_flags, const Vector2i &p_resolution, Error &r_error);
  448. static Vector<String> get_rendering_drivers_func();
  449. static void register_windows_driver();
  450. DisplayServerWindows(const String &p_rendering_driver, WindowMode p_mode, uint32_t p_flags, const Vector2i &p_resolution, Error &r_error);
  451. ~DisplayServerWindows();
  452. };
  453. #endif // DISPLAY_SERVER_WINDOWS_H