Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/servers/display/native_menu.cpp
20854 views
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
ClassDB::bind_method(D_METHOD("set_item_index", "rid", "idx", "target_idx"), &NativeMenu::set_item_index);
113
114
ClassDB::bind_method(D_METHOD("get_item_count", "rid"), &NativeMenu::get_item_count);
115
ClassDB::bind_method(D_METHOD("is_system_menu", "rid"), &NativeMenu::is_system_menu);
116
117
ClassDB::bind_method(D_METHOD("remove_item", "rid", "idx"), &NativeMenu::remove_item);
118
ClassDB::bind_method(D_METHOD("clear", "rid"), &NativeMenu::clear);
119
120
BIND_ENUM_CONSTANT(FEATURE_GLOBAL_MENU);
121
BIND_ENUM_CONSTANT(FEATURE_POPUP_MENU);
122
BIND_ENUM_CONSTANT(FEATURE_OPEN_CLOSE_CALLBACK);
123
BIND_ENUM_CONSTANT(FEATURE_HOVER_CALLBACK);
124
BIND_ENUM_CONSTANT(FEATURE_KEY_CALLBACK);
125
126
BIND_ENUM_CONSTANT(INVALID_MENU_ID);
127
BIND_ENUM_CONSTANT(MAIN_MENU_ID);
128
BIND_ENUM_CONSTANT(APPLICATION_MENU_ID);
129
BIND_ENUM_CONSTANT(WINDOW_MENU_ID);
130
BIND_ENUM_CONSTANT(HELP_MENU_ID);
131
BIND_ENUM_CONSTANT(DOCK_MENU_ID);
132
}
133
134
bool NativeMenu::has_feature(Feature p_feature) const {
135
return false;
136
}
137
138
bool NativeMenu::has_system_menu(SystemMenus p_menu_id) const {
139
return false;
140
}
141
142
RID NativeMenu::get_system_menu(SystemMenus p_menu_id) const {
143
WARN_PRINT("Global menus are not supported on this platform.");
144
return RID();
145
}
146
147
String NativeMenu::get_system_menu_name(SystemMenus p_menu_id) const {
148
switch (p_menu_id) {
149
case MAIN_MENU_ID:
150
return "Main menu";
151
case APPLICATION_MENU_ID:
152
return "Application menu";
153
case WINDOW_MENU_ID:
154
return "Window menu";
155
case HELP_MENU_ID:
156
return "Help menu";
157
case DOCK_MENU_ID:
158
return "Dock menu";
159
default:
160
return "Invalid";
161
}
162
}
163
164
String NativeMenu::get_system_menu_text(SystemMenus p_menu_id) const {
165
WARN_PRINT("Global menus are not supported on this platform.");
166
return String();
167
}
168
169
void NativeMenu::set_system_menu_text(SystemMenus p_menu_id, const String &p_name) {
170
WARN_PRINT("Global menus are not supported on this platform.");
171
}
172
173
RID NativeMenu::create_menu() {
174
WARN_PRINT("Global menus are not supported on this platform.");
175
return RID();
176
}
177
178
bool NativeMenu::has_menu(const RID &p_rid) const {
179
WARN_PRINT("Global menus are not supported on this platform.");
180
return false;
181
}
182
183
void NativeMenu::free_menu(const RID &p_rid) {
184
WARN_PRINT("Global menus are not supported on this platform.");
185
}
186
187
Size2 NativeMenu::get_size(const RID &p_rid) const {
188
WARN_PRINT("Global menus are not supported on this platform.");
189
return Size2();
190
}
191
192
void NativeMenu::popup(const RID &p_rid, const Vector2i &p_position) {
193
WARN_PRINT("Global menus are not supported on this platform.");
194
}
195
196
void NativeMenu::set_interface_direction(const RID &p_rid, bool p_is_rtl) {
197
WARN_PRINT("Global menus are not supported on this platform.");
198
}
199
200
void NativeMenu::set_popup_open_callback(const RID &p_rid, const Callable &p_callback) {
201
WARN_PRINT("Global menus are not supported on this platform.");
202
}
203
204
Callable NativeMenu::get_popup_open_callback(const RID &p_rid) const {
205
WARN_PRINT("Global menus are not supported on this platform.");
206
return Callable();
207
}
208
209
void NativeMenu::set_popup_close_callback(const RID &p_rid, const Callable &p_callback) {
210
WARN_PRINT("Global menus are not supported on this platform.");
211
}
212
213
Callable NativeMenu::get_popup_close_callback(const RID &p_rid) const {
214
WARN_PRINT("Global menus are not supported on this platform.");
215
return Callable();
216
}
217
218
bool NativeMenu::is_opened(const RID &p_rid) const {
219
WARN_PRINT("Global menus are not supported on this platform.");
220
return false;
221
}
222
223
void NativeMenu::set_minimum_width(const RID &p_rid, float p_width) {
224
WARN_PRINT("Global menus are not supported on this platform.");
225
}
226
227
float NativeMenu::get_minimum_width(const RID &p_rid) const {
228
WARN_PRINT("Global menus are not supported on this platform.");
229
return 0.f;
230
}
231
232
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) {
233
WARN_PRINT("Global menus are not supported on this platform.");
234
return -1;
235
}
236
237
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) {
238
WARN_PRINT("Global menus are not supported on this platform.");
239
return -1;
240
}
241
242
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) {
243
WARN_PRINT("Global menus are not supported on this platform.");
244
return -1;
245
}
246
247
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) {
248
WARN_PRINT("Global menus are not supported on this platform.");
249
return -1;
250
}
251
252
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) {
253
WARN_PRINT("Global menus are not supported on this platform.");
254
return -1;
255
}
256
257
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) {
258
WARN_PRINT("Global menus are not supported on this platform.");
259
return -1;
260
}
261
262
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) {
263
WARN_PRINT("Global menus are not supported on this platform.");
264
return -1;
265
}
266
267
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) {
268
WARN_PRINT("Global menus are not supported on this platform.");
269
return -1;
270
}
271
272
int NativeMenu::add_separator(const RID &p_rid, int p_index) {
273
WARN_PRINT("Global menus are not supported on this platform.");
274
return -1;
275
}
276
277
int NativeMenu::find_item_index_with_text(const RID &p_rid, const String &p_text) const {
278
WARN_PRINT("Global menus are not supported on this platform.");
279
return -1;
280
}
281
282
int NativeMenu::find_item_index_with_tag(const RID &p_rid, const Variant &p_tag) const {
283
WARN_PRINT("Global menus are not supported on this platform.");
284
return -1;
285
}
286
287
int NativeMenu::find_item_index_with_submenu(const RID &p_rid, const RID &p_submenu_rid) const {
288
if (!has_menu(p_rid) || !has_menu(p_submenu_rid)) {
289
return -1;
290
}
291
int count = get_item_count(p_rid);
292
for (int i = 0; i < count; i++) {
293
if (p_submenu_rid == get_item_submenu(p_rid, i)) {
294
return i;
295
}
296
}
297
return -1;
298
}
299
300
bool NativeMenu::is_item_checked(const RID &p_rid, int p_idx) const {
301
WARN_PRINT("Global menus are not supported on this platform.");
302
return false;
303
}
304
305
bool NativeMenu::is_item_checkable(const RID &p_rid, int p_idx) const {
306
WARN_PRINT("Global menus are not supported on this platform.");
307
return false;
308
}
309
310
bool NativeMenu::is_item_radio_checkable(const RID &p_rid, int p_idx) const {
311
WARN_PRINT("Global menus are not supported on this platform.");
312
return false;
313
}
314
315
Callable NativeMenu::get_item_callback(const RID &p_rid, int p_idx) const {
316
WARN_PRINT("Global menus are not supported on this platform.");
317
return Callable();
318
}
319
320
Callable NativeMenu::get_item_key_callback(const RID &p_rid, int p_idx) const {
321
WARN_PRINT("Global menus are not supported on this platform.");
322
return Callable();
323
}
324
325
Variant NativeMenu::get_item_tag(const RID &p_rid, int p_idx) const {
326
WARN_PRINT("Global menus are not supported on this platform.");
327
return Variant();
328
}
329
330
String NativeMenu::get_item_text(const RID &p_rid, int p_idx) const {
331
WARN_PRINT("Global menus are not supported on this platform.");
332
return String();
333
}
334
335
RID NativeMenu::get_item_submenu(const RID &p_rid, int p_idx) const {
336
WARN_PRINT("Global menus are not supported on this platform.");
337
return RID();
338
}
339
340
Key NativeMenu::get_item_accelerator(const RID &p_rid, int p_idx) const {
341
WARN_PRINT("Global menus are not supported on this platform.");
342
return Key::NONE;
343
}
344
345
bool NativeMenu::is_item_disabled(const RID &p_rid, int p_idx) const {
346
WARN_PRINT("Global menus are not supported on this platform.");
347
return false;
348
}
349
350
bool NativeMenu::is_item_hidden(const RID &p_rid, int p_idx) const {
351
WARN_PRINT("Global menus are not supported on this platform.");
352
return false;
353
}
354
355
String NativeMenu::get_item_tooltip(const RID &p_rid, int p_idx) const {
356
WARN_PRINT("Global menus are not supported on this platform.");
357
return String();
358
}
359
360
int NativeMenu::get_item_state(const RID &p_rid, int p_idx) const {
361
WARN_PRINT("Global menus are not supported on this platform.");
362
return -1;
363
}
364
365
int NativeMenu::get_item_max_states(const RID &p_rid, int p_idx) const {
366
WARN_PRINT("Global menus are not supported on this platform.");
367
return -1;
368
}
369
370
Ref<Texture2D> NativeMenu::get_item_icon(const RID &p_rid, int p_idx) const {
371
WARN_PRINT("Global menus are not supported on this platform.");
372
return Ref<Texture2D>();
373
}
374
375
int NativeMenu::get_item_indentation_level(const RID &p_rid, int p_idx) const {
376
WARN_PRINT("Global menus are not supported on this platform.");
377
return 0;
378
}
379
380
void NativeMenu::set_item_checked(const RID &p_rid, int p_idx, bool p_checked) {
381
WARN_PRINT("Global menus are not supported on this platform.");
382
}
383
384
void NativeMenu::set_item_checkable(const RID &p_rid, int p_idx, bool p_checkable) {
385
WARN_PRINT("Global menus are not supported on this platform.");
386
}
387
388
void NativeMenu::set_item_radio_checkable(const RID &p_rid, int p_idx, bool p_checkable) {
389
WARN_PRINT("Global menus are not supported on this platform.");
390
}
391
392
void NativeMenu::set_item_callback(const RID &p_rid, int p_idx, const Callable &p_callback) {
393
WARN_PRINT("Global menus are not supported on this platform.");
394
}
395
396
void NativeMenu::set_item_key_callback(const RID &p_rid, int p_idx, const Callable &p_key_callback) {
397
WARN_PRINT("Global menus are not supported on this platform.");
398
}
399
400
void NativeMenu::set_item_hover_callbacks(const RID &p_rid, int p_idx, const Callable &p_callback) {
401
WARN_PRINT("Global menus are not supported on this platform.");
402
}
403
404
void NativeMenu::set_item_tag(const RID &p_rid, int p_idx, const Variant &p_tag) {
405
WARN_PRINT("Global menus are not supported on this platform.");
406
}
407
408
void NativeMenu::set_item_text(const RID &p_rid, int p_idx, const String &p_text) {
409
WARN_PRINT("Global menus are not supported on this platform.");
410
}
411
412
void NativeMenu::set_item_submenu(const RID &p_rid, int p_idx, const RID &p_submenu_rid) {
413
WARN_PRINT("Global menus are not supported on this platform.");
414
}
415
416
void NativeMenu::set_item_accelerator(const RID &p_rid, int p_idx, Key p_keycode) {
417
WARN_PRINT("Global menus are not supported on this platform.");
418
}
419
420
void NativeMenu::set_item_disabled(const RID &p_rid, int p_idx, bool p_disabled) {
421
WARN_PRINT("Global menus are not supported on this platform.");
422
}
423
424
void NativeMenu::set_item_hidden(const RID &p_rid, int p_idx, bool p_hidden) {
425
WARN_PRINT("Global menus are not supported on this platform.");
426
}
427
428
void NativeMenu::set_item_tooltip(const RID &p_rid, int p_idx, const String &p_tooltip) {
429
WARN_PRINT("Global menus are not supported on this platform.");
430
}
431
432
void NativeMenu::set_item_state(const RID &p_rid, int p_idx, int p_state) {
433
WARN_PRINT("Global menus are not supported on this platform.");
434
}
435
436
void NativeMenu::set_item_max_states(const RID &p_rid, int p_idx, int p_max_states) {
437
WARN_PRINT("Global menus are not supported on this platform.");
438
}
439
440
void NativeMenu::set_item_icon(const RID &p_rid, int p_idx, const Ref<Texture2D> &p_icon) {
441
WARN_PRINT("Global menus are not supported on this platform.");
442
}
443
444
void NativeMenu::set_item_indentation_level(const RID &p_rid, int p_idx, int p_level) {
445
WARN_PRINT("Global menus are not supported on this platform.");
446
}
447
448
int NativeMenu::set_item_index(const RID &p_rid, int p_idx, int p_target_idx) {
449
WARN_PRINT("Global menus are not supported on this platform.");
450
return -1;
451
}
452
453
int NativeMenu::get_item_count(const RID &p_rid) const {
454
WARN_PRINT("Global menus are not supported on this platform.");
455
return 0;
456
}
457
458
bool NativeMenu::is_system_menu(const RID &p_rid) const {
459
WARN_PRINT("Global menus are not supported on this platform.");
460
return false;
461
}
462
463
void NativeMenu::remove_item(const RID &p_rid, int p_idx) {
464
WARN_PRINT("Global menus are not supported on this platform.");
465
}
466
467
void NativeMenu::clear(const RID &p_rid) {
468
WARN_PRINT("Global menus are not supported on this platform.");
469
}
470
471