diff options
Diffstat (limited to 'platform/windows/display_server_windows.h')
-rw-r--r-- | platform/windows/display_server_windows.h | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 1e61462e95..81cddec49f 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -52,14 +52,8 @@ #include "drivers/xaudio2/audio_driver_xaudio2.h" #endif -#if defined(VULKAN_ENABLED) -#include "vulkan_context_win.h" - -#include "drivers/vulkan/rendering_device_vulkan.h" -#endif - -#if defined(D3D12_ENABLED) -#include "drivers/d3d12/rendering_device_d3d12.h" +#if defined(RD_ENABLED) +#include "servers/rendering/rendering_device.h" #endif #if defined(GLES3_ENABLED) @@ -293,6 +287,7 @@ class DisplayServerWindows : public DisplayServer { // UXTheme API static bool dark_title_available; + static bool use_legacy_dark_mode_before_20H1; static bool ux_theme_available; static ShouldAppsUseDarkModePtr ShouldAppsUseDarkMode; static GetImmersiveColorFromColorSetExPtr GetImmersiveColorFromColorSetEx; @@ -346,14 +341,9 @@ class DisplayServerWindows : public DisplayServer { GLManagerNative_Windows *gl_manager_native = nullptr; #endif -#if defined(VULKAN_ENABLED) - VulkanContextWindows *context_vulkan = nullptr; - RenderingDeviceVulkan *rendering_device_vulkan = nullptr; -#endif - -#if defined(D3D12_ENABLED) - D3D12Context *context_d3d12 = nullptr; - RenderingDeviceD3D12 *rendering_device_d3d12 = nullptr; +#if defined(RD_ENABLED) + RenderingContextDriver *rendering_context = nullptr; + RenderingDevice *rendering_device = nullptr; #endif RBMap<int, Vector2> touch_state; @@ -457,6 +447,13 @@ class DisplayServerWindows : public DisplayServer { WNDPROC user_proc = nullptr; + struct IndicatorData { + Callable callback; + }; + + IndicatorID indicator_id_counter = 0; + HashMap<IndicatorID, IndicatorData> indicators; + void _send_window_event(const WindowData &wd, WindowEvent p_event); void _get_window_style(bool p_main_window, bool p_fullscreen, bool p_multiwindow_fs, bool p_borderless, bool p_resizable, bool p_maximized, bool p_no_activate_focus, DWORD &r_style, DWORD &r_style_ex); @@ -480,6 +477,8 @@ class DisplayServerWindows : public DisplayServer { CursorShape cursor_shape = CursorShape::CURSOR_ARROW; RBMap<CursorShape, Vector<Variant>> cursors_cache; + Callable system_theme_changed; + void _drag_event(WindowID p_window, float p_x, float p_y, int idx); void _touch_event(WindowID p_window, bool p_pressed, float p_x, float p_y, int idx); @@ -501,6 +500,8 @@ class DisplayServerWindows : public DisplayServer { LRESULT _handle_early_window_message(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); Point2i _get_screens_origin() const; + Error _file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb); + public: LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); LRESULT MouseProc(int code, WPARAM wParam, LPARAM lParam); @@ -523,8 +524,11 @@ public: virtual bool is_dark_mode_supported() const override; virtual bool is_dark_mode() const override; virtual Color get_accent_color() const override; + virtual Color get_base_color() const override; + virtual void set_system_theme_change_callback(const Callable &p_callable) override; virtual Error file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback) override; + virtual Error file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback) override; virtual void mouse_set_mode(MouseMode p_mode) override; virtual MouseMode mouse_get_mode() const override; @@ -615,6 +619,8 @@ public: virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override; virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override; + virtual WindowID get_focused_window() const override; + virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override; virtual bool can_any_window_draw() const override; @@ -660,6 +666,12 @@ public: virtual void set_native_icon(const String &p_filename) override; virtual void set_icon(const Ref<Image> &p_icon) override; + virtual IndicatorID create_status_indicator(const Ref<Image> &p_icon, const String &p_tooltip, const Callable &p_callback) override; + virtual void status_indicator_set_icon(IndicatorID p_id, const Ref<Image> &p_icon) override; + virtual void status_indicator_set_tooltip(IndicatorID p_id, const String &p_tooltip) override; + virtual void status_indicator_set_callback(IndicatorID p_id, const Callable &p_callback) override; + virtual void delete_status_indicator(IndicatorID p_id) override; + virtual void set_context(Context p_context) override; static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error); |