native_menu.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. /**************************************************************************/
  2. /* native_menu.cpp */
  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. #include "native_menu.h"
  31. #include "scene/resources/image_texture.h"
  32. NativeMenu *NativeMenu::singleton = nullptr;
  33. void NativeMenu::_bind_methods() {
  34. ClassDB::bind_method(D_METHOD("has_feature", "feature"), &NativeMenu::has_feature);
  35. ClassDB::bind_method(D_METHOD("has_system_menu", "menu_id"), &NativeMenu::has_system_menu);
  36. ClassDB::bind_method(D_METHOD("get_system_menu", "menu_id"), &NativeMenu::get_system_menu);
  37. ClassDB::bind_method(D_METHOD("get_system_menu_name", "menu_id"), &NativeMenu::get_system_menu_name);
  38. ClassDB::bind_method(D_METHOD("create_menu"), &NativeMenu::create_menu);
  39. ClassDB::bind_method(D_METHOD("has_menu", "rid"), &NativeMenu::has_menu);
  40. ClassDB::bind_method(D_METHOD("free_menu", "rid"), &NativeMenu::free_menu);
  41. ClassDB::bind_method(D_METHOD("get_size", "rid"), &NativeMenu::get_size);
  42. ClassDB::bind_method(D_METHOD("popup", "rid", "position"), &NativeMenu::popup);
  43. ClassDB::bind_method(D_METHOD("set_interface_direction", "rid", "is_rtl"), &NativeMenu::set_interface_direction);
  44. ClassDB::bind_method(D_METHOD("set_popup_open_callback", "rid", "callback"), &NativeMenu::set_popup_open_callback);
  45. ClassDB::bind_method(D_METHOD("get_popup_open_callback", "rid"), &NativeMenu::get_popup_open_callback);
  46. ClassDB::bind_method(D_METHOD("set_popup_close_callback", "rid", "callback"), &NativeMenu::set_popup_close_callback);
  47. ClassDB::bind_method(D_METHOD("get_popup_close_callback", "rid"), &NativeMenu::get_popup_close_callback);
  48. ClassDB::bind_method(D_METHOD("set_minimum_width", "rid", "width"), &NativeMenu::set_minimum_width);
  49. ClassDB::bind_method(D_METHOD("get_minimum_width", "rid"), &NativeMenu::get_minimum_width);
  50. ClassDB::bind_method(D_METHOD("is_opened", "rid"), &NativeMenu::is_opened);
  51. ClassDB::bind_method(D_METHOD("add_submenu_item", "rid", "label", "submenu_rid", "tag", "index"), &NativeMenu::add_submenu_item, DEFVAL(Variant()), DEFVAL(-1));
  52. ClassDB::bind_method(D_METHOD("add_item", "rid", "label", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  53. ClassDB::bind_method(D_METHOD("add_check_item", "rid", "label", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  54. ClassDB::bind_method(D_METHOD("add_icon_item", "rid", "icon", "label", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_icon_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  55. ClassDB::bind_method(D_METHOD("add_icon_check_item", "rid", "icon", "label", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_icon_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  56. ClassDB::bind_method(D_METHOD("add_radio_check_item", "rid", "label", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_radio_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  57. ClassDB::bind_method(D_METHOD("add_icon_radio_check_item", "rid", "icon", "label", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_icon_radio_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  58. ClassDB::bind_method(D_METHOD("add_multistate_item", "rid", "label", "max_states", "default_state", "callback", "key_callback", "tag", "accelerator", "index"), &NativeMenu::add_multistate_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
  59. ClassDB::bind_method(D_METHOD("add_separator", "rid", "index"), &NativeMenu::add_separator, DEFVAL(-1));
  60. ClassDB::bind_method(D_METHOD("find_item_index_with_text", "rid", "text"), &NativeMenu::find_item_index_with_text);
  61. ClassDB::bind_method(D_METHOD("find_item_index_with_tag", "rid", "tag"), &NativeMenu::find_item_index_with_tag);
  62. ClassDB::bind_method(D_METHOD("find_item_index_with_submenu", "rid", "submenu_rid"), &NativeMenu::find_item_index_with_submenu);
  63. ClassDB::bind_method(D_METHOD("is_item_checked", "rid", "idx"), &NativeMenu::is_item_checked);
  64. ClassDB::bind_method(D_METHOD("is_item_checkable", "rid", "idx"), &NativeMenu::is_item_checkable);
  65. ClassDB::bind_method(D_METHOD("is_item_radio_checkable", "rid", "idx"), &NativeMenu::is_item_radio_checkable);
  66. ClassDB::bind_method(D_METHOD("get_item_callback", "rid", "idx"), &NativeMenu::get_item_callback);
  67. ClassDB::bind_method(D_METHOD("get_item_key_callback", "rid", "idx"), &NativeMenu::get_item_key_callback);
  68. ClassDB::bind_method(D_METHOD("get_item_tag", "rid", "idx"), &NativeMenu::get_item_tag);
  69. ClassDB::bind_method(D_METHOD("get_item_text", "rid", "idx"), &NativeMenu::get_item_text);
  70. ClassDB::bind_method(D_METHOD("get_item_submenu", "rid", "idx"), &NativeMenu::get_item_submenu);
  71. ClassDB::bind_method(D_METHOD("get_item_accelerator", "rid", "idx"), &NativeMenu::get_item_accelerator);
  72. ClassDB::bind_method(D_METHOD("is_item_disabled", "rid", "idx"), &NativeMenu::is_item_disabled);
  73. ClassDB::bind_method(D_METHOD("is_item_hidden", "rid", "idx"), &NativeMenu::is_item_hidden);
  74. ClassDB::bind_method(D_METHOD("get_item_tooltip", "rid", "idx"), &NativeMenu::get_item_tooltip);
  75. ClassDB::bind_method(D_METHOD("get_item_state", "rid", "idx"), &NativeMenu::get_item_state);
  76. ClassDB::bind_method(D_METHOD("get_item_max_states", "rid", "idx"), &NativeMenu::get_item_max_states);
  77. ClassDB::bind_method(D_METHOD("get_item_icon", "rid", "idx"), &NativeMenu::get_item_icon);
  78. ClassDB::bind_method(D_METHOD("get_item_indentation_level", "rid", "idx"), &NativeMenu::get_item_indentation_level);
  79. ClassDB::bind_method(D_METHOD("set_item_checked", "rid", "idx", "checked"), &NativeMenu::set_item_checked);
  80. ClassDB::bind_method(D_METHOD("set_item_checkable", "rid", "idx", "checkable"), &NativeMenu::set_item_checkable);
  81. ClassDB::bind_method(D_METHOD("set_item_radio_checkable", "rid", "idx", "checkable"), &NativeMenu::set_item_radio_checkable);
  82. ClassDB::bind_method(D_METHOD("set_item_callback", "rid", "idx", "callback"), &NativeMenu::set_item_callback);
  83. ClassDB::bind_method(D_METHOD("set_item_hover_callbacks", "rid", "idx", "callback"), &NativeMenu::set_item_hover_callbacks);
  84. ClassDB::bind_method(D_METHOD("set_item_key_callback", "rid", "idx", "key_callback"), &NativeMenu::set_item_key_callback);
  85. ClassDB::bind_method(D_METHOD("set_item_tag", "rid", "idx", "tag"), &NativeMenu::set_item_tag);
  86. ClassDB::bind_method(D_METHOD("set_item_text", "rid", "idx", "text"), &NativeMenu::set_item_text);
  87. ClassDB::bind_method(D_METHOD("set_item_submenu", "rid", "idx", "submenu_rid"), &NativeMenu::set_item_submenu);
  88. ClassDB::bind_method(D_METHOD("set_item_accelerator", "rid", "idx", "keycode"), &NativeMenu::set_item_accelerator);
  89. ClassDB::bind_method(D_METHOD("set_item_disabled", "rid", "idx", "disabled"), &NativeMenu::set_item_disabled);
  90. ClassDB::bind_method(D_METHOD("set_item_hidden", "rid", "idx", "hidden"), &NativeMenu::set_item_hidden);
  91. ClassDB::bind_method(D_METHOD("set_item_tooltip", "rid", "idx", "tooltip"), &NativeMenu::set_item_tooltip);
  92. ClassDB::bind_method(D_METHOD("set_item_state", "rid", "idx", "state"), &NativeMenu::set_item_state);
  93. ClassDB::bind_method(D_METHOD("set_item_max_states", "rid", "idx", "max_states"), &NativeMenu::set_item_max_states);
  94. ClassDB::bind_method(D_METHOD("set_item_icon", "rid", "idx", "icon"), &NativeMenu::set_item_icon);
  95. ClassDB::bind_method(D_METHOD("set_item_indentation_level", "rid", "idx", "level"), &NativeMenu::set_item_indentation_level);
  96. ClassDB::bind_method(D_METHOD("get_item_count", "rid"), &NativeMenu::get_item_count);
  97. ClassDB::bind_method(D_METHOD("is_system_menu", "rid"), &NativeMenu::is_system_menu);
  98. ClassDB::bind_method(D_METHOD("remove_item", "rid", "idx"), &NativeMenu::remove_item);
  99. ClassDB::bind_method(D_METHOD("clear", "rid"), &NativeMenu::clear);
  100. BIND_ENUM_CONSTANT(FEATURE_GLOBAL_MENU);
  101. BIND_ENUM_CONSTANT(FEATURE_POPUP_MENU);
  102. BIND_ENUM_CONSTANT(FEATURE_OPEN_CLOSE_CALLBACK);
  103. BIND_ENUM_CONSTANT(FEATURE_HOVER_CALLBACK);
  104. BIND_ENUM_CONSTANT(FEATURE_KEY_CALLBACK);
  105. BIND_ENUM_CONSTANT(INVALID_MENU_ID);
  106. BIND_ENUM_CONSTANT(MAIN_MENU_ID);
  107. BIND_ENUM_CONSTANT(APPLICATION_MENU_ID);
  108. BIND_ENUM_CONSTANT(WINDOW_MENU_ID);
  109. BIND_ENUM_CONSTANT(HELP_MENU_ID);
  110. BIND_ENUM_CONSTANT(DOCK_MENU_ID);
  111. }
  112. bool NativeMenu::has_feature(Feature p_feature) const {
  113. return false;
  114. }
  115. bool NativeMenu::has_system_menu(SystemMenus p_menu_id) const {
  116. return false;
  117. }
  118. RID NativeMenu::get_system_menu(SystemMenus p_menu_id) const {
  119. WARN_PRINT("Global menus are not supported on this platform.");
  120. return RID();
  121. }
  122. String NativeMenu::get_system_menu_name(SystemMenus p_menu_id) const {
  123. switch (p_menu_id) {
  124. case MAIN_MENU_ID:
  125. return "Main menu";
  126. case APPLICATION_MENU_ID:
  127. return "Application menu";
  128. case WINDOW_MENU_ID:
  129. return "Window menu";
  130. case HELP_MENU_ID:
  131. return "Help menu";
  132. case DOCK_MENU_ID:
  133. return "Dock menu";
  134. default:
  135. return "Invalid";
  136. }
  137. }
  138. RID NativeMenu::create_menu() {
  139. WARN_PRINT("Global menus are not supported on this platform.");
  140. return RID();
  141. }
  142. bool NativeMenu::has_menu(const RID &p_rid) const {
  143. WARN_PRINT("Global menus are not supported on this platform.");
  144. return false;
  145. }
  146. void NativeMenu::free_menu(const RID &p_rid) {
  147. WARN_PRINT("Global menus are not supported on this platform.");
  148. }
  149. Size2 NativeMenu::get_size(const RID &p_rid) const {
  150. WARN_PRINT("Global menus are not supported on this platform.");
  151. return Size2();
  152. }
  153. void NativeMenu::popup(const RID &p_rid, const Vector2i &p_position) {
  154. WARN_PRINT("Global menus are not supported on this platform.");
  155. }
  156. void NativeMenu::set_interface_direction(const RID &p_rid, bool p_is_rtl) {
  157. WARN_PRINT("Global menus are not supported on this platform.");
  158. }
  159. void NativeMenu::set_popup_open_callback(const RID &p_rid, const Callable &p_callback) {
  160. WARN_PRINT("Global menus are not supported on this platform.");
  161. }
  162. Callable NativeMenu::get_popup_open_callback(const RID &p_rid) const {
  163. WARN_PRINT("Global menus are not supported on this platform.");
  164. return Callable();
  165. }
  166. void NativeMenu::set_popup_close_callback(const RID &p_rid, const Callable &p_callback) {
  167. WARN_PRINT("Global menus are not supported on this platform.");
  168. }
  169. Callable NativeMenu::get_popup_close_callback(const RID &p_rid) const {
  170. WARN_PRINT("Global menus are not supported on this platform.");
  171. return Callable();
  172. }
  173. bool NativeMenu::is_opened(const RID &p_rid) const {
  174. WARN_PRINT("Global menus are not supported on this platform.");
  175. return false;
  176. }
  177. void NativeMenu::set_minimum_width(const RID &p_rid, float p_width) {
  178. WARN_PRINT("Global menus are not supported on this platform.");
  179. }
  180. float NativeMenu::get_minimum_width(const RID &p_rid) const {
  181. WARN_PRINT("Global menus are not supported on this platform.");
  182. return 0.f;
  183. }
  184. int NativeMenu::add_submenu_item(const RID &p_rid, const String &p_label, const RID &p_submenu_rid, const Variant &p_tag, int p_index) {
  185. WARN_PRINT("Global menus are not supported on this platform.");
  186. return -1;
  187. }
  188. int NativeMenu::add_item(const RID &p_rid, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  189. WARN_PRINT("Global menus are not supported on this platform.");
  190. return -1;
  191. }
  192. int NativeMenu::add_check_item(const RID &p_rid, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  193. WARN_PRINT("Global menus are not supported on this platform.");
  194. return -1;
  195. }
  196. int NativeMenu::add_icon_item(const RID &p_rid, const Ref<Texture2D> &p_icon, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  197. WARN_PRINT("Global menus are not supported on this platform.");
  198. return -1;
  199. }
  200. int NativeMenu::add_icon_check_item(const RID &p_rid, const Ref<Texture2D> &p_icon, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  201. WARN_PRINT("Global menus are not supported on this platform.");
  202. return -1;
  203. }
  204. int NativeMenu::add_radio_check_item(const RID &p_rid, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  205. WARN_PRINT("Global menus are not supported on this platform.");
  206. return -1;
  207. }
  208. int NativeMenu::add_icon_radio_check_item(const RID &p_rid, const Ref<Texture2D> &p_icon, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  209. WARN_PRINT("Global menus are not supported on this platform.");
  210. return -1;
  211. }
  212. int NativeMenu::add_multistate_item(const RID &p_rid, const String &p_label, int p_max_states, int p_default_state, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
  213. WARN_PRINT("Global menus are not supported on this platform.");
  214. return -1;
  215. }
  216. int NativeMenu::add_separator(const RID &p_rid, int p_index) {
  217. WARN_PRINT("Global menus are not supported on this platform.");
  218. return -1;
  219. }
  220. int NativeMenu::find_item_index_with_text(const RID &p_rid, const String &p_text) const {
  221. WARN_PRINT("Global menus are not supported on this platform.");
  222. return -1;
  223. }
  224. int NativeMenu::find_item_index_with_tag(const RID &p_rid, const Variant &p_tag) const {
  225. WARN_PRINT("Global menus are not supported on this platform.");
  226. return -1;
  227. }
  228. int NativeMenu::find_item_index_with_submenu(const RID &p_rid, const RID &p_submenu_rid) const {
  229. if (!has_menu(p_rid) || !has_menu(p_submenu_rid)) {
  230. return -1;
  231. }
  232. int count = get_item_count(p_rid);
  233. for (int i = 0; i < count; i++) {
  234. if (p_submenu_rid == get_item_submenu(p_rid, i)) {
  235. return i;
  236. }
  237. }
  238. return -1;
  239. }
  240. bool NativeMenu::is_item_checked(const RID &p_rid, int p_idx) const {
  241. WARN_PRINT("Global menus are not supported on this platform.");
  242. return false;
  243. }
  244. bool NativeMenu::is_item_checkable(const RID &p_rid, int p_idx) const {
  245. WARN_PRINT("Global menus are not supported on this platform.");
  246. return false;
  247. }
  248. bool NativeMenu::is_item_radio_checkable(const RID &p_rid, int p_idx) const {
  249. WARN_PRINT("Global menus are not supported on this platform.");
  250. return false;
  251. }
  252. Callable NativeMenu::get_item_callback(const RID &p_rid, int p_idx) const {
  253. WARN_PRINT("Global menus are not supported on this platform.");
  254. return Callable();
  255. }
  256. Callable NativeMenu::get_item_key_callback(const RID &p_rid, int p_idx) const {
  257. WARN_PRINT("Global menus are not supported on this platform.");
  258. return Callable();
  259. }
  260. Variant NativeMenu::get_item_tag(const RID &p_rid, int p_idx) const {
  261. WARN_PRINT("Global menus are not supported on this platform.");
  262. return Variant();
  263. }
  264. String NativeMenu::get_item_text(const RID &p_rid, int p_idx) const {
  265. WARN_PRINT("Global menus are not supported on this platform.");
  266. return String();
  267. }
  268. RID NativeMenu::get_item_submenu(const RID &p_rid, int p_idx) const {
  269. WARN_PRINT("Global menus are not supported on this platform.");
  270. return RID();
  271. }
  272. Key NativeMenu::get_item_accelerator(const RID &p_rid, int p_idx) const {
  273. WARN_PRINT("Global menus are not supported on this platform.");
  274. return Key::NONE;
  275. }
  276. bool NativeMenu::is_item_disabled(const RID &p_rid, int p_idx) const {
  277. WARN_PRINT("Global menus are not supported on this platform.");
  278. return false;
  279. }
  280. bool NativeMenu::is_item_hidden(const RID &p_rid, int p_idx) const {
  281. WARN_PRINT("Global menus are not supported on this platform.");
  282. return false;
  283. }
  284. String NativeMenu::get_item_tooltip(const RID &p_rid, int p_idx) const {
  285. WARN_PRINT("Global menus are not supported on this platform.");
  286. return String();
  287. }
  288. int NativeMenu::get_item_state(const RID &p_rid, int p_idx) const {
  289. WARN_PRINT("Global menus are not supported on this platform.");
  290. return -1;
  291. }
  292. int NativeMenu::get_item_max_states(const RID &p_rid, int p_idx) const {
  293. WARN_PRINT("Global menus are not supported on this platform.");
  294. return -1;
  295. }
  296. Ref<Texture2D> NativeMenu::get_item_icon(const RID &p_rid, int p_idx) const {
  297. WARN_PRINT("Global menus are not supported on this platform.");
  298. return Ref<Texture2D>();
  299. }
  300. int NativeMenu::get_item_indentation_level(const RID &p_rid, int p_idx) const {
  301. WARN_PRINT("Global menus are not supported on this platform.");
  302. return 0;
  303. }
  304. void NativeMenu::set_item_checked(const RID &p_rid, int p_idx, bool p_checked) {
  305. WARN_PRINT("Global menus are not supported on this platform.");
  306. }
  307. void NativeMenu::set_item_checkable(const RID &p_rid, int p_idx, bool p_checkable) {
  308. WARN_PRINT("Global menus are not supported on this platform.");
  309. }
  310. void NativeMenu::set_item_radio_checkable(const RID &p_rid, int p_idx, bool p_checkable) {
  311. WARN_PRINT("Global menus are not supported on this platform.");
  312. }
  313. void NativeMenu::set_item_callback(const RID &p_rid, int p_idx, const Callable &p_callback) {
  314. WARN_PRINT("Global menus are not supported on this platform.");
  315. }
  316. void NativeMenu::set_item_key_callback(const RID &p_rid, int p_idx, const Callable &p_key_callback) {
  317. WARN_PRINT("Global menus are not supported on this platform.");
  318. }
  319. void NativeMenu::set_item_hover_callbacks(const RID &p_rid, int p_idx, const Callable &p_callback) {
  320. WARN_PRINT("Global menus are not supported on this platform.");
  321. }
  322. void NativeMenu::set_item_tag(const RID &p_rid, int p_idx, const Variant &p_tag) {
  323. WARN_PRINT("Global menus are not supported on this platform.");
  324. }
  325. void NativeMenu::set_item_text(const RID &p_rid, int p_idx, const String &p_text) {
  326. WARN_PRINT("Global menus are not supported on this platform.");
  327. }
  328. void NativeMenu::set_item_submenu(const RID &p_rid, int p_idx, const RID &p_submenu_rid) {
  329. WARN_PRINT("Global menus are not supported on this platform.");
  330. }
  331. void NativeMenu::set_item_accelerator(const RID &p_rid, int p_idx, Key p_keycode) {
  332. WARN_PRINT("Global menus are not supported on this platform.");
  333. }
  334. void NativeMenu::set_item_disabled(const RID &p_rid, int p_idx, bool p_disabled) {
  335. WARN_PRINT("Global menus are not supported on this platform.");
  336. }
  337. void NativeMenu::set_item_hidden(const RID &p_rid, int p_idx, bool p_hidden) {
  338. WARN_PRINT("Global menus are not supported on this platform.");
  339. }
  340. void NativeMenu::set_item_tooltip(const RID &p_rid, int p_idx, const String &p_tooltip) {
  341. WARN_PRINT("Global menus are not supported on this platform.");
  342. }
  343. void NativeMenu::set_item_state(const RID &p_rid, int p_idx, int p_state) {
  344. WARN_PRINT("Global menus are not supported on this platform.");
  345. }
  346. void NativeMenu::set_item_max_states(const RID &p_rid, int p_idx, int p_max_states) {
  347. WARN_PRINT("Global menus are not supported on this platform.");
  348. }
  349. void NativeMenu::set_item_icon(const RID &p_rid, int p_idx, const Ref<Texture2D> &p_icon) {
  350. WARN_PRINT("Global menus are not supported on this platform.");
  351. }
  352. void NativeMenu::set_item_indentation_level(const RID &p_rid, int p_idx, int p_level) {
  353. WARN_PRINT("Global menus are not supported on this platform.");
  354. }
  355. int NativeMenu::get_item_count(const RID &p_rid) const {
  356. WARN_PRINT("Global menus are not supported on this platform.");
  357. return 0;
  358. }
  359. bool NativeMenu::is_system_menu(const RID &p_rid) const {
  360. WARN_PRINT("Global menus are not supported on this platform.");
  361. return false;
  362. }
  363. void NativeMenu::remove_item(const RID &p_rid, int p_idx) {
  364. WARN_PRINT("Global menus are not supported on this platform.");
  365. }
  366. void NativeMenu::clear(const RID &p_rid) {
  367. WARN_PRINT("Global menus are not supported on this platform.");
  368. }