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