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