From db6d4352ea528e925c69ee94f6fb9bc0942719ec Mon Sep 17 00:00:00 2001
From: bruvzg <7645683+bruvzg@users.noreply.github.com>
Date: Wed, 6 Feb 2019 15:57:06 +0200
Subject: [macOS] Add methods to modify global and dock menus. Add ability to
 open multiple editor/project manager instances, recent/favourite project list
 to project manager dock menu and opened scene list to editor dock menu.

---
 doc/classes/MainLoop.xml  | 10 ++++++++++
 doc/classes/OS.xml        | 44 ++++++++++++++++++++++++++++++++++++++++++++
 doc/classes/SceneTree.xml |  9 +++++++++
 3 files changed, 63 insertions(+)

(limited to 'doc/classes')

diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index fedf77bfd2..181a99590a 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -61,6 +61,16 @@
 				Called before the program exits.
 			</description>
 		</method>
+		<method name="_global_menu_action" qualifiers="virtual">
+			<return type="void">
+			</return>
+			<argument index="0" name="id" type="Variant">
+			</argument>
+			<argument index="1" name="meta" type="Variant">
+			</argument>
+			<description>
+			</description>
+		</method>
 		<method name="_idle" qualifiers="virtual">
 			<return type="bool">
 			</return>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index c770e78c7c..938777a36b 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -497,6 +497,50 @@
 				Returns unobscured area of the window where interactive controls should be rendered.
 			</description>
 		</method>
+		<method name="global_menu_add_item">
+			<return type="void">
+			</return>
+			<argument index="0" name="menu" type="String">
+			</argument>
+			<argument index="1" name="label" type="String">
+			</argument>
+			<argument index="2" name="id" type="Variant">
+			</argument>
+			<argument index="3" name="meta" type="Variant">
+			</argument>
+			<description>
+				Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu.
+			</description>
+		</method>
+		<method name="global_menu_add_separator">
+			<return type="void">
+			</return>
+			<argument index="0" name="menu" type="String">
+			</argument>
+			<description>
+				Add a separator between items. Separators also occupy an index.
+			</description>
+		</method>
+		<method name="global_menu_clear">
+			<return type="void">
+			</return>
+			<argument index="0" name="menu" type="String">
+			</argument>
+			<description>
+				Clear the global menu, in effect removing all items.
+			</description>
+		</method>
+		<method name="global_menu_remove_item">
+			<return type="void">
+			</return>
+			<argument index="0" name="menu" type="String">
+			</argument>
+			<argument index="1" name="idx" type="int">
+			</argument>
+			<description>
+				Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one.
+			</description>
+		</method>
 		<method name="has_environment" qualifiers="const">
 			<return type="bool">
 			</return>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 1302c1e6bf..ed43f83f05 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -324,6 +324,15 @@
 				Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated.
 			</description>
 		</signal>
+		<signal name="global_menu_action">
+			<argument index="0" name="id" type="Nil">
+			</argument>
+			<argument index="1" name="meta" type="Nil">
+			</argument>
+			<description>
+				Emitted whenever global menu item is clicked.
+			</description>
+		</signal>
 		<signal name="idle_frame">
 			<description>
 				Emitted immediately before [method Node._process] is called on every node in the [SceneTree].
-- 
cgit v1.2.3