os_windows.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /**************************************************************************/
  2. /* os_windows.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  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 OS_WINDOWS_H
  31. #define OS_WINDOWS_H
  32. #include "context_gl_windows.h"
  33. #include "core/os/input.h"
  34. #include "core/os/os.h"
  35. #include "core/project_settings.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 "key_mapping_windows.h"
  41. #include "main/input_default.h"
  42. #include "power_windows.h"
  43. #include "servers/audio_server.h"
  44. #include "servers/visual/rasterizer.h"
  45. #include "servers/visual_server.h"
  46. #ifdef XAUDIO2_ENABLED
  47. #include "drivers/xaudio2/audio_driver_xaudio2.h"
  48. #endif
  49. #include "tts_windows.h"
  50. #include <dwmapi.h>
  51. #include <fcntl.h>
  52. #include <io.h>
  53. #include <shellapi.h>
  54. #include <stdio.h>
  55. #define WIN32_LEAN_AND_MEAN
  56. #include <windows.h>
  57. #include <windowsx.h>
  58. // WinTab API
  59. #define WT_PACKET 0x7FF0
  60. #define WT_PROXIMITY 0x7FF5
  61. #define WT_INFOCHANGE 0x7FF6
  62. #define WT_CSRCHANGE 0x7FF7
  63. #define WTI_DEFSYSCTX 4
  64. #define WTI_DEVICES 100
  65. #define DVC_NPRESSURE 15
  66. #define DVC_TPRESSURE 16
  67. #define DVC_ORIENTATION 17
  68. #define DVC_ROTATION 18
  69. #define CXO_MESSAGES 0x0004
  70. #define PK_STATUS 0x0002
  71. #define PK_NORMAL_PRESSURE 0x0400
  72. #define PK_TANGENT_PRESSURE 0x0800
  73. #define PK_ORIENTATION 0x1000
  74. #define TPS_INVERT 0x0010 /* 1.1 */
  75. typedef struct tagLOGCONTEXTW {
  76. WCHAR lcName[40];
  77. UINT lcOptions;
  78. UINT lcStatus;
  79. UINT lcLocks;
  80. UINT lcMsgBase;
  81. UINT lcDevice;
  82. UINT lcPktRate;
  83. DWORD lcPktData;
  84. DWORD lcPktMode;
  85. DWORD lcMoveMask;
  86. DWORD lcBtnDnMask;
  87. DWORD lcBtnUpMask;
  88. LONG lcInOrgX;
  89. LONG lcInOrgY;
  90. LONG lcInOrgZ;
  91. LONG lcInExtX;
  92. LONG lcInExtY;
  93. LONG lcInExtZ;
  94. LONG lcOutOrgX;
  95. LONG lcOutOrgY;
  96. LONG lcOutOrgZ;
  97. LONG lcOutExtX;
  98. LONG lcOutExtY;
  99. LONG lcOutExtZ;
  100. DWORD lcSensX;
  101. DWORD lcSensY;
  102. DWORD lcSensZ;
  103. BOOL lcSysMode;
  104. int lcSysOrgX;
  105. int lcSysOrgY;
  106. int lcSysExtX;
  107. int lcSysExtY;
  108. DWORD lcSysSensX;
  109. DWORD lcSysSensY;
  110. } LOGCONTEXTW;
  111. typedef struct tagAXIS {
  112. LONG axMin;
  113. LONG axMax;
  114. UINT axUnits;
  115. DWORD axResolution;
  116. } AXIS;
  117. typedef struct tagORIENTATION {
  118. int orAzimuth;
  119. int orAltitude;
  120. int orTwist;
  121. } ORIENTATION;
  122. typedef struct tagPACKET {
  123. int pkStatus;
  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_FLAG_INVERTED
  141. #define PEN_FLAG_INVERTED 0x00000002
  142. #endif
  143. #ifndef PEN_FLAG_ERASER
  144. #define PEN_FLAG_ERASER 0x00000004
  145. #endif
  146. #ifndef PEN_MASK_PRESSURE
  147. #define PEN_MASK_PRESSURE 0x00000001
  148. #endif
  149. #ifndef PEN_MASK_TILT_X
  150. #define PEN_MASK_TILT_X 0x00000004
  151. #endif
  152. #ifndef PEN_MASK_TILT_Y
  153. #define PEN_MASK_TILT_Y 0x00000008
  154. #endif
  155. #ifndef POINTER_MESSAGE_FLAG_FIRSTBUTTON
  156. #define POINTER_MESSAGE_FLAG_FIRSTBUTTON 0x00000010
  157. #endif
  158. enum tagPOINTER_INPUT_TYPE {
  159. PT_POINTER = 0x00000001,
  160. PT_TOUCH = 0x00000002,
  161. PT_PEN = 0x00000003,
  162. PT_MOUSE = 0x00000004,
  163. PT_TOUCHPAD = 0x00000005
  164. };
  165. typedef enum tagPOINTER_BUTTON_CHANGE_TYPE {
  166. POINTER_CHANGE_NONE,
  167. POINTER_CHANGE_FIRSTBUTTON_DOWN,
  168. POINTER_CHANGE_FIRSTBUTTON_UP,
  169. POINTER_CHANGE_SECONDBUTTON_DOWN,
  170. POINTER_CHANGE_SECONDBUTTON_UP,
  171. POINTER_CHANGE_THIRDBUTTON_DOWN,
  172. POINTER_CHANGE_THIRDBUTTON_UP,
  173. POINTER_CHANGE_FOURTHBUTTON_DOWN,
  174. POINTER_CHANGE_FOURTHBUTTON_UP,
  175. POINTER_CHANGE_FIFTHBUTTON_DOWN,
  176. POINTER_CHANGE_FIFTHBUTTON_UP,
  177. } POINTER_BUTTON_CHANGE_TYPE;
  178. typedef struct tagPOINTER_INFO {
  179. POINTER_INPUT_TYPE pointerType;
  180. UINT32 pointerId;
  181. UINT32 frameId;
  182. POINTER_FLAGS pointerFlags;
  183. HANDLE sourceDevice;
  184. HWND hwndTarget;
  185. POINT ptPixelLocation;
  186. POINT ptHimetricLocation;
  187. POINT ptPixelLocationRaw;
  188. POINT ptHimetricLocationRaw;
  189. DWORD dwTime;
  190. UINT32 historyCount;
  191. INT32 InputData;
  192. DWORD dwKeyStates;
  193. UINT64 PerformanceCount;
  194. POINTER_BUTTON_CHANGE_TYPE ButtonChangeType;
  195. } POINTER_INFO;
  196. typedef struct tagPOINTER_PEN_INFO {
  197. POINTER_INFO pointerInfo;
  198. PEN_FLAGS penFlags;
  199. PEN_MASK penMask;
  200. UINT32 pressure;
  201. UINT32 rotation;
  202. INT32 tiltX;
  203. INT32 tiltY;
  204. } POINTER_PEN_INFO;
  205. #endif
  206. #ifndef WM_POINTERUPDATE
  207. #define WM_POINTERUPDATE 0x0245
  208. #endif
  209. #ifndef WM_POINTERENTER
  210. #define WM_POINTERENTER 0x0249
  211. #endif
  212. #ifndef WM_POINTERLEAVE
  213. #define WM_POINTERLEAVE 0x024A
  214. #endif
  215. typedef BOOL(WINAPI *GetPointerTypePtr)(uint32_t p_id, POINTER_INPUT_TYPE *p_type);
  216. typedef BOOL(WINAPI *GetPointerPenInfoPtr)(uint32_t p_id, POINTER_PEN_INFO *p_pen_info);
  217. typedef struct {
  218. BYTE bWidth; // Width, in pixels, of the image
  219. BYTE bHeight; // Height, in pixels, of the image
  220. BYTE bColorCount; // Number of colors in image (0 if >=8bpp)
  221. BYTE bReserved; // Reserved ( must be 0)
  222. WORD wPlanes; // Color Planes
  223. WORD wBitCount; // Bits per pixel
  224. DWORD dwBytesInRes; // How many bytes in this resource?
  225. DWORD dwImageOffset; // Where in the file is this image?
  226. } ICONDIRENTRY, *LPICONDIRENTRY;
  227. typedef struct {
  228. WORD idReserved; // Reserved (must be 0)
  229. WORD idType; // Resource Type (1 for icons)
  230. WORD idCount; // How many images?
  231. ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em)
  232. } ICONDIR, *LPICONDIR;
  233. class JoypadWindows;
  234. class OS_Windows : public OS {
  235. String tablet_driver;
  236. Vector<String> tablet_drivers;
  237. // WinTab API
  238. static bool wintab_available;
  239. static WTOpenPtr wintab_WTOpen;
  240. static WTClosePtr wintab_WTClose;
  241. static WTInfoPtr wintab_WTInfo;
  242. static WTPacketPtr wintab_WTPacket;
  243. static WTEnablePtr wintab_WTEnable;
  244. // Windows Ink API
  245. static bool winink_available;
  246. static GetPointerTypePtr win8p_GetPointerType;
  247. static GetPointerPenInfoPtr win8p_GetPointerPenInfo;
  248. HANDLE wtctx;
  249. LOGCONTEXTW wtlc;
  250. int min_pressure;
  251. int max_pressure;
  252. bool tilt_supported;
  253. bool pen_inverted = false;
  254. bool block_mm = false;
  255. int last_pressure_update;
  256. float last_pressure;
  257. Vector2 last_tilt;
  258. bool last_pen_inverted = false;
  259. enum {
  260. KEY_EVENT_BUFFER_SIZE = 512
  261. };
  262. #ifdef STDOUT_FILE
  263. FILE *stdo;
  264. #endif
  265. struct KeyEvent {
  266. bool alt, shift, control, meta;
  267. UINT uMsg;
  268. WPARAM wParam;
  269. LPARAM lParam;
  270. };
  271. KeyEvent key_event_buffer[KEY_EVENT_BUFFER_SIZE];
  272. int key_event_pos;
  273. uint64_t ticks_start;
  274. uint64_t ticks_per_second;
  275. TTS_Windows *tts = nullptr;
  276. bool old_invalid;
  277. bool outside;
  278. int old_x, old_y;
  279. Point2i center;
  280. #if defined(OPENGL_ENABLED)
  281. ContextGL_Windows *gl_context;
  282. #endif
  283. VisualServer *visual_server;
  284. int pressrc;
  285. HINSTANCE hInstance; // Holds The Instance Of The Application
  286. HWND hWnd;
  287. Vector<Vector2> mpath;
  288. Point2 last_pos;
  289. bool layered_window;
  290. uint32_t move_timer_id;
  291. Ref<Image> icon;
  292. HCURSOR hCursor;
  293. Size2 min_size;
  294. Size2 max_size;
  295. Size2 window_rect;
  296. VideoMode video_mode;
  297. bool preserve_window_size = false;
  298. MainLoop *main_loop;
  299. WNDPROC user_proc;
  300. // IME
  301. HIMC im_himc;
  302. Vector2 im_position;
  303. MouseMode mouse_mode;
  304. int restore_mouse_trails;
  305. bool alt_mem;
  306. bool gr_mem;
  307. bool shift_mem;
  308. bool control_mem;
  309. bool meta_mem;
  310. bool force_quit;
  311. bool window_has_focus;
  312. uint32_t last_button_state;
  313. bool use_raw_input;
  314. bool drop_events;
  315. HCURSOR cursors[CURSOR_MAX] = { NULL };
  316. CursorShape cursor_shape;
  317. Map<CursorShape, Vector<Variant>> cursors_cache;
  318. InputDefault *input;
  319. JoypadWindows *joypad;
  320. Map<int, Vector2> touch_state;
  321. PowerWindows *power_manager;
  322. int video_driver_index;
  323. #ifdef WASAPI_ENABLED
  324. AudioDriverWASAPI driver_wasapi;
  325. #endif
  326. #ifdef XAUDIO2_ENABLED
  327. AudioDriverXAudio2 driver_xaudio2;
  328. #endif
  329. #ifdef WINMIDI_ENABLED
  330. MIDIDriverWinMidi driver_midi;
  331. #endif
  332. CrashHandler crash_handler;
  333. void _drag_event(float p_x, float p_y, int idx);
  334. void _touch_event(bool p_pressed, float p_x, float p_y, int idx);
  335. void _update_window_style(bool p_repaint = true, bool p_maximized = false);
  336. void _update_window_mouse_passthrough();
  337. void _set_mouse_mode_impl(MouseMode p_mode);
  338. // functions used by main to initialize/deinitialize the OS
  339. protected:
  340. virtual int get_current_video_driver() const;
  341. virtual void initialize_core();
  342. virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
  343. virtual bool is_offscreen_gl_available() const;
  344. virtual void set_offscreen_gl_current(bool p_current);
  345. virtual void set_main_loop(MainLoop *p_main_loop);
  346. virtual void delete_main_loop();
  347. virtual void finalize();
  348. virtual void finalize_core();
  349. void process_events();
  350. void process_key_events();
  351. String _quote_command_line_argument(const String &p_text) const;
  352. struct ProcessInfo {
  353. STARTUPINFO si;
  354. PROCESS_INFORMATION pi;
  355. };
  356. Map<ProcessID, ProcessInfo> *process_map;
  357. bool pre_fs_valid;
  358. RECT pre_fs_rect;
  359. bool maximized;
  360. bool minimized;
  361. bool borderless;
  362. bool window_focused;
  363. bool was_maximized;
  364. public:
  365. LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  366. virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
  367. String get_stdin_string();
  368. void set_mouse_mode(MouseMode p_mode);
  369. MouseMode get_mouse_mode() const;
  370. virtual bool tts_is_speaking() const;
  371. virtual bool tts_is_paused() const;
  372. virtual Array tts_get_voices() const;
  373. virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false);
  374. virtual void tts_pause();
  375. virtual void tts_resume();
  376. virtual void tts_stop();
  377. virtual void warp_mouse_position(const Point2 &p_to);
  378. virtual Point2 get_mouse_position() const;
  379. void update_real_mouse_position();
  380. virtual int get_mouse_button_state() const;
  381. virtual void set_window_title(const String &p_title);
  382. virtual void set_window_mouse_passthrough(const PoolVector2Array &p_region);
  383. virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0);
  384. virtual VideoMode get_video_mode(int p_screen = 0) const;
  385. virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const;
  386. virtual int get_tablet_driver_count() const;
  387. virtual String get_tablet_driver_name(int p_driver) const;
  388. virtual String get_current_tablet_driver() const;
  389. virtual void set_current_tablet_driver(const String &p_driver);
  390. virtual int get_screen_count() const;
  391. virtual int get_current_screen() const;
  392. virtual void set_current_screen(int p_screen);
  393. virtual Point2 get_screen_position(int p_screen = -1) const;
  394. virtual Size2 get_screen_size(int p_screen = -1) const;
  395. virtual int get_screen_dpi(int p_screen = -1) const;
  396. virtual float get_screen_refresh_rate(int p_screen = -1) const;
  397. virtual Point2 get_window_position() const;
  398. virtual void set_window_position(const Point2 &p_position);
  399. virtual Size2 get_window_size() const;
  400. virtual Size2 get_real_window_size() const;
  401. virtual Size2 get_max_window_size() const;
  402. virtual Size2 get_min_window_size() const;
  403. virtual void set_min_window_size(const Size2 p_size);
  404. virtual void set_max_window_size(const Size2 p_size);
  405. virtual void set_window_size(const Size2 p_size);
  406. virtual void set_window_fullscreen(bool p_enabled);
  407. virtual bool is_window_fullscreen() const;
  408. virtual void set_window_resizable(bool p_enabled);
  409. virtual bool is_window_resizable() const;
  410. virtual void set_window_minimized(bool p_enabled);
  411. virtual bool is_window_minimized() const;
  412. virtual void set_window_maximized(bool p_enabled);
  413. virtual bool is_window_maximized() const;
  414. virtual void set_window_always_on_top(bool p_enabled);
  415. virtual bool is_window_always_on_top() const;
  416. virtual bool is_window_focused() const;
  417. virtual void request_attention();
  418. virtual void *get_native_handle(int p_handle_type);
  419. virtual void set_borderless_window(bool p_borderless);
  420. virtual bool get_borderless_window();
  421. virtual bool get_window_per_pixel_transparency_enabled() const;
  422. virtual void set_window_per_pixel_transparency_enabled(bool p_enabled);
  423. virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false);
  424. virtual Error close_dynamic_library(void *p_library_handle);
  425. virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false);
  426. virtual MainLoop *get_main_loop() const;
  427. virtual uint64_t get_embedded_pck_offset() const;
  428. virtual String get_name() const;
  429. virtual Date get_date(bool utc) const;
  430. virtual Time get_time(bool utc) const;
  431. virtual TimeZoneInfo get_time_zone_info() const;
  432. virtual uint64_t get_unix_time() const;
  433. virtual uint64_t get_system_time_secs() const;
  434. virtual uint64_t get_system_time_msecs() const;
  435. virtual double get_subsecond_unix_time() const;
  436. virtual bool can_draw() const;
  437. virtual Error set_cwd(const String &p_cwd);
  438. virtual void delay_usec(uint32_t p_usec) const;
  439. virtual uint64_t get_ticks_usec() const;
  440. virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL, bool p_open_console = false);
  441. virtual Error kill(const ProcessID &p_pid);
  442. virtual int get_process_id() const;
  443. virtual bool is_process_running(const ProcessID &p_pid) const;
  444. virtual bool has_environment(const String &p_var) const;
  445. virtual String get_environment(const String &p_var) const;
  446. virtual bool set_environment(const String &p_var, const String &p_value) const;
  447. virtual void set_clipboard(const String &p_text);
  448. virtual String get_clipboard() const;
  449. void set_cursor_shape(CursorShape p_shape);
  450. CursorShape get_cursor_shape() const;
  451. virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
  452. void GetMaskBitmaps(HBITMAP hSourceBitmap, COLORREF clrTransparent, OUT HBITMAP &hAndMaskBitmap, OUT HBITMAP &hXorMaskBitmap);
  453. void set_native_icon(const String &p_filename);
  454. void set_icon(const Ref<Image> &p_icon);
  455. virtual String get_executable_path() const;
  456. virtual String get_locale() const;
  457. virtual String get_processor_name() const;
  458. virtual LatinKeyboardVariant get_latin_keyboard_variant() const;
  459. virtual int keyboard_get_layout_count() const;
  460. virtual int keyboard_get_current_layout() const;
  461. virtual void keyboard_set_current_layout(int p_index);
  462. virtual String keyboard_get_layout_language(int p_index) const;
  463. virtual String keyboard_get_layout_name(int p_index) const;
  464. virtual uint32_t keyboard_get_scancode_from_physical(uint32_t p_scancode) const;
  465. virtual void enable_for_stealing_focus(ProcessID pid);
  466. virtual void move_window_to_foreground();
  467. virtual String get_config_path() const;
  468. virtual String get_data_path() const;
  469. virtual String get_cache_path() const;
  470. virtual String get_godot_dir_name() const;
  471. virtual String get_system_dir(SystemDir p_dir, bool p_shared_storage = true) const;
  472. virtual String get_user_data_dir() const;
  473. virtual String get_unique_id() const;
  474. virtual void set_ime_active(const bool p_active);
  475. virtual void set_ime_position(const Point2 &p_pos);
  476. virtual void release_rendering_thread();
  477. virtual void make_rendering_thread();
  478. virtual void swap_buffers();
  479. virtual Error shell_open(String p_uri);
  480. void run();
  481. virtual bool get_swap_ok_cancel() { return true; }
  482. virtual bool is_joy_known(int p_device);
  483. virtual String get_joy_guid(int p_device) const;
  484. virtual void _set_use_vsync(bool p_enable);
  485. //virtual bool is_vsync_enabled() const;
  486. virtual OS::PowerState get_power_state();
  487. virtual int get_power_seconds_left();
  488. virtual int get_power_percent_left();
  489. virtual bool _check_internal_feature_support(const String &p_feature);
  490. void disable_crash_handler();
  491. bool is_disable_crash_handler() const;
  492. virtual void initialize_debugging();
  493. void force_process_input();
  494. virtual Error move_to_trash(const String &p_path);
  495. virtual void process_and_drop_events();
  496. OS_Windows(HINSTANCE _hInstance);
  497. ~OS_Windows();
  498. };
  499. #endif // OS_WINDOWS_H