From 15a9f94346c211b7afe96af500cb3405aabcf6b8 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sat, 7 Mar 2020 18:02:54 +0200 Subject: [PATCH] Add macOS DisplayServer implementation. Change global menu to use Callable, add support for check items and submenus. --- core/os/main_loop.cpp | 8 - core/os/main_loop.h | 2 - core/os/os.h | 4 +- editor/editor_node.cpp | 34 +- editor/editor_node.h | 3 +- editor/editor_run.cpp | 4 +- editor/project_manager.cpp | 59 +- editor/project_manager.h | 1 - main/main.cpp | 2 +- platform/linuxbsd/display_server_x11.cpp | 18 + platform/linuxbsd/display_server_x11.h | 1 + platform/osx/SCsub | 1 + platform/osx/display_server_osx.h | 306 ++ platform/osx/display_server_osx.mm | 3587 ++++++++++++++++++++++ platform/osx/joypad_osx.cpp | 28 +- platform/osx/joypad_osx.h | 4 +- platform/osx/os_osx.h | 243 +- platform/osx/os_osx.mm | 2896 +---------------- platform/osx/vulkan_context_osx.h | 2 +- platform/osx/vulkan_context_osx.mm | 6 +- scene/gui/line_edit.cpp | 21 +- scene/gui/text_edit.cpp | 20 +- scene/main/node.h | 1 + scene/main/scene_tree.cpp | 7 - scene/main/scene_tree.h | 1 - scene/main/window.cpp | 16 +- servers/display_server.cpp | 114 +- servers/display_server.h | 34 +- 28 files changed, 4253 insertions(+), 3170 deletions(-) create mode 100644 platform/osx/display_server_osx.h create mode 100644 platform/osx/display_server_osx.mm diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 4e0743809b4..0d1a080682c 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -44,8 +44,6 @@ void MainLoop::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::FLOAT, "delta"))); BIND_VMETHOD(MethodInfo("_finalize")); - BIND_VMETHOD(MethodInfo("_global_menu_action", PropertyInfo(Variant::NIL, "id"), PropertyInfo(Variant::NIL, "meta"))); - BIND_CONSTANT(NOTIFICATION_OS_MEMORY_WARNING); BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED); BIND_CONSTANT(NOTIFICATION_WM_ABOUT); @@ -91,12 +89,6 @@ bool MainLoop::idle(float p_time) { return false; } -void MainLoop::global_menu_action(const Variant &p_id, const Variant &p_meta) { - - if (get_script_instance()) - get_script_instance()->call("_global_menu_action", p_id, p_meta); -} - void MainLoop::finish() { if (get_script_instance()) { diff --git a/core/os/main_loop.h b/core/os/main_loop.h index 9d44af164af..8f6c8c91b12 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -62,8 +62,6 @@ public: virtual bool idle(float p_time); virtual void finish(); - virtual void global_menu_action(const Variant &p_id, const Variant &p_meta); - void set_init_script(const Ref