diff options
Diffstat (limited to 'platform/macos/display_server_macos.h')
-rw-r--r-- | platform/macos/display_server_macos.h | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/platform/macos/display_server_macos.h b/platform/macos/display_server_macos.h index a19e02eb21..10c8abe663 100644 --- a/platform/macos/display_server_macos.h +++ b/platform/macos/display_server_macos.h @@ -39,11 +39,13 @@ #include "gl_manager_macos_legacy.h" #endif // GLES3_ENABLED -#if defined(VULKAN_ENABLED) -#include "vulkan_context_macos.h" +#if defined(RD_ENABLED) +#include "servers/rendering/rendering_device.h" -#include "drivers/vulkan/rendering_device_vulkan.h" +#if defined(VULKAN_ENABLED) +#include "rendering_context_driver_vulkan_macos.h" #endif // VULKAN_ENABLED +#endif // RD_ENABLED #define BitMap _QDBitMap // Suppress deprecated QuickDraw definition. @@ -73,6 +75,7 @@ public: Key physical_keycode = Key::NONE; Key key_label = Key::NONE; uint32_t unicode = 0; + KeyLocation location = KeyLocation::UNSPECIFIED; }; struct WindowData { @@ -133,9 +136,9 @@ private: GLManagerLegacy_MacOS *gl_manager_legacy = nullptr; GLManagerANGLE_MacOS *gl_manager_angle = nullptr; #endif -#if defined(VULKAN_ENABLED) - VulkanContextMacOS *context_vulkan = nullptr; - RenderingDeviceVulkan *rendering_device_vulkan = nullptr; +#if defined(RD_ENABLED) + RenderingContextDriver *rendering_context = nullptr; + RenderingDevice *rendering_device = nullptr; #endif String rendering_driver; @@ -198,6 +201,14 @@ private: HashMap<WindowID, WindowData> windows; + struct IndicatorData { + id view; + id item; + }; + + IndicatorID indicator_id_counter = 0; + HashMap<IndicatorID, IndicatorData> indicators; + IOPMAssertionID screen_keep_on_assertion = kIOPMNullAssertionID; struct MenuCall { @@ -232,6 +243,8 @@ private: int _get_system_menu_count(const NSMenu *p_menu) const; NSMenuItem *_menu_add_item(const String &p_menu_root, const String &p_label, Key p_accel, int p_index, int *r_out); + 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: NSMenu *get_dock_menu() const; void menu_callback(id p_sender); @@ -343,6 +356,7 @@ public: virtual Error dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) 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; @@ -426,6 +440,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; @@ -478,6 +494,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; + 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); static Vector<String> get_rendering_drivers_func(); |