Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/servers/display_server.cpp
9887 views
1
/**************************************************************************/
2
/* display_server.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 "display_server.h"
32
#include "display_server.compat.inc"
33
34
#include "core/input/input.h"
35
#include "scene/resources/texture.h"
36
#include "servers/display_server_headless.h"
37
38
#if defined(VULKAN_ENABLED)
39
#include "drivers/vulkan/rendering_context_driver_vulkan.h"
40
#undef CursorShape
41
#endif
42
#if defined(D3D12_ENABLED)
43
#include "drivers/d3d12/rendering_context_driver_d3d12.h"
44
#endif
45
#if defined(METAL_ENABLED)
46
#include "drivers/metal/rendering_context_driver_metal.h"
47
#endif
48
49
DisplayServer *DisplayServer::singleton = nullptr;
50
51
DisplayServer::AccessibilityMode DisplayServer::accessibility_mode = DisplayServer::AccessibilityMode::ACCESSIBILITY_AUTO;
52
53
bool DisplayServer::hidpi_allowed = false;
54
55
bool DisplayServer::window_early_clear_override_enabled = false;
56
Color DisplayServer::window_early_clear_override_color = Color(0, 0, 0, 0);
57
58
DisplayServer::DisplayServerCreate DisplayServer::server_create_functions[DisplayServer::MAX_SERVERS] = {
59
{ "headless", &DisplayServerHeadless::create_func, &DisplayServerHeadless::get_rendering_drivers_func }
60
};
61
62
int DisplayServer::server_create_count = 1;
63
64
void DisplayServer::help_set_search_callbacks(const Callable &p_search_callback, const Callable &p_action_callback) {
65
WARN_PRINT("Native help is not supported by this display server.");
66
}
67
68
#ifndef DISABLE_DEPRECATED
69
70
RID DisplayServer::_get_rid_from_name(NativeMenu *p_nmenu, const String &p_menu_root) const {
71
if (p_menu_root == "_main") {
72
return p_nmenu->get_system_menu(NativeMenu::MAIN_MENU_ID);
73
} else if (p_menu_root == "_apple") {
74
return p_nmenu->get_system_menu(NativeMenu::APPLICATION_MENU_ID);
75
} else if (p_menu_root == "_dock") {
76
return p_nmenu->get_system_menu(NativeMenu::DOCK_MENU_ID);
77
} else if (p_menu_root == "_help") {
78
return p_nmenu->get_system_menu(NativeMenu::HELP_MENU_ID);
79
} else if (p_menu_root == "_window") {
80
return p_nmenu->get_system_menu(NativeMenu::WINDOW_MENU_ID);
81
} else if (menu_names.has(p_menu_root)) {
82
return menu_names[p_menu_root];
83
}
84
85
RID rid = p_nmenu->create_menu();
86
menu_names[p_menu_root] = rid;
87
return rid;
88
}
89
90
int DisplayServer::global_menu_add_item(const String &p_menu_root, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
91
NativeMenu *nmenu = NativeMenu::get_singleton();
92
ERR_FAIL_NULL_V(nmenu, -1);
93
return nmenu->add_item(_get_rid_from_name(nmenu, p_menu_root), p_label, p_callback, p_key_callback, p_tag, p_accel, p_index);
94
}
95
96
int DisplayServer::global_menu_add_check_item(const String &p_menu_root, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
97
NativeMenu *nmenu = NativeMenu::get_singleton();
98
ERR_FAIL_NULL_V(nmenu, -1);
99
return nmenu->add_check_item(_get_rid_from_name(nmenu, p_menu_root), p_label, p_callback, p_key_callback, p_tag, p_accel, p_index);
100
}
101
102
int DisplayServer::global_menu_add_icon_item(const String &p_menu_root, 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) {
103
NativeMenu *nmenu = NativeMenu::get_singleton();
104
ERR_FAIL_NULL_V(nmenu, -1);
105
return nmenu->add_icon_item(_get_rid_from_name(nmenu, p_menu_root), p_icon, p_label, p_callback, p_key_callback, p_tag, p_accel, p_index);
106
}
107
108
int DisplayServer::global_menu_add_icon_check_item(const String &p_menu_root, 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) {
109
NativeMenu *nmenu = NativeMenu::get_singleton();
110
ERR_FAIL_NULL_V(nmenu, -1);
111
return nmenu->add_icon_check_item(_get_rid_from_name(nmenu, p_menu_root), p_icon, p_label, p_callback, p_key_callback, p_tag, p_accel, p_index);
112
}
113
114
int DisplayServer::global_menu_add_radio_check_item(const String &p_menu_root, const String &p_label, const Callable &p_callback, const Callable &p_key_callback, const Variant &p_tag, Key p_accel, int p_index) {
115
NativeMenu *nmenu = NativeMenu::get_singleton();
116
ERR_FAIL_NULL_V(nmenu, -1);
117
return nmenu->add_radio_check_item(_get_rid_from_name(nmenu, p_menu_root), p_label, p_callback, p_key_callback, p_tag, p_accel, p_index);
118
}
119
120
int DisplayServer::global_menu_add_icon_radio_check_item(const String &p_menu_root, 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) {
121
NativeMenu *nmenu = NativeMenu::get_singleton();
122
ERR_FAIL_NULL_V(nmenu, -1);
123
return nmenu->add_icon_radio_check_item(_get_rid_from_name(nmenu, p_menu_root), p_icon, p_label, p_callback, p_key_callback, p_tag, p_accel, p_index);
124
}
125
126
int DisplayServer::global_menu_add_multistate_item(const String &p_menu_root, 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) {
127
NativeMenu *nmenu = NativeMenu::get_singleton();
128
ERR_FAIL_NULL_V(nmenu, -1);
129
return nmenu->add_multistate_item(_get_rid_from_name(nmenu, p_menu_root), p_label, p_max_states, p_default_state, p_callback, p_key_callback, p_tag, p_accel, p_index);
130
}
131
132
void DisplayServer::global_menu_set_popup_callbacks(const String &p_menu_root, const Callable &p_open_callback, const Callable &p_close_callback) {
133
NativeMenu *nmenu = NativeMenu::get_singleton();
134
ERR_FAIL_NULL(nmenu);
135
nmenu->set_popup_open_callback(_get_rid_from_name(nmenu, p_menu_root), p_open_callback);
136
nmenu->set_popup_open_callback(_get_rid_from_name(nmenu, p_menu_root), p_close_callback);
137
}
138
139
int DisplayServer::global_menu_add_submenu_item(const String &p_menu_root, const String &p_label, const String &p_submenu, int p_index) {
140
NativeMenu *nmenu = NativeMenu::get_singleton();
141
ERR_FAIL_NULL_V(nmenu, -1);
142
return nmenu->add_submenu_item(_get_rid_from_name(nmenu, p_menu_root), p_label, _get_rid_from_name(nmenu, p_submenu), Variant(), p_index);
143
}
144
145
int DisplayServer::global_menu_add_separator(const String &p_menu_root, int p_index) {
146
NativeMenu *nmenu = NativeMenu::get_singleton();
147
ERR_FAIL_NULL_V(nmenu, -1);
148
return nmenu->add_separator(_get_rid_from_name(nmenu, p_menu_root), p_index);
149
}
150
151
int DisplayServer::global_menu_get_item_index_from_text(const String &p_menu_root, const String &p_text) const {
152
NativeMenu *nmenu = NativeMenu::get_singleton();
153
ERR_FAIL_NULL_V(nmenu, -1);
154
return nmenu->find_item_index_with_text(_get_rid_from_name(nmenu, p_menu_root), p_text);
155
}
156
157
int DisplayServer::global_menu_get_item_index_from_tag(const String &p_menu_root, const Variant &p_tag) const {
158
NativeMenu *nmenu = NativeMenu::get_singleton();
159
ERR_FAIL_NULL_V(nmenu, -1);
160
return nmenu->find_item_index_with_tag(_get_rid_from_name(nmenu, p_menu_root), p_tag);
161
}
162
163
void DisplayServer::global_menu_set_item_callback(const String &p_menu_root, int p_idx, const Callable &p_callback) {
164
NativeMenu *nmenu = NativeMenu::get_singleton();
165
ERR_FAIL_NULL(nmenu);
166
nmenu->set_item_callback(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_callback);
167
}
168
169
void DisplayServer::global_menu_set_item_hover_callbacks(const String &p_menu_root, int p_idx, const Callable &p_callback) {
170
NativeMenu *nmenu = NativeMenu::get_singleton();
171
ERR_FAIL_NULL(nmenu);
172
nmenu->set_item_hover_callbacks(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_callback);
173
}
174
175
void DisplayServer::global_menu_set_item_key_callback(const String &p_menu_root, int p_idx, const Callable &p_key_callback) {
176
NativeMenu *nmenu = NativeMenu::get_singleton();
177
ERR_FAIL_NULL(nmenu);
178
nmenu->set_item_key_callback(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_key_callback);
179
}
180
181
bool DisplayServer::global_menu_is_item_checked(const String &p_menu_root, int p_idx) const {
182
NativeMenu *nmenu = NativeMenu::get_singleton();
183
ERR_FAIL_NULL_V(nmenu, false);
184
return nmenu->is_item_checked(_get_rid_from_name(nmenu, p_menu_root), p_idx);
185
}
186
187
bool DisplayServer::global_menu_is_item_checkable(const String &p_menu_root, int p_idx) const {
188
NativeMenu *nmenu = NativeMenu::get_singleton();
189
ERR_FAIL_NULL_V(nmenu, false);
190
return nmenu->is_item_checkable(_get_rid_from_name(nmenu, p_menu_root), p_idx);
191
}
192
193
bool DisplayServer::global_menu_is_item_radio_checkable(const String &p_menu_root, int p_idx) const {
194
NativeMenu *nmenu = NativeMenu::get_singleton();
195
ERR_FAIL_NULL_V(nmenu, false);
196
return nmenu->is_item_radio_checkable(_get_rid_from_name(nmenu, p_menu_root), p_idx);
197
}
198
199
Callable DisplayServer::global_menu_get_item_callback(const String &p_menu_root, int p_idx) const {
200
NativeMenu *nmenu = NativeMenu::get_singleton();
201
ERR_FAIL_NULL_V(nmenu, Callable());
202
return nmenu->get_item_callback(_get_rid_from_name(nmenu, p_menu_root), p_idx);
203
}
204
205
Callable DisplayServer::global_menu_get_item_key_callback(const String &p_menu_root, int p_idx) const {
206
NativeMenu *nmenu = NativeMenu::get_singleton();
207
ERR_FAIL_NULL_V(nmenu, Callable());
208
return nmenu->get_item_key_callback(_get_rid_from_name(nmenu, p_menu_root), p_idx);
209
}
210
211
Variant DisplayServer::global_menu_get_item_tag(const String &p_menu_root, int p_idx) const {
212
NativeMenu *nmenu = NativeMenu::get_singleton();
213
ERR_FAIL_NULL_V(nmenu, Variant());
214
return nmenu->get_item_tag(_get_rid_from_name(nmenu, p_menu_root), p_idx);
215
}
216
217
String DisplayServer::global_menu_get_item_text(const String &p_menu_root, int p_idx) const {
218
NativeMenu *nmenu = NativeMenu::get_singleton();
219
ERR_FAIL_NULL_V(nmenu, String());
220
return nmenu->get_item_text(_get_rid_from_name(nmenu, p_menu_root), p_idx);
221
}
222
223
String DisplayServer::global_menu_get_item_submenu(const String &p_menu_root, int p_idx) const {
224
NativeMenu *nmenu = NativeMenu::get_singleton();
225
ERR_FAIL_NULL_V(nmenu, String());
226
RID rid = nmenu->get_item_submenu(_get_rid_from_name(nmenu, p_menu_root), p_idx);
227
if (!nmenu->is_system_menu(rid)) {
228
for (HashMap<String, RID>::Iterator E = menu_names.begin(); E; ++E) {
229
if (E->value == rid) {
230
return E->key;
231
}
232
}
233
}
234
return String();
235
}
236
237
Key DisplayServer::global_menu_get_item_accelerator(const String &p_menu_root, int p_idx) const {
238
NativeMenu *nmenu = NativeMenu::get_singleton();
239
ERR_FAIL_NULL_V(nmenu, Key::NONE);
240
return nmenu->get_item_accelerator(_get_rid_from_name(nmenu, p_menu_root), p_idx);
241
}
242
243
bool DisplayServer::global_menu_is_item_disabled(const String &p_menu_root, int p_idx) const {
244
NativeMenu *nmenu = NativeMenu::get_singleton();
245
ERR_FAIL_NULL_V(nmenu, false);
246
return nmenu->is_item_disabled(_get_rid_from_name(nmenu, p_menu_root), p_idx);
247
}
248
249
bool DisplayServer::global_menu_is_item_hidden(const String &p_menu_root, int p_idx) const {
250
NativeMenu *nmenu = NativeMenu::get_singleton();
251
ERR_FAIL_NULL_V(nmenu, false);
252
return nmenu->is_item_hidden(_get_rid_from_name(nmenu, p_menu_root), p_idx);
253
}
254
255
String DisplayServer::global_menu_get_item_tooltip(const String &p_menu_root, int p_idx) const {
256
NativeMenu *nmenu = NativeMenu::get_singleton();
257
ERR_FAIL_NULL_V(nmenu, String());
258
return nmenu->get_item_tooltip(_get_rid_from_name(nmenu, p_menu_root), p_idx);
259
}
260
261
int DisplayServer::global_menu_get_item_state(const String &p_menu_root, int p_idx) const {
262
NativeMenu *nmenu = NativeMenu::get_singleton();
263
ERR_FAIL_NULL_V(nmenu, -1);
264
return nmenu->get_item_state(_get_rid_from_name(nmenu, p_menu_root), p_idx);
265
}
266
267
int DisplayServer::global_menu_get_item_max_states(const String &p_menu_root, int p_idx) const {
268
NativeMenu *nmenu = NativeMenu::get_singleton();
269
ERR_FAIL_NULL_V(nmenu, -1);
270
return nmenu->get_item_max_states(_get_rid_from_name(nmenu, p_menu_root), p_idx);
271
}
272
273
Ref<Texture2D> DisplayServer::global_menu_get_item_icon(const String &p_menu_root, int p_idx) const {
274
NativeMenu *nmenu = NativeMenu::get_singleton();
275
ERR_FAIL_NULL_V(nmenu, Ref<Texture2D>());
276
return nmenu->get_item_icon(_get_rid_from_name(nmenu, p_menu_root), p_idx);
277
}
278
279
int DisplayServer::global_menu_get_item_indentation_level(const String &p_menu_root, int p_idx) const {
280
NativeMenu *nmenu = NativeMenu::get_singleton();
281
ERR_FAIL_NULL_V(nmenu, 0);
282
return nmenu->get_item_indentation_level(_get_rid_from_name(nmenu, p_menu_root), p_idx);
283
}
284
285
void DisplayServer::global_menu_set_item_checked(const String &p_menu_root, int p_idx, bool p_checked) {
286
NativeMenu *nmenu = NativeMenu::get_singleton();
287
ERR_FAIL_NULL(nmenu);
288
nmenu->set_item_checked(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_checked);
289
}
290
291
void DisplayServer::global_menu_set_item_checkable(const String &p_menu_root, int p_idx, bool p_checkable) {
292
NativeMenu *nmenu = NativeMenu::get_singleton();
293
ERR_FAIL_NULL(nmenu);
294
nmenu->set_item_checkable(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_checkable);
295
}
296
297
void DisplayServer::global_menu_set_item_radio_checkable(const String &p_menu_root, int p_idx, bool p_checkable) {
298
NativeMenu *nmenu = NativeMenu::get_singleton();
299
ERR_FAIL_NULL(nmenu);
300
nmenu->set_item_radio_checkable(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_checkable);
301
}
302
303
void DisplayServer::global_menu_set_item_tag(const String &p_menu_root, int p_idx, const Variant &p_tag) {
304
NativeMenu *nmenu = NativeMenu::get_singleton();
305
ERR_FAIL_NULL(nmenu);
306
nmenu->set_item_tag(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_tag);
307
}
308
309
void DisplayServer::global_menu_set_item_text(const String &p_menu_root, int p_idx, const String &p_text) {
310
NativeMenu *nmenu = NativeMenu::get_singleton();
311
ERR_FAIL_NULL(nmenu);
312
nmenu->set_item_text(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_text);
313
}
314
315
void DisplayServer::global_menu_set_item_submenu(const String &p_menu_root, int p_idx, const String &p_submenu) {
316
NativeMenu *nmenu = NativeMenu::get_singleton();
317
ERR_FAIL_NULL(nmenu);
318
nmenu->set_item_submenu(_get_rid_from_name(nmenu, p_menu_root), p_idx, _get_rid_from_name(nmenu, p_submenu));
319
}
320
321
void DisplayServer::global_menu_set_item_accelerator(const String &p_menu_root, int p_idx, Key p_keycode) {
322
NativeMenu *nmenu = NativeMenu::get_singleton();
323
ERR_FAIL_NULL(nmenu);
324
nmenu->set_item_accelerator(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_keycode);
325
}
326
327
void DisplayServer::global_menu_set_item_disabled(const String &p_menu_root, int p_idx, bool p_disabled) {
328
NativeMenu *nmenu = NativeMenu::get_singleton();
329
ERR_FAIL_NULL(nmenu);
330
nmenu->set_item_disabled(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_disabled);
331
}
332
333
void DisplayServer::global_menu_set_item_hidden(const String &p_menu_root, int p_idx, bool p_hidden) {
334
NativeMenu *nmenu = NativeMenu::get_singleton();
335
ERR_FAIL_NULL(nmenu);
336
nmenu->set_item_hidden(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_hidden);
337
}
338
339
void DisplayServer::global_menu_set_item_tooltip(const String &p_menu_root, int p_idx, const String &p_tooltip) {
340
NativeMenu *nmenu = NativeMenu::get_singleton();
341
ERR_FAIL_NULL(nmenu);
342
nmenu->set_item_tooltip(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_tooltip);
343
}
344
345
void DisplayServer::global_menu_set_item_state(const String &p_menu_root, int p_idx, int p_state) {
346
NativeMenu *nmenu = NativeMenu::get_singleton();
347
ERR_FAIL_NULL(nmenu);
348
nmenu->set_item_state(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_state);
349
}
350
351
void DisplayServer::global_menu_set_item_max_states(const String &p_menu_root, int p_idx, int p_max_states) {
352
NativeMenu *nmenu = NativeMenu::get_singleton();
353
ERR_FAIL_NULL(nmenu);
354
nmenu->set_item_max_states(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_max_states);
355
}
356
357
void DisplayServer::global_menu_set_item_icon(const String &p_menu_root, int p_idx, const Ref<Texture2D> &p_icon) {
358
NativeMenu *nmenu = NativeMenu::get_singleton();
359
ERR_FAIL_NULL(nmenu);
360
nmenu->set_item_icon(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_icon);
361
}
362
363
void DisplayServer::global_menu_set_item_indentation_level(const String &p_menu_root, int p_idx, int p_level) {
364
NativeMenu *nmenu = NativeMenu::get_singleton();
365
ERR_FAIL_NULL(nmenu);
366
nmenu->set_item_indentation_level(_get_rid_from_name(nmenu, p_menu_root), p_idx, p_level);
367
}
368
369
int DisplayServer::global_menu_get_item_count(const String &p_menu_root) const {
370
NativeMenu *nmenu = NativeMenu::get_singleton();
371
ERR_FAIL_NULL_V(nmenu, 0);
372
return nmenu->get_item_count(_get_rid_from_name(nmenu, p_menu_root));
373
}
374
375
void DisplayServer::global_menu_remove_item(const String &p_menu_root, int p_idx) {
376
NativeMenu *nmenu = NativeMenu::get_singleton();
377
ERR_FAIL_NULL(nmenu);
378
nmenu->remove_item(_get_rid_from_name(nmenu, p_menu_root), p_idx);
379
}
380
381
void DisplayServer::global_menu_clear(const String &p_menu_root) {
382
NativeMenu *nmenu = NativeMenu::get_singleton();
383
ERR_FAIL_NULL(nmenu);
384
RID rid = _get_rid_from_name(nmenu, p_menu_root);
385
nmenu->clear(rid);
386
if (!nmenu->is_system_menu(rid)) {
387
nmenu->free_menu(rid);
388
menu_names.erase(p_menu_root);
389
}
390
}
391
392
Dictionary DisplayServer::global_menu_get_system_menu_roots() const {
393
NativeMenu *nmenu = NativeMenu::get_singleton();
394
ERR_FAIL_NULL_V(nmenu, Dictionary());
395
396
Dictionary out;
397
if (nmenu->has_system_menu(NativeMenu::DOCK_MENU_ID)) {
398
out["_dock"] = "@Dock";
399
}
400
if (nmenu->has_system_menu(NativeMenu::APPLICATION_MENU_ID)) {
401
out["_apple"] = "@Apple";
402
}
403
if (nmenu->has_system_menu(NativeMenu::WINDOW_MENU_ID)) {
404
out["_window"] = "Window";
405
}
406
if (nmenu->has_system_menu(NativeMenu::HELP_MENU_ID)) {
407
out["_help"] = "Help";
408
}
409
return out;
410
}
411
412
#endif
413
414
bool DisplayServer::tts_is_speaking() const {
415
WARN_PRINT("TTS is not supported by this display server.");
416
return false;
417
}
418
419
bool DisplayServer::tts_is_paused() const {
420
WARN_PRINT("TTS is not supported by this display server.");
421
return false;
422
}
423
424
void DisplayServer::tts_pause() {
425
WARN_PRINT("TTS is not supported by this display server.");
426
}
427
428
void DisplayServer::tts_resume() {
429
WARN_PRINT("TTS is not supported by this display server.");
430
}
431
432
TypedArray<Dictionary> DisplayServer::tts_get_voices() const {
433
WARN_PRINT("TTS is not supported by this display server.");
434
return TypedArray<Dictionary>();
435
}
436
437
PackedStringArray DisplayServer::tts_get_voices_for_language(const String &p_language) const {
438
PackedStringArray ret;
439
TypedArray<Dictionary> voices = tts_get_voices();
440
for (int i = 0; i < voices.size(); i++) {
441
const Dictionary &voice = voices[i];
442
if (voice.has("id") && voice.has("language") && voice["language"].operator String().begins_with(p_language)) {
443
ret.push_back(voice["id"]);
444
}
445
}
446
return ret;
447
}
448
449
void DisplayServer::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) {
450
WARN_PRINT("TTS is not supported by this display server.");
451
}
452
453
void DisplayServer::tts_stop() {
454
WARN_PRINT("TTS is not supported by this display server.");
455
}
456
457
void DisplayServer::tts_set_utterance_callback(TTSUtteranceEvent p_event, const Callable &p_callable) {
458
ERR_FAIL_INDEX(p_event, DisplayServer::TTS_UTTERANCE_MAX);
459
utterance_callback[p_event] = p_callable;
460
}
461
462
void DisplayServer::tts_post_utterance_event(TTSUtteranceEvent p_event, int p_id, int p_pos) {
463
ERR_FAIL_INDEX(p_event, DisplayServer::TTS_UTTERANCE_MAX);
464
switch (p_event) {
465
case DisplayServer::TTS_UTTERANCE_STARTED:
466
case DisplayServer::TTS_UTTERANCE_ENDED:
467
case DisplayServer::TTS_UTTERANCE_CANCELED: {
468
if (utterance_callback[p_event].is_valid()) {
469
utterance_callback[p_event].call_deferred(p_id); // Should be deferred, on some platforms utterance events can be called from different threads in a rapid succession.
470
}
471
} break;
472
case DisplayServer::TTS_UTTERANCE_BOUNDARY: {
473
if (utterance_callback[p_event].is_valid()) {
474
utterance_callback[p_event].call_deferred(p_pos, p_id); // Should be deferred, on some platforms utterance events can be called from different threads in a rapid succession.
475
}
476
} break;
477
default:
478
break;
479
}
480
}
481
482
bool DisplayServer::_get_window_early_clear_override(Color &r_color) {
483
if (window_early_clear_override_enabled) {
484
r_color = window_early_clear_override_color;
485
return true;
486
} else if (RenderingServer::get_singleton()) {
487
r_color = RenderingServer::get_singleton()->get_default_clear_color();
488
return true;
489
} else {
490
return false;
491
}
492
}
493
494
void DisplayServer::set_early_window_clear_color_override(bool p_enabled, Color p_color) {
495
window_early_clear_override_enabled = p_enabled;
496
window_early_clear_override_color = p_color;
497
}
498
499
void DisplayServer::mouse_set_mode(MouseMode p_mode) {
500
WARN_PRINT("Mouse is not supported by this display server.");
501
}
502
503
DisplayServer::MouseMode DisplayServer::mouse_get_mode() const {
504
return MOUSE_MODE_VISIBLE;
505
}
506
507
void DisplayServer::mouse_set_mode_override(MouseMode p_mode) {
508
WARN_PRINT("Mouse is not supported by this display server.");
509
}
510
511
DisplayServer::MouseMode DisplayServer::mouse_get_mode_override() const {
512
return MOUSE_MODE_VISIBLE;
513
}
514
515
void DisplayServer::mouse_set_mode_override_enabled(bool p_override_enabled) {
516
WARN_PRINT("Mouse is not supported by this display server.");
517
}
518
519
bool DisplayServer::mouse_is_mode_override_enabled() const {
520
return false;
521
}
522
523
void DisplayServer::warp_mouse(const Point2i &p_position) {
524
}
525
526
Point2i DisplayServer::mouse_get_position() const {
527
ERR_FAIL_V_MSG(Point2i(), "Mouse is not supported by this display server.");
528
}
529
530
BitField<MouseButtonMask> DisplayServer::mouse_get_button_state() const {
531
ERR_FAIL_V_MSG(MouseButtonMask::NONE, "Mouse is not supported by this display server.");
532
}
533
534
void DisplayServer::clipboard_set(const String &p_text) {
535
WARN_PRINT("Clipboard is not supported by this display server.");
536
}
537
538
String DisplayServer::clipboard_get() const {
539
ERR_FAIL_V_MSG(String(), "Clipboard is not supported by this display server.");
540
}
541
542
Ref<Image> DisplayServer::clipboard_get_image() const {
543
ERR_FAIL_V_MSG(Ref<Image>(), "Clipboard is not supported by this display server.");
544
}
545
546
bool DisplayServer::clipboard_has() const {
547
return !clipboard_get().is_empty();
548
}
549
550
bool DisplayServer::clipboard_has_image() const {
551
return clipboard_get_image().is_valid();
552
}
553
554
void DisplayServer::clipboard_set_primary(const String &p_text) {
555
WARN_PRINT("Primary clipboard is not supported by this display server.");
556
}
557
558
String DisplayServer::clipboard_get_primary() const {
559
ERR_FAIL_V_MSG(String(), "Primary clipboard is not supported by this display server.");
560
}
561
562
void DisplayServer::screen_set_orientation(ScreenOrientation p_orientation, int p_screen) {
563
WARN_PRINT("Orientation not supported by this display server.");
564
}
565
566
DisplayServer::ScreenOrientation DisplayServer::screen_get_orientation(int p_screen) const {
567
return SCREEN_LANDSCAPE;
568
}
569
570
float DisplayServer::screen_get_scale(int p_screen) const {
571
return 1.0f;
572
}
573
574
bool DisplayServer::is_touchscreen_available() const {
575
return Input::get_singleton() && Input::get_singleton()->is_emulating_touch_from_mouse();
576
}
577
578
void DisplayServer::screen_set_keep_on(bool p_enable) {
579
WARN_PRINT("Keeping screen on not supported by this display server.");
580
}
581
582
bool DisplayServer::screen_is_kept_on() const {
583
return false;
584
}
585
586
int DisplayServer::get_screen_from_rect(const Rect2 &p_rect) const {
587
int nearest_area = 0;
588
int pos_screen = INVALID_SCREEN;
589
for (int i = 0; i < get_screen_count(); i++) {
590
Rect2i r;
591
r.position = screen_get_position(i);
592
r.size = screen_get_size(i);
593
Rect2 inters = r.intersection(p_rect);
594
int area = inters.size.width * inters.size.height;
595
if (area > nearest_area) {
596
pos_screen = i;
597
nearest_area = area;
598
}
599
}
600
return pos_screen;
601
}
602
603
DisplayServer::WindowID DisplayServer::create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect, bool p_exclusive, WindowID p_transient_parent) {
604
ERR_FAIL_V_MSG(INVALID_WINDOW_ID, "Sub-windows not supported by this display server.");
605
}
606
607
void DisplayServer::show_window(WindowID p_id) {
608
ERR_FAIL_MSG("Sub-windows not supported by this display server.");
609
}
610
611
void DisplayServer::delete_sub_window(WindowID p_id) {
612
ERR_FAIL_MSG("Sub-windows not supported by this display server.");
613
}
614
615
void DisplayServer::window_set_exclusive(WindowID p_window, bool p_exclusive) {
616
// Do nothing, if not supported.
617
}
618
619
void DisplayServer::window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window) {
620
ERR_FAIL_MSG("Mouse passthrough not supported by this display server.");
621
}
622
623
void DisplayServer::gl_window_make_current(DisplayServer::WindowID p_window_id) {
624
// noop except in gles
625
}
626
627
void DisplayServer::window_set_ime_active(const bool p_active, WindowID p_window) {
628
WARN_PRINT("IME not supported by this display server.");
629
}
630
631
void DisplayServer::window_set_ime_position(const Point2i &p_pos, WindowID p_window) {
632
WARN_PRINT("IME not supported by this display server.");
633
}
634
635
RID DisplayServer::accessibility_create_element(WindowID p_window, DisplayServer::AccessibilityRole p_role) {
636
if (accessibility_driver) {
637
return accessibility_driver->accessibility_create_element(p_window, p_role);
638
} else {
639
return RID();
640
}
641
}
642
643
RID DisplayServer::accessibility_create_sub_element(const RID &p_parent_rid, DisplayServer::AccessibilityRole p_role, int p_insert_pos) {
644
if (accessibility_driver) {
645
return accessibility_driver->accessibility_create_sub_element(p_parent_rid, p_role, p_insert_pos);
646
} else {
647
return RID();
648
}
649
}
650
651
RID DisplayServer::accessibility_create_sub_text_edit_elements(const RID &p_parent_rid, const RID &p_shaped_text, float p_min_height, int p_insert_pos) {
652
if (accessibility_driver) {
653
return accessibility_driver->accessibility_create_sub_text_edit_elements(p_parent_rid, p_shaped_text, p_min_height, p_insert_pos);
654
} else {
655
return RID();
656
}
657
}
658
659
bool DisplayServer::accessibility_has_element(const RID &p_id) const {
660
if (accessibility_driver) {
661
return accessibility_driver->accessibility_has_element(p_id);
662
} else {
663
return false;
664
}
665
}
666
667
void DisplayServer::accessibility_free_element(const RID &p_id) {
668
if (accessibility_driver) {
669
accessibility_driver->accessibility_free_element(p_id);
670
}
671
}
672
673
void DisplayServer::accessibility_element_set_meta(const RID &p_id, const Variant &p_meta) {
674
if (accessibility_driver) {
675
accessibility_driver->accessibility_element_set_meta(p_id, p_meta);
676
}
677
}
678
679
Variant DisplayServer::accessibility_element_get_meta(const RID &p_id) const {
680
if (accessibility_driver) {
681
return accessibility_driver->accessibility_element_get_meta(p_id);
682
} else {
683
return Variant();
684
}
685
}
686
687
void DisplayServer::accessibility_update_if_active(const Callable &p_callable) {
688
if (accessibility_driver) {
689
accessibility_driver->accessibility_update_if_active(p_callable);
690
}
691
}
692
693
void DisplayServer::accessibility_update_set_focus(const RID &p_id) {
694
if (accessibility_driver) {
695
accessibility_driver->accessibility_update_set_focus(p_id);
696
}
697
}
698
699
RID DisplayServer::accessibility_get_window_root(DisplayServer::WindowID p_window_id) const {
700
if (accessibility_driver) {
701
return accessibility_driver->accessibility_get_window_root(p_window_id);
702
} else {
703
return RID();
704
}
705
}
706
707
void DisplayServer::accessibility_set_window_rect(DisplayServer::WindowID p_window_id, const Rect2 &p_rect_out, const Rect2 &p_rect_in) {
708
if (accessibility_driver) {
709
accessibility_driver->accessibility_set_window_rect(p_window_id, p_rect_out, p_rect_in);
710
}
711
}
712
713
void DisplayServer::accessibility_set_window_focused(DisplayServer::WindowID p_window_id, bool p_focused) {
714
if (accessibility_driver) {
715
accessibility_driver->accessibility_set_window_focused(p_window_id, p_focused);
716
}
717
}
718
719
void DisplayServer::accessibility_update_set_role(const RID &p_id, DisplayServer::AccessibilityRole p_role) {
720
if (accessibility_driver) {
721
accessibility_driver->accessibility_update_set_role(p_id, p_role);
722
}
723
}
724
725
void DisplayServer::accessibility_update_set_name(const RID &p_id, const String &p_name) {
726
if (accessibility_driver) {
727
accessibility_driver->accessibility_update_set_name(p_id, p_name);
728
}
729
}
730
731
void DisplayServer::accessibility_update_set_description(const RID &p_id, const String &p_description) {
732
if (accessibility_driver) {
733
accessibility_driver->accessibility_update_set_description(p_id, p_description);
734
}
735
}
736
737
void DisplayServer::accessibility_update_set_extra_info(const RID &p_id, const String &p_name_extra_info) {
738
if (accessibility_driver) {
739
accessibility_driver->accessibility_update_set_extra_info(p_id, p_name_extra_info);
740
}
741
}
742
743
void DisplayServer::accessibility_update_set_value(const RID &p_id, const String &p_value) {
744
if (accessibility_driver) {
745
accessibility_driver->accessibility_update_set_value(p_id, p_value);
746
}
747
}
748
749
void DisplayServer::accessibility_update_set_tooltip(const RID &p_id, const String &p_tooltip) {
750
if (accessibility_driver) {
751
accessibility_driver->accessibility_update_set_tooltip(p_id, p_tooltip);
752
}
753
}
754
755
void DisplayServer::accessibility_update_set_bounds(const RID &p_id, const Rect2 &p_rect) {
756
if (accessibility_driver) {
757
accessibility_driver->accessibility_update_set_bounds(p_id, p_rect);
758
}
759
}
760
761
void DisplayServer::accessibility_update_set_transform(const RID &p_id, const Transform2D &p_transform) {
762
if (accessibility_driver) {
763
accessibility_driver->accessibility_update_set_transform(p_id, p_transform);
764
}
765
}
766
767
void DisplayServer::accessibility_update_add_child(const RID &p_id, const RID &p_child_id) {
768
if (accessibility_driver) {
769
accessibility_driver->accessibility_update_add_child(p_id, p_child_id);
770
}
771
}
772
773
void DisplayServer::accessibility_update_add_related_controls(const RID &p_id, const RID &p_related_id) {
774
if (accessibility_driver) {
775
accessibility_driver->accessibility_update_add_related_controls(p_id, p_related_id);
776
}
777
}
778
779
void DisplayServer::accessibility_update_add_related_details(const RID &p_id, const RID &p_related_id) {
780
if (accessibility_driver) {
781
accessibility_driver->accessibility_update_add_related_details(p_id, p_related_id);
782
}
783
}
784
785
void DisplayServer::accessibility_update_add_related_described_by(const RID &p_id, const RID &p_related_id) {
786
if (accessibility_driver) {
787
accessibility_driver->accessibility_update_add_related_described_by(p_id, p_related_id);
788
}
789
}
790
791
void DisplayServer::accessibility_update_add_related_flow_to(const RID &p_id, const RID &p_related_id) {
792
if (accessibility_driver) {
793
accessibility_driver->accessibility_update_add_related_flow_to(p_id, p_related_id);
794
}
795
}
796
797
void DisplayServer::accessibility_update_add_related_labeled_by(const RID &p_id, const RID &p_related_id) {
798
if (accessibility_driver) {
799
accessibility_driver->accessibility_update_add_related_labeled_by(p_id, p_related_id);
800
}
801
}
802
803
void DisplayServer::accessibility_update_add_related_radio_group(const RID &p_id, const RID &p_related_id) {
804
if (accessibility_driver) {
805
accessibility_driver->accessibility_update_add_related_radio_group(p_id, p_related_id);
806
}
807
}
808
809
void DisplayServer::accessibility_update_set_active_descendant(const RID &p_id, const RID &p_other_id) {
810
if (accessibility_driver) {
811
accessibility_driver->accessibility_update_set_active_descendant(p_id, p_other_id);
812
}
813
}
814
815
void DisplayServer::accessibility_update_set_next_on_line(const RID &p_id, const RID &p_other_id) {
816
if (accessibility_driver) {
817
accessibility_driver->accessibility_update_set_next_on_line(p_id, p_other_id);
818
}
819
}
820
821
void DisplayServer::accessibility_update_set_previous_on_line(const RID &p_id, const RID &p_other_id) {
822
if (accessibility_driver) {
823
accessibility_driver->accessibility_update_set_previous_on_line(p_id, p_other_id);
824
}
825
}
826
827
void DisplayServer::accessibility_update_set_member_of(const RID &p_id, const RID &p_group_id) {
828
if (accessibility_driver) {
829
accessibility_driver->accessibility_update_set_member_of(p_id, p_group_id);
830
}
831
}
832
833
void DisplayServer::accessibility_update_set_in_page_link_target(const RID &p_id, const RID &p_other_id) {
834
if (accessibility_driver) {
835
accessibility_driver->accessibility_update_set_in_page_link_target(p_id, p_other_id);
836
}
837
}
838
839
void DisplayServer::accessibility_update_set_error_message(const RID &p_id, const RID &p_other_id) {
840
if (accessibility_driver) {
841
accessibility_driver->accessibility_update_set_error_message(p_id, p_other_id);
842
}
843
}
844
845
void DisplayServer::accessibility_update_set_live(const RID &p_id, DisplayServer::AccessibilityLiveMode p_live) {
846
if (accessibility_driver) {
847
accessibility_driver->accessibility_update_set_live(p_id, p_live);
848
}
849
}
850
851
void DisplayServer::accessibility_update_add_action(const RID &p_id, DisplayServer::AccessibilityAction p_action, const Callable &p_callable) {
852
if (accessibility_driver) {
853
accessibility_driver->accessibility_update_add_action(p_id, p_action, p_callable);
854
}
855
}
856
857
void DisplayServer::accessibility_update_add_custom_action(const RID &p_id, int p_action_id, const String &p_action_description) {
858
if (accessibility_driver) {
859
accessibility_driver->accessibility_update_add_custom_action(p_id, p_action_id, p_action_description);
860
}
861
}
862
863
void DisplayServer::accessibility_update_set_table_row_count(const RID &p_id, int p_count) {
864
if (accessibility_driver) {
865
accessibility_driver->accessibility_update_set_table_row_count(p_id, p_count);
866
}
867
}
868
869
void DisplayServer::accessibility_update_set_table_column_count(const RID &p_id, int p_count) {
870
if (accessibility_driver) {
871
accessibility_driver->accessibility_update_set_table_column_count(p_id, p_count);
872
}
873
}
874
875
void DisplayServer::accessibility_update_set_table_row_index(const RID &p_id, int p_index) {
876
if (accessibility_driver) {
877
accessibility_driver->accessibility_update_set_table_row_index(p_id, p_index);
878
}
879
}
880
881
void DisplayServer::accessibility_update_set_table_column_index(const RID &p_id, int p_index) {
882
if (accessibility_driver) {
883
accessibility_driver->accessibility_update_set_table_column_index(p_id, p_index);
884
}
885
}
886
887
void DisplayServer::accessibility_update_set_table_cell_position(const RID &p_id, int p_row_index, int p_column_index) {
888
if (accessibility_driver) {
889
accessibility_driver->accessibility_update_set_table_cell_position(p_id, p_row_index, p_column_index);
890
}
891
}
892
893
void DisplayServer::accessibility_update_set_table_cell_span(const RID &p_id, int p_row_span, int p_column_span) {
894
if (accessibility_driver) {
895
accessibility_driver->accessibility_update_set_table_cell_span(p_id, p_row_span, p_column_span);
896
}
897
}
898
899
void DisplayServer::accessibility_update_set_list_item_count(const RID &p_id, int p_size) {
900
if (accessibility_driver) {
901
accessibility_driver->accessibility_update_set_list_item_count(p_id, p_size);
902
}
903
}
904
905
void DisplayServer::accessibility_update_set_list_item_index(const RID &p_id, int p_index) {
906
if (accessibility_driver) {
907
accessibility_driver->accessibility_update_set_list_item_index(p_id, p_index);
908
}
909
}
910
911
void DisplayServer::accessibility_update_set_list_item_level(const RID &p_id, int p_level) {
912
if (accessibility_driver) {
913
accessibility_driver->accessibility_update_set_list_item_level(p_id, p_level);
914
}
915
}
916
917
void DisplayServer::accessibility_update_set_list_item_selected(const RID &p_id, bool p_selected) {
918
if (accessibility_driver) {
919
accessibility_driver->accessibility_update_set_list_item_selected(p_id, p_selected);
920
}
921
}
922
923
void DisplayServer::accessibility_update_set_list_item_expanded(const RID &p_id, bool p_expanded) {
924
if (accessibility_driver) {
925
accessibility_driver->accessibility_update_set_list_item_expanded(p_id, p_expanded);
926
}
927
}
928
929
void DisplayServer::accessibility_update_set_popup_type(const RID &p_id, DisplayServer::AccessibilityPopupType p_popup) {
930
if (accessibility_driver) {
931
accessibility_driver->accessibility_update_set_popup_type(p_id, p_popup);
932
}
933
}
934
935
void DisplayServer::accessibility_update_set_checked(const RID &p_id, bool p_checekd) {
936
if (accessibility_driver) {
937
accessibility_driver->accessibility_update_set_checked(p_id, p_checekd);
938
}
939
}
940
941
void DisplayServer::accessibility_update_set_num_value(const RID &p_id, double p_position) {
942
if (accessibility_driver) {
943
accessibility_driver->accessibility_update_set_num_value(p_id, p_position);
944
}
945
}
946
947
void DisplayServer::accessibility_update_set_num_range(const RID &p_id, double p_min, double p_max) {
948
if (accessibility_driver) {
949
accessibility_driver->accessibility_update_set_num_range(p_id, p_min, p_max);
950
}
951
}
952
953
void DisplayServer::accessibility_update_set_num_step(const RID &p_id, double p_step) {
954
if (accessibility_driver) {
955
accessibility_driver->accessibility_update_set_num_step(p_id, p_step);
956
}
957
}
958
959
void DisplayServer::accessibility_update_set_num_jump(const RID &p_id, double p_jump) {
960
if (accessibility_driver) {
961
accessibility_driver->accessibility_update_set_num_jump(p_id, p_jump);
962
}
963
}
964
965
void DisplayServer::accessibility_update_set_scroll_x(const RID &p_id, double p_position) {
966
if (accessibility_driver) {
967
accessibility_driver->accessibility_update_set_scroll_x(p_id, p_position);
968
}
969
}
970
971
void DisplayServer::accessibility_update_set_scroll_x_range(const RID &p_id, double p_min, double p_max) {
972
if (accessibility_driver) {
973
accessibility_driver->accessibility_update_set_scroll_x_range(p_id, p_min, p_max);
974
}
975
}
976
977
void DisplayServer::accessibility_update_set_scroll_y(const RID &p_id, double p_position) {
978
if (accessibility_driver) {
979
accessibility_driver->accessibility_update_set_scroll_y(p_id, p_position);
980
}
981
}
982
983
void DisplayServer::accessibility_update_set_scroll_y_range(const RID &p_id, double p_min, double p_max) {
984
if (accessibility_driver) {
985
accessibility_driver->accessibility_update_set_scroll_y_range(p_id, p_min, p_max);
986
}
987
}
988
989
void DisplayServer::accessibility_update_set_text_decorations(const RID &p_id, bool p_underline, bool p_strikethrough, bool p_overline) {
990
if (accessibility_driver) {
991
accessibility_driver->accessibility_update_set_text_decorations(p_id, p_underline, p_strikethrough, p_overline);
992
}
993
}
994
995
void DisplayServer::accessibility_update_set_text_align(const RID &p_id, HorizontalAlignment p_align) {
996
if (accessibility_driver) {
997
accessibility_driver->accessibility_update_set_text_align(p_id, p_align);
998
}
999
}
1000
1001
void DisplayServer::accessibility_update_set_text_selection(const RID &p_id, const RID &p_text_start_id, int p_start_char, const RID &p_text_end_id, int p_end_char) {
1002
if (accessibility_driver) {
1003
accessibility_driver->accessibility_update_set_text_selection(p_id, p_text_start_id, p_start_char, p_text_end_id, p_end_char);
1004
}
1005
}
1006
1007
void DisplayServer::accessibility_update_set_flag(const RID &p_id, DisplayServer::AccessibilityFlags p_flag, bool p_value) {
1008
if (accessibility_driver) {
1009
accessibility_driver->accessibility_update_set_flag(p_id, p_flag, p_value);
1010
}
1011
}
1012
1013
void DisplayServer::accessibility_update_set_classname(const RID &p_id, const String &p_classname) {
1014
if (accessibility_driver) {
1015
accessibility_driver->accessibility_update_set_classname(p_id, p_classname);
1016
}
1017
}
1018
1019
void DisplayServer::accessibility_update_set_placeholder(const RID &p_id, const String &p_placeholder) {
1020
if (accessibility_driver) {
1021
accessibility_driver->accessibility_update_set_placeholder(p_id, p_placeholder);
1022
}
1023
}
1024
1025
void DisplayServer::accessibility_update_set_language(const RID &p_id, const String &p_language) {
1026
if (accessibility_driver) {
1027
accessibility_driver->accessibility_update_set_language(p_id, p_language);
1028
}
1029
}
1030
1031
void DisplayServer::accessibility_update_set_text_orientation(const RID &p_id, bool p_vertical) {
1032
if (accessibility_driver) {
1033
accessibility_driver->accessibility_update_set_text_orientation(p_id, p_vertical);
1034
}
1035
}
1036
1037
void DisplayServer::accessibility_update_set_list_orientation(const RID &p_id, bool p_vertical) {
1038
if (accessibility_driver) {
1039
accessibility_driver->accessibility_update_set_list_orientation(p_id, p_vertical);
1040
}
1041
}
1042
1043
void DisplayServer::accessibility_update_set_shortcut(const RID &p_id, const String &p_shortcut) {
1044
if (accessibility_driver) {
1045
accessibility_driver->accessibility_update_set_shortcut(p_id, p_shortcut);
1046
}
1047
}
1048
1049
void DisplayServer::accessibility_update_set_url(const RID &p_id, const String &p_url) {
1050
if (accessibility_driver) {
1051
accessibility_driver->accessibility_update_set_url(p_id, p_url);
1052
}
1053
}
1054
1055
void DisplayServer::accessibility_update_set_role_description(const RID &p_id, const String &p_description) {
1056
if (accessibility_driver) {
1057
accessibility_driver->accessibility_update_set_role_description(p_id, p_description);
1058
}
1059
}
1060
1061
void DisplayServer::accessibility_update_set_state_description(const RID &p_id, const String &p_description) {
1062
if (accessibility_driver) {
1063
accessibility_driver->accessibility_update_set_state_description(p_id, p_description);
1064
}
1065
}
1066
1067
void DisplayServer::accessibility_update_set_color_value(const RID &p_id, const Color &p_color) {
1068
if (accessibility_driver) {
1069
accessibility_driver->accessibility_update_set_color_value(p_id, p_color);
1070
}
1071
}
1072
1073
void DisplayServer::accessibility_update_set_background_color(const RID &p_id, const Color &p_color) {
1074
if (accessibility_driver) {
1075
accessibility_driver->accessibility_update_set_background_color(p_id, p_color);
1076
}
1077
}
1078
1079
void DisplayServer::accessibility_update_set_foreground_color(const RID &p_id, const Color &p_color) {
1080
if (accessibility_driver) {
1081
accessibility_driver->accessibility_update_set_foreground_color(p_id, p_color);
1082
}
1083
}
1084
1085
Point2i DisplayServer::ime_get_selection() const {
1086
ERR_FAIL_V_MSG(Point2i(), "IME or NOTIFICATION_WM_IME_UPDATE not supported by this display server.");
1087
}
1088
1089
String DisplayServer::ime_get_text() const {
1090
ERR_FAIL_V_MSG(String(), "IME or NOTIFICATION_WM_IME_UPDATE not supported by this display server.");
1091
}
1092
1093
void DisplayServer::virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect, VirtualKeyboardType p_type, int p_max_length, int p_cursor_start, int p_cursor_end) {
1094
WARN_PRINT("Virtual keyboard not supported by this display server.");
1095
}
1096
1097
void DisplayServer::virtual_keyboard_hide() {
1098
WARN_PRINT("Virtual keyboard not supported by this display server.");
1099
}
1100
1101
// returns height of the currently shown keyboard (0 if keyboard is hidden)
1102
int DisplayServer::virtual_keyboard_get_height() const {
1103
WARN_PRINT("Virtual keyboard not supported by this display server.");
1104
return 0;
1105
}
1106
1107
bool DisplayServer::has_hardware_keyboard() const {
1108
return true;
1109
}
1110
1111
void DisplayServer::cursor_set_shape(CursorShape p_shape) {
1112
WARN_PRINT("Cursor shape not supported by this display server.");
1113
}
1114
1115
DisplayServer::CursorShape DisplayServer::cursor_get_shape() const {
1116
return CURSOR_ARROW;
1117
}
1118
1119
void DisplayServer::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
1120
WARN_PRINT("Custom cursor shape not supported by this display server.");
1121
}
1122
1123
bool DisplayServer::get_swap_cancel_ok() {
1124
return false;
1125
}
1126
1127
void DisplayServer::enable_for_stealing_focus(OS::ProcessID pid) {
1128
}
1129
1130
Error DisplayServer::embed_process(WindowID p_window, OS::ProcessID p_pid, const Rect2i &p_rect, bool p_visible, bool p_grab_focus) {
1131
WARN_PRINT("Embedded process not supported by this display server.");
1132
return ERR_UNAVAILABLE;
1133
}
1134
1135
Error DisplayServer::request_close_embedded_process(OS::ProcessID p_pid) {
1136
WARN_PRINT("Embedded process not supported by this display server.");
1137
return ERR_UNAVAILABLE;
1138
}
1139
1140
Error DisplayServer::remove_embedded_process(OS::ProcessID p_pid) {
1141
WARN_PRINT("Embedded process not supported by this display server.");
1142
return ERR_UNAVAILABLE;
1143
}
1144
1145
OS::ProcessID DisplayServer::get_focused_process_id() {
1146
WARN_PRINT("Embedded process not supported by this display server.");
1147
return 0;
1148
}
1149
1150
Error DisplayServer::dialog_show(String p_title, String p_description, Vector<String> p_buttons, const Callable &p_callback) {
1151
WARN_PRINT("Native dialogs not supported by this display server.");
1152
return ERR_UNAVAILABLE;
1153
}
1154
1155
Error DisplayServer::dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) {
1156
WARN_PRINT("Native dialogs not supported by this display server.");
1157
return ERR_UNAVAILABLE;
1158
}
1159
1160
Error DisplayServer::file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback, WindowID p_window_id) {
1161
WARN_PRINT("Native dialogs not supported by this display server.");
1162
return ERR_UNAVAILABLE;
1163
}
1164
1165
Error DisplayServer::file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, WindowID p_window_id) {
1166
WARN_PRINT("Native dialogs not supported by this display server.");
1167
return ERR_UNAVAILABLE;
1168
}
1169
1170
void DisplayServer::beep() const {
1171
}
1172
1173
int DisplayServer::keyboard_get_layout_count() const {
1174
return 0;
1175
}
1176
1177
int DisplayServer::keyboard_get_current_layout() const {
1178
return -1;
1179
}
1180
1181
void DisplayServer::keyboard_set_current_layout(int p_index) {
1182
}
1183
1184
String DisplayServer::keyboard_get_layout_language(int p_index) const {
1185
return "";
1186
}
1187
1188
String DisplayServer::keyboard_get_layout_name(int p_index) const {
1189
return "Not supported";
1190
}
1191
1192
Key DisplayServer::keyboard_get_keycode_from_physical(Key p_keycode) const {
1193
ERR_FAIL_V_MSG(p_keycode, "Not supported by this display server.");
1194
}
1195
1196
Key DisplayServer::keyboard_get_label_from_physical(Key p_keycode) const {
1197
ERR_FAIL_V_MSG(p_keycode, "Not supported by this display server.");
1198
}
1199
1200
void DisplayServer::show_emoji_and_symbol_picker() const {
1201
}
1202
1203
bool DisplayServer::color_picker(const Callable &p_callback) {
1204
return false;
1205
}
1206
1207
void DisplayServer::force_process_and_drop_events() {
1208
}
1209
1210
void DisplayServer::release_rendering_thread() {
1211
WARN_PRINT("Rendering thread not supported by this display server.");
1212
}
1213
1214
void DisplayServer::swap_buffers() {
1215
WARN_PRINT("Swap buffers not supported by this display server.");
1216
}
1217
1218
void DisplayServer::set_native_icon(const String &p_filename) {
1219
WARN_PRINT("Native icon not supported by this display server.");
1220
}
1221
1222
void DisplayServer::set_icon(const Ref<Image> &p_icon) {
1223
WARN_PRINT("Icon not supported by this display server.");
1224
}
1225
1226
DisplayServer::IndicatorID DisplayServer::create_status_indicator(const Ref<Texture2D> &p_icon, const String &p_tooltip, const Callable &p_callback) {
1227
WARN_PRINT("Status indicator not supported by this display server.");
1228
return INVALID_INDICATOR_ID;
1229
}
1230
1231
void DisplayServer::status_indicator_set_icon(IndicatorID p_id, const Ref<Texture2D> &p_icon) {
1232
WARN_PRINT("Status indicator not supported by this display server.");
1233
}
1234
1235
void DisplayServer::status_indicator_set_tooltip(IndicatorID p_id, const String &p_tooltip) {
1236
WARN_PRINT("Status indicator not supported by this display server.");
1237
}
1238
1239
void DisplayServer::status_indicator_set_menu(IndicatorID p_id, const RID &p_menu_rid) {
1240
WARN_PRINT("Status indicator not supported by this display server.");
1241
}
1242
1243
void DisplayServer::status_indicator_set_callback(IndicatorID p_id, const Callable &p_callback) {
1244
WARN_PRINT("Status indicator not supported by this display server.");
1245
}
1246
1247
Rect2 DisplayServer::status_indicator_get_rect(IndicatorID p_id) const {
1248
WARN_PRINT("Status indicator not supported by this display server.");
1249
return Rect2();
1250
}
1251
1252
void DisplayServer::delete_status_indicator(IndicatorID p_id) {
1253
WARN_PRINT("Status indicator not supported by this display server.");
1254
}
1255
1256
int64_t DisplayServer::window_get_native_handle(HandleType p_handle_type, WindowID p_window) const {
1257
WARN_PRINT("Native handle not supported by this display server.");
1258
return 0;
1259
}
1260
1261
void DisplayServer::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) {
1262
WARN_PRINT("Changing the V-Sync mode is not supported by this display server.");
1263
}
1264
1265
DisplayServer::VSyncMode DisplayServer::window_get_vsync_mode(WindowID p_window) const {
1266
WARN_PRINT("Changing the V-Sync mode is not supported by this display server.");
1267
return VSyncMode::VSYNC_ENABLED;
1268
}
1269
1270
DisplayServer::WindowID DisplayServer::get_focused_window() const {
1271
return MAIN_WINDOW_ID; // Proper value for single windows.
1272
}
1273
1274
void DisplayServer::set_context(Context p_context) {
1275
}
1276
1277
void DisplayServer::register_additional_output(Object *p_object) {
1278
ObjectID id = p_object->get_instance_id();
1279
if (!additional_outputs.has(id)) {
1280
additional_outputs.push_back(id);
1281
}
1282
}
1283
1284
void DisplayServer::unregister_additional_output(Object *p_object) {
1285
additional_outputs.erase(p_object->get_instance_id());
1286
}
1287
1288
void DisplayServer::_bind_methods() {
1289
ClassDB::bind_method(D_METHOD("has_feature", "feature"), &DisplayServer::has_feature);
1290
ClassDB::bind_method(D_METHOD("get_name"), &DisplayServer::get_name);
1291
1292
ClassDB::bind_method(D_METHOD("help_set_search_callbacks", "search_callback", "action_callback"), &DisplayServer::help_set_search_callbacks);
1293
1294
#ifndef DISABLE_DEPRECATED
1295
ClassDB::bind_method(D_METHOD("global_menu_set_popup_callbacks", "menu_root", "open_callback", "close_callback"), &DisplayServer::global_menu_set_popup_callbacks);
1296
ClassDB::bind_method(D_METHOD("global_menu_add_submenu_item", "menu_root", "label", "submenu", "index"), &DisplayServer::global_menu_add_submenu_item, DEFVAL(-1));
1297
ClassDB::bind_method(D_METHOD("global_menu_add_item", "menu_root", "label", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1298
ClassDB::bind_method(D_METHOD("global_menu_add_check_item", "menu_root", "label", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1299
ClassDB::bind_method(D_METHOD("global_menu_add_icon_item", "menu_root", "icon", "label", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_icon_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1300
ClassDB::bind_method(D_METHOD("global_menu_add_icon_check_item", "menu_root", "icon", "label", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_icon_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1301
ClassDB::bind_method(D_METHOD("global_menu_add_radio_check_item", "menu_root", "label", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_radio_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1302
ClassDB::bind_method(D_METHOD("global_menu_add_icon_radio_check_item", "menu_root", "icon", "label", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_icon_radio_check_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1303
ClassDB::bind_method(D_METHOD("global_menu_add_multistate_item", "menu_root", "label", "max_states", "default_state", "callback", "key_callback", "tag", "accelerator", "index"), &DisplayServer::global_menu_add_multistate_item, DEFVAL(Callable()), DEFVAL(Callable()), DEFVAL(Variant()), DEFVAL(Key::NONE), DEFVAL(-1));
1304
ClassDB::bind_method(D_METHOD("global_menu_add_separator", "menu_root", "index"), &DisplayServer::global_menu_add_separator, DEFVAL(-1));
1305
1306
ClassDB::bind_method(D_METHOD("global_menu_get_item_index_from_text", "menu_root", "text"), &DisplayServer::global_menu_get_item_index_from_text);
1307
ClassDB::bind_method(D_METHOD("global_menu_get_item_index_from_tag", "menu_root", "tag"), &DisplayServer::global_menu_get_item_index_from_tag);
1308
1309
ClassDB::bind_method(D_METHOD("global_menu_is_item_checked", "menu_root", "idx"), &DisplayServer::global_menu_is_item_checked);
1310
ClassDB::bind_method(D_METHOD("global_menu_is_item_checkable", "menu_root", "idx"), &DisplayServer::global_menu_is_item_checkable);
1311
ClassDB::bind_method(D_METHOD("global_menu_is_item_radio_checkable", "menu_root", "idx"), &DisplayServer::global_menu_is_item_radio_checkable);
1312
ClassDB::bind_method(D_METHOD("global_menu_get_item_callback", "menu_root", "idx"), &DisplayServer::global_menu_get_item_callback);
1313
ClassDB::bind_method(D_METHOD("global_menu_get_item_key_callback", "menu_root", "idx"), &DisplayServer::global_menu_get_item_key_callback);
1314
ClassDB::bind_method(D_METHOD("global_menu_get_item_tag", "menu_root", "idx"), &DisplayServer::global_menu_get_item_tag);
1315
ClassDB::bind_method(D_METHOD("global_menu_get_item_text", "menu_root", "idx"), &DisplayServer::global_menu_get_item_text);
1316
ClassDB::bind_method(D_METHOD("global_menu_get_item_submenu", "menu_root", "idx"), &DisplayServer::global_menu_get_item_submenu);
1317
ClassDB::bind_method(D_METHOD("global_menu_get_item_accelerator", "menu_root", "idx"), &DisplayServer::global_menu_get_item_accelerator);
1318
ClassDB::bind_method(D_METHOD("global_menu_is_item_disabled", "menu_root", "idx"), &DisplayServer::global_menu_is_item_disabled);
1319
ClassDB::bind_method(D_METHOD("global_menu_is_item_hidden", "menu_root", "idx"), &DisplayServer::global_menu_is_item_hidden);
1320
ClassDB::bind_method(D_METHOD("global_menu_get_item_tooltip", "menu_root", "idx"), &DisplayServer::global_menu_get_item_tooltip);
1321
ClassDB::bind_method(D_METHOD("global_menu_get_item_state", "menu_root", "idx"), &DisplayServer::global_menu_get_item_state);
1322
ClassDB::bind_method(D_METHOD("global_menu_get_item_max_states", "menu_root", "idx"), &DisplayServer::global_menu_get_item_max_states);
1323
ClassDB::bind_method(D_METHOD("global_menu_get_item_icon", "menu_root", "idx"), &DisplayServer::global_menu_get_item_icon);
1324
ClassDB::bind_method(D_METHOD("global_menu_get_item_indentation_level", "menu_root", "idx"), &DisplayServer::global_menu_get_item_indentation_level);
1325
1326
ClassDB::bind_method(D_METHOD("global_menu_set_item_checked", "menu_root", "idx", "checked"), &DisplayServer::global_menu_set_item_checked);
1327
ClassDB::bind_method(D_METHOD("global_menu_set_item_checkable", "menu_root", "idx", "checkable"), &DisplayServer::global_menu_set_item_checkable);
1328
ClassDB::bind_method(D_METHOD("global_menu_set_item_radio_checkable", "menu_root", "idx", "checkable"), &DisplayServer::global_menu_set_item_radio_checkable);
1329
ClassDB::bind_method(D_METHOD("global_menu_set_item_callback", "menu_root", "idx", "callback"), &DisplayServer::global_menu_set_item_callback);
1330
ClassDB::bind_method(D_METHOD("global_menu_set_item_hover_callbacks", "menu_root", "idx", "callback"), &DisplayServer::global_menu_set_item_hover_callbacks);
1331
ClassDB::bind_method(D_METHOD("global_menu_set_item_key_callback", "menu_root", "idx", "key_callback"), &DisplayServer::global_menu_set_item_key_callback);
1332
ClassDB::bind_method(D_METHOD("global_menu_set_item_tag", "menu_root", "idx", "tag"), &DisplayServer::global_menu_set_item_tag);
1333
ClassDB::bind_method(D_METHOD("global_menu_set_item_text", "menu_root", "idx", "text"), &DisplayServer::global_menu_set_item_text);
1334
ClassDB::bind_method(D_METHOD("global_menu_set_item_submenu", "menu_root", "idx", "submenu"), &DisplayServer::global_menu_set_item_submenu);
1335
ClassDB::bind_method(D_METHOD("global_menu_set_item_accelerator", "menu_root", "idx", "keycode"), &DisplayServer::global_menu_set_item_accelerator);
1336
ClassDB::bind_method(D_METHOD("global_menu_set_item_disabled", "menu_root", "idx", "disabled"), &DisplayServer::global_menu_set_item_disabled);
1337
ClassDB::bind_method(D_METHOD("global_menu_set_item_hidden", "menu_root", "idx", "hidden"), &DisplayServer::global_menu_set_item_hidden);
1338
ClassDB::bind_method(D_METHOD("global_menu_set_item_tooltip", "menu_root", "idx", "tooltip"), &DisplayServer::global_menu_set_item_tooltip);
1339
ClassDB::bind_method(D_METHOD("global_menu_set_item_state", "menu_root", "idx", "state"), &DisplayServer::global_menu_set_item_state);
1340
ClassDB::bind_method(D_METHOD("global_menu_set_item_max_states", "menu_root", "idx", "max_states"), &DisplayServer::global_menu_set_item_max_states);
1341
ClassDB::bind_method(D_METHOD("global_menu_set_item_icon", "menu_root", "idx", "icon"), &DisplayServer::global_menu_set_item_icon);
1342
ClassDB::bind_method(D_METHOD("global_menu_set_item_indentation_level", "menu_root", "idx", "level"), &DisplayServer::global_menu_set_item_indentation_level);
1343
1344
ClassDB::bind_method(D_METHOD("global_menu_get_item_count", "menu_root"), &DisplayServer::global_menu_get_item_count);
1345
1346
ClassDB::bind_method(D_METHOD("global_menu_remove_item", "menu_root", "idx"), &DisplayServer::global_menu_remove_item);
1347
ClassDB::bind_method(D_METHOD("global_menu_clear", "menu_root"), &DisplayServer::global_menu_clear);
1348
1349
ClassDB::bind_method(D_METHOD("global_menu_get_system_menu_roots"), &DisplayServer::global_menu_get_system_menu_roots);
1350
#endif
1351
1352
ClassDB::bind_method(D_METHOD("tts_is_speaking"), &DisplayServer::tts_is_speaking);
1353
ClassDB::bind_method(D_METHOD("tts_is_paused"), &DisplayServer::tts_is_paused);
1354
ClassDB::bind_method(D_METHOD("tts_get_voices"), &DisplayServer::tts_get_voices);
1355
ClassDB::bind_method(D_METHOD("tts_get_voices_for_language", "language"), &DisplayServer::tts_get_voices_for_language);
1356
1357
ClassDB::bind_method(D_METHOD("tts_speak", "text", "voice", "volume", "pitch", "rate", "utterance_id", "interrupt"), &DisplayServer::tts_speak, DEFVAL(50), DEFVAL(1.f), DEFVAL(1.f), DEFVAL(0), DEFVAL(false));
1358
ClassDB::bind_method(D_METHOD("tts_pause"), &DisplayServer::tts_pause);
1359
ClassDB::bind_method(D_METHOD("tts_resume"), &DisplayServer::tts_resume);
1360
ClassDB::bind_method(D_METHOD("tts_stop"), &DisplayServer::tts_stop);
1361
1362
ClassDB::bind_method(D_METHOD("tts_set_utterance_callback", "event", "callable"), &DisplayServer::tts_set_utterance_callback);
1363
ClassDB::bind_method(D_METHOD("_tts_post_utterance_event", "event", "id", "char_pos"), &DisplayServer::tts_post_utterance_event);
1364
1365
ClassDB::bind_method(D_METHOD("is_dark_mode_supported"), &DisplayServer::is_dark_mode_supported);
1366
ClassDB::bind_method(D_METHOD("is_dark_mode"), &DisplayServer::is_dark_mode);
1367
ClassDB::bind_method(D_METHOD("get_accent_color"), &DisplayServer::get_accent_color);
1368
ClassDB::bind_method(D_METHOD("get_base_color"), &DisplayServer::get_base_color);
1369
ClassDB::bind_method(D_METHOD("set_system_theme_change_callback", "callable"), &DisplayServer::set_system_theme_change_callback);
1370
1371
ClassDB::bind_method(D_METHOD("mouse_set_mode", "mouse_mode"), &DisplayServer::mouse_set_mode);
1372
ClassDB::bind_method(D_METHOD("mouse_get_mode"), &DisplayServer::mouse_get_mode);
1373
1374
ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &DisplayServer::warp_mouse);
1375
ClassDB::bind_method(D_METHOD("mouse_get_position"), &DisplayServer::mouse_get_position);
1376
ClassDB::bind_method(D_METHOD("mouse_get_button_state"), &DisplayServer::mouse_get_button_state);
1377
1378
ClassDB::bind_method(D_METHOD("clipboard_set", "clipboard"), &DisplayServer::clipboard_set);
1379
ClassDB::bind_method(D_METHOD("clipboard_get"), &DisplayServer::clipboard_get);
1380
ClassDB::bind_method(D_METHOD("clipboard_get_image"), &DisplayServer::clipboard_get_image);
1381
ClassDB::bind_method(D_METHOD("clipboard_has"), &DisplayServer::clipboard_has);
1382
ClassDB::bind_method(D_METHOD("clipboard_has_image"), &DisplayServer::clipboard_has_image);
1383
ClassDB::bind_method(D_METHOD("clipboard_set_primary", "clipboard_primary"), &DisplayServer::clipboard_set_primary);
1384
ClassDB::bind_method(D_METHOD("clipboard_get_primary"), &DisplayServer::clipboard_get_primary);
1385
1386
ClassDB::bind_method(D_METHOD("get_display_cutouts"), &DisplayServer::get_display_cutouts);
1387
ClassDB::bind_method(D_METHOD("get_display_safe_area"), &DisplayServer::get_display_safe_area);
1388
1389
ClassDB::bind_method(D_METHOD("get_screen_count"), &DisplayServer::get_screen_count);
1390
ClassDB::bind_method(D_METHOD("get_primary_screen"), &DisplayServer::get_primary_screen);
1391
ClassDB::bind_method(D_METHOD("get_keyboard_focus_screen"), &DisplayServer::get_keyboard_focus_screen);
1392
ClassDB::bind_method(D_METHOD("get_screen_from_rect", "rect"), &DisplayServer::get_screen_from_rect);
1393
ClassDB::bind_method(D_METHOD("screen_get_position", "screen"), &DisplayServer::screen_get_position, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1394
ClassDB::bind_method(D_METHOD("screen_get_size", "screen"), &DisplayServer::screen_get_size, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1395
ClassDB::bind_method(D_METHOD("screen_get_usable_rect", "screen"), &DisplayServer::screen_get_usable_rect, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1396
ClassDB::bind_method(D_METHOD("screen_get_dpi", "screen"), &DisplayServer::screen_get_dpi, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1397
ClassDB::bind_method(D_METHOD("screen_get_scale", "screen"), &DisplayServer::screen_get_scale, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1398
ClassDB::bind_method(D_METHOD("is_touchscreen_available"), &DisplayServer::is_touchscreen_available);
1399
ClassDB::bind_method(D_METHOD("screen_get_max_scale"), &DisplayServer::screen_get_max_scale);
1400
ClassDB::bind_method(D_METHOD("screen_get_refresh_rate", "screen"), &DisplayServer::screen_get_refresh_rate, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1401
ClassDB::bind_method(D_METHOD("screen_get_pixel", "position"), &DisplayServer::screen_get_pixel);
1402
ClassDB::bind_method(D_METHOD("screen_get_image", "screen"), &DisplayServer::screen_get_image, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1403
ClassDB::bind_method(D_METHOD("screen_get_image_rect", "rect"), &DisplayServer::screen_get_image_rect);
1404
1405
ClassDB::bind_method(D_METHOD("screen_set_orientation", "orientation", "screen"), &DisplayServer::screen_set_orientation, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1406
ClassDB::bind_method(D_METHOD("screen_get_orientation", "screen"), &DisplayServer::screen_get_orientation, DEFVAL(SCREEN_OF_MAIN_WINDOW));
1407
1408
ClassDB::bind_method(D_METHOD("screen_set_keep_on", "enable"), &DisplayServer::screen_set_keep_on);
1409
ClassDB::bind_method(D_METHOD("screen_is_kept_on"), &DisplayServer::screen_is_kept_on);
1410
1411
ClassDB::bind_method(D_METHOD("get_window_list"), &DisplayServer::get_window_list);
1412
ClassDB::bind_method(D_METHOD("get_window_at_screen_position", "position"), &DisplayServer::get_window_at_screen_position);
1413
1414
ClassDB::bind_method(D_METHOD("window_get_native_handle", "handle_type", "window_id"), &DisplayServer::window_get_native_handle, DEFVAL(MAIN_WINDOW_ID));
1415
ClassDB::bind_method(D_METHOD("window_get_active_popup"), &DisplayServer::window_get_active_popup);
1416
ClassDB::bind_method(D_METHOD("window_set_popup_safe_rect", "window", "rect"), &DisplayServer::window_set_popup_safe_rect);
1417
ClassDB::bind_method(D_METHOD("window_get_popup_safe_rect", "window"), &DisplayServer::window_get_popup_safe_rect);
1418
1419
ClassDB::bind_method(D_METHOD("window_set_title", "title", "window_id"), &DisplayServer::window_set_title, DEFVAL(MAIN_WINDOW_ID));
1420
ClassDB::bind_method(D_METHOD("window_get_title_size", "title", "window_id"), &DisplayServer::window_get_title_size, DEFVAL(MAIN_WINDOW_ID));
1421
ClassDB::bind_method(D_METHOD("window_set_mouse_passthrough", "region", "window_id"), &DisplayServer::window_set_mouse_passthrough, DEFVAL(MAIN_WINDOW_ID));
1422
1423
ClassDB::bind_method(D_METHOD("window_get_current_screen", "window_id"), &DisplayServer::window_get_current_screen, DEFVAL(MAIN_WINDOW_ID));
1424
ClassDB::bind_method(D_METHOD("window_set_current_screen", "screen", "window_id"), &DisplayServer::window_set_current_screen, DEFVAL(MAIN_WINDOW_ID));
1425
1426
ClassDB::bind_method(D_METHOD("window_get_position", "window_id"), &DisplayServer::window_get_position, DEFVAL(MAIN_WINDOW_ID));
1427
ClassDB::bind_method(D_METHOD("window_get_position_with_decorations", "window_id"), &DisplayServer::window_get_position_with_decorations, DEFVAL(MAIN_WINDOW_ID));
1428
ClassDB::bind_method(D_METHOD("window_set_position", "position", "window_id"), &DisplayServer::window_set_position, DEFVAL(MAIN_WINDOW_ID));
1429
1430
ClassDB::bind_method(D_METHOD("window_get_size", "window_id"), &DisplayServer::window_get_size, DEFVAL(MAIN_WINDOW_ID));
1431
ClassDB::bind_method(D_METHOD("window_set_size", "size", "window_id"), &DisplayServer::window_set_size, DEFVAL(MAIN_WINDOW_ID));
1432
ClassDB::bind_method(D_METHOD("window_set_rect_changed_callback", "callback", "window_id"), &DisplayServer::window_set_rect_changed_callback, DEFVAL(MAIN_WINDOW_ID));
1433
ClassDB::bind_method(D_METHOD("window_set_window_event_callback", "callback", "window_id"), &DisplayServer::window_set_window_event_callback, DEFVAL(MAIN_WINDOW_ID));
1434
ClassDB::bind_method(D_METHOD("window_set_input_event_callback", "callback", "window_id"), &DisplayServer::window_set_input_event_callback, DEFVAL(MAIN_WINDOW_ID));
1435
ClassDB::bind_method(D_METHOD("window_set_input_text_callback", "callback", "window_id"), &DisplayServer::window_set_input_text_callback, DEFVAL(MAIN_WINDOW_ID));
1436
ClassDB::bind_method(D_METHOD("window_set_drop_files_callback", "callback", "window_id"), &DisplayServer::window_set_drop_files_callback, DEFVAL(MAIN_WINDOW_ID));
1437
1438
ClassDB::bind_method(D_METHOD("window_get_attached_instance_id", "window_id"), &DisplayServer::window_get_attached_instance_id, DEFVAL(MAIN_WINDOW_ID));
1439
1440
ClassDB::bind_method(D_METHOD("window_get_max_size", "window_id"), &DisplayServer::window_get_max_size, DEFVAL(MAIN_WINDOW_ID));
1441
ClassDB::bind_method(D_METHOD("window_set_max_size", "max_size", "window_id"), &DisplayServer::window_set_max_size, DEFVAL(MAIN_WINDOW_ID));
1442
1443
ClassDB::bind_method(D_METHOD("window_get_min_size", "window_id"), &DisplayServer::window_get_min_size, DEFVAL(MAIN_WINDOW_ID));
1444
ClassDB::bind_method(D_METHOD("window_set_min_size", "min_size", "window_id"), &DisplayServer::window_set_min_size, DEFVAL(MAIN_WINDOW_ID));
1445
1446
ClassDB::bind_method(D_METHOD("window_get_size_with_decorations", "window_id"), &DisplayServer::window_get_size_with_decorations, DEFVAL(MAIN_WINDOW_ID));
1447
1448
ClassDB::bind_method(D_METHOD("window_get_mode", "window_id"), &DisplayServer::window_get_mode, DEFVAL(MAIN_WINDOW_ID));
1449
ClassDB::bind_method(D_METHOD("window_set_mode", "mode", "window_id"), &DisplayServer::window_set_mode, DEFVAL(MAIN_WINDOW_ID));
1450
1451
ClassDB::bind_method(D_METHOD("window_set_flag", "flag", "enabled", "window_id"), &DisplayServer::window_set_flag, DEFVAL(MAIN_WINDOW_ID));
1452
ClassDB::bind_method(D_METHOD("window_get_flag", "flag", "window_id"), &DisplayServer::window_get_flag, DEFVAL(MAIN_WINDOW_ID));
1453
1454
ClassDB::bind_method(D_METHOD("window_set_window_buttons_offset", "offset", "window_id"), &DisplayServer::window_set_window_buttons_offset, DEFVAL(MAIN_WINDOW_ID));
1455
ClassDB::bind_method(D_METHOD("window_get_safe_title_margins", "window_id"), &DisplayServer::window_get_safe_title_margins, DEFVAL(MAIN_WINDOW_ID));
1456
1457
ClassDB::bind_method(D_METHOD("window_request_attention", "window_id"), &DisplayServer::window_request_attention, DEFVAL(MAIN_WINDOW_ID));
1458
1459
ClassDB::bind_method(D_METHOD("window_move_to_foreground", "window_id"), &DisplayServer::window_move_to_foreground, DEFVAL(MAIN_WINDOW_ID));
1460
ClassDB::bind_method(D_METHOD("window_is_focused", "window_id"), &DisplayServer::window_is_focused, DEFVAL(MAIN_WINDOW_ID));
1461
ClassDB::bind_method(D_METHOD("window_can_draw", "window_id"), &DisplayServer::window_can_draw, DEFVAL(MAIN_WINDOW_ID));
1462
1463
ClassDB::bind_method(D_METHOD("window_set_transient", "window_id", "parent_window_id"), &DisplayServer::window_set_transient);
1464
ClassDB::bind_method(D_METHOD("window_set_exclusive", "window_id", "exclusive"), &DisplayServer::window_set_exclusive);
1465
1466
ClassDB::bind_method(D_METHOD("window_set_ime_active", "active", "window_id"), &DisplayServer::window_set_ime_active, DEFVAL(MAIN_WINDOW_ID));
1467
ClassDB::bind_method(D_METHOD("window_set_ime_position", "position", "window_id"), &DisplayServer::window_set_ime_position, DEFVAL(MAIN_WINDOW_ID));
1468
1469
ClassDB::bind_method(D_METHOD("window_set_vsync_mode", "vsync_mode", "window_id"), &DisplayServer::window_set_vsync_mode, DEFVAL(MAIN_WINDOW_ID));
1470
ClassDB::bind_method(D_METHOD("window_get_vsync_mode", "window_id"), &DisplayServer::window_get_vsync_mode, DEFVAL(MAIN_WINDOW_ID));
1471
1472
ClassDB::bind_method(D_METHOD("window_is_maximize_allowed", "window_id"), &DisplayServer::window_is_maximize_allowed, DEFVAL(MAIN_WINDOW_ID));
1473
ClassDB::bind_method(D_METHOD("window_maximize_on_title_dbl_click"), &DisplayServer::window_maximize_on_title_dbl_click);
1474
ClassDB::bind_method(D_METHOD("window_minimize_on_title_dbl_click"), &DisplayServer::window_minimize_on_title_dbl_click);
1475
1476
ClassDB::bind_method(D_METHOD("window_start_drag", "window_id"), &DisplayServer::window_start_drag, DEFVAL(MAIN_WINDOW_ID));
1477
ClassDB::bind_method(D_METHOD("window_start_resize", "edge", "window_id"), &DisplayServer::window_start_resize, DEFVAL(MAIN_WINDOW_ID));
1478
1479
ClassDB::bind_method(D_METHOD("accessibility_should_increase_contrast"), &DisplayServer::accessibility_should_increase_contrast);
1480
ClassDB::bind_method(D_METHOD("accessibility_should_reduce_animation"), &DisplayServer::accessibility_should_reduce_animation);
1481
ClassDB::bind_method(D_METHOD("accessibility_should_reduce_transparency"), &DisplayServer::accessibility_should_reduce_transparency);
1482
ClassDB::bind_method(D_METHOD("accessibility_screen_reader_active"), &DisplayServer::accessibility_screen_reader_active);
1483
1484
ClassDB::bind_method(D_METHOD("accessibility_create_element", "window_id", "role"), &DisplayServer::accessibility_create_element);
1485
ClassDB::bind_method(D_METHOD("accessibility_create_sub_element", "parent_rid", "role", "insert_pos"), &DisplayServer::accessibility_create_sub_element, DEFVAL(-1));
1486
ClassDB::bind_method(D_METHOD("accessibility_create_sub_text_edit_elements", "parent_rid", "shaped_text", "min_height", "insert_pos"), &DisplayServer::accessibility_create_sub_text_edit_elements, DEFVAL(-1));
1487
ClassDB::bind_method(D_METHOD("accessibility_has_element", "id"), &DisplayServer::accessibility_has_element);
1488
ClassDB::bind_method(D_METHOD("accessibility_free_element", "id"), &DisplayServer::accessibility_free_element);
1489
ClassDB::bind_method(D_METHOD("accessibility_element_set_meta", "id", "meta"), &DisplayServer::accessibility_element_set_meta);
1490
ClassDB::bind_method(D_METHOD("accessibility_element_get_meta", "id"), &DisplayServer::accessibility_element_get_meta);
1491
1492
ClassDB::bind_method(D_METHOD("_accessibility_update_if_active", "callback"), &DisplayServer::accessibility_update_if_active);
1493
1494
ClassDB::bind_method(D_METHOD("accessibility_set_window_rect", "window_id", "rect_out", "rect_in"), &DisplayServer::accessibility_set_window_rect);
1495
ClassDB::bind_method(D_METHOD("accessibility_set_window_focused", "window_id", "focused"), &DisplayServer::accessibility_set_window_focused);
1496
1497
ClassDB::bind_method(D_METHOD("accessibility_update_set_focus", "id"), &DisplayServer::accessibility_update_set_focus);
1498
ClassDB::bind_method(D_METHOD("accessibility_get_window_root", "window_id"), &DisplayServer::accessibility_get_window_root);
1499
ClassDB::bind_method(D_METHOD("accessibility_update_set_role", "id", "role"), &DisplayServer::accessibility_update_set_role);
1500
ClassDB::bind_method(D_METHOD("accessibility_update_set_name", "id", "name"), &DisplayServer::accessibility_update_set_name);
1501
ClassDB::bind_method(D_METHOD("accessibility_update_set_extra_info", "id", "name"), &DisplayServer::accessibility_update_set_extra_info);
1502
ClassDB::bind_method(D_METHOD("accessibility_update_set_description", "id", "description"), &DisplayServer::accessibility_update_set_description);
1503
ClassDB::bind_method(D_METHOD("accessibility_update_set_value", "id", "value"), &DisplayServer::accessibility_update_set_value);
1504
ClassDB::bind_method(D_METHOD("accessibility_update_set_tooltip", "id", "tooltip"), &DisplayServer::accessibility_update_set_tooltip);
1505
ClassDB::bind_method(D_METHOD("accessibility_update_set_bounds", "id", "p_rect"), &DisplayServer::accessibility_update_set_bounds);
1506
ClassDB::bind_method(D_METHOD("accessibility_update_set_transform", "id", "transform"), &DisplayServer::accessibility_update_set_transform);
1507
ClassDB::bind_method(D_METHOD("accessibility_update_add_child", "id", "child_id"), &DisplayServer::accessibility_update_add_child);
1508
ClassDB::bind_method(D_METHOD("accessibility_update_add_related_controls", "id", "related_id"), &DisplayServer::accessibility_update_add_related_controls);
1509
ClassDB::bind_method(D_METHOD("accessibility_update_add_related_details", "id", "related_id"), &DisplayServer::accessibility_update_add_related_details);
1510
ClassDB::bind_method(D_METHOD("accessibility_update_add_related_described_by", "id", "related_id"), &DisplayServer::accessibility_update_add_related_described_by);
1511
ClassDB::bind_method(D_METHOD("accessibility_update_add_related_flow_to", "id", "related_id"), &DisplayServer::accessibility_update_add_related_flow_to);
1512
ClassDB::bind_method(D_METHOD("accessibility_update_add_related_labeled_by", "id", "related_id"), &DisplayServer::accessibility_update_add_related_labeled_by);
1513
ClassDB::bind_method(D_METHOD("accessibility_update_add_related_radio_group", "id", "related_id"), &DisplayServer::accessibility_update_add_related_radio_group);
1514
ClassDB::bind_method(D_METHOD("accessibility_update_set_active_descendant", "id", "other_id"), &DisplayServer::accessibility_update_set_active_descendant);
1515
ClassDB::bind_method(D_METHOD("accessibility_update_set_next_on_line", "id", "other_id"), &DisplayServer::accessibility_update_set_next_on_line);
1516
ClassDB::bind_method(D_METHOD("accessibility_update_set_previous_on_line", "id", "other_id"), &DisplayServer::accessibility_update_set_previous_on_line);
1517
ClassDB::bind_method(D_METHOD("accessibility_update_set_member_of", "id", "group_id"), &DisplayServer::accessibility_update_set_member_of);
1518
ClassDB::bind_method(D_METHOD("accessibility_update_set_in_page_link_target", "id", "other_id"), &DisplayServer::accessibility_update_set_in_page_link_target);
1519
ClassDB::bind_method(D_METHOD("accessibility_update_set_error_message", "id", "other_id"), &DisplayServer::accessibility_update_set_error_message);
1520
ClassDB::bind_method(D_METHOD("accessibility_update_set_live", "id", "live"), &DisplayServer::accessibility_update_set_live);
1521
ClassDB::bind_method(D_METHOD("accessibility_update_add_action", "id", "action", "callable"), &DisplayServer::accessibility_update_add_action);
1522
ClassDB::bind_method(D_METHOD("accessibility_update_add_custom_action", "id", "action_id", "action_description"), &DisplayServer::accessibility_update_add_custom_action);
1523
ClassDB::bind_method(D_METHOD("accessibility_update_set_table_row_count", "id", "count"), &DisplayServer::accessibility_update_set_table_row_count);
1524
ClassDB::bind_method(D_METHOD("accessibility_update_set_table_column_count", "id", "count"), &DisplayServer::accessibility_update_set_table_column_count);
1525
ClassDB::bind_method(D_METHOD("accessibility_update_set_table_row_index", "id", "index"), &DisplayServer::accessibility_update_set_table_row_index);
1526
ClassDB::bind_method(D_METHOD("accessibility_update_set_table_column_index", "id", "index"), &DisplayServer::accessibility_update_set_table_column_index);
1527
ClassDB::bind_method(D_METHOD("accessibility_update_set_table_cell_position", "id", "row_index", "column_index"), &DisplayServer::accessibility_update_set_table_cell_position);
1528
ClassDB::bind_method(D_METHOD("accessibility_update_set_table_cell_span", "id", "row_span", "column_span"), &DisplayServer::accessibility_update_set_table_cell_span);
1529
ClassDB::bind_method(D_METHOD("accessibility_update_set_list_item_count", "id", "size"), &DisplayServer::accessibility_update_set_list_item_count);
1530
ClassDB::bind_method(D_METHOD("accessibility_update_set_list_item_index", "id", "index"), &DisplayServer::accessibility_update_set_list_item_index);
1531
ClassDB::bind_method(D_METHOD("accessibility_update_set_list_item_level", "id", "level"), &DisplayServer::accessibility_update_set_list_item_level);
1532
ClassDB::bind_method(D_METHOD("accessibility_update_set_list_item_selected", "id", "selected"), &DisplayServer::accessibility_update_set_list_item_selected);
1533
ClassDB::bind_method(D_METHOD("accessibility_update_set_list_item_expanded", "id", "expanded"), &DisplayServer::accessibility_update_set_list_item_expanded);
1534
ClassDB::bind_method(D_METHOD("accessibility_update_set_popup_type", "id", "popup"), &DisplayServer::accessibility_update_set_popup_type);
1535
ClassDB::bind_method(D_METHOD("accessibility_update_set_checked", "id", "checekd"), &DisplayServer::accessibility_update_set_checked);
1536
ClassDB::bind_method(D_METHOD("accessibility_update_set_num_value", "id", "position"), &DisplayServer::accessibility_update_set_num_value);
1537
ClassDB::bind_method(D_METHOD("accessibility_update_set_num_range", "id", "min", "max"), &DisplayServer::accessibility_update_set_num_range);
1538
ClassDB::bind_method(D_METHOD("accessibility_update_set_num_step", "id", "step"), &DisplayServer::accessibility_update_set_num_step);
1539
ClassDB::bind_method(D_METHOD("accessibility_update_set_num_jump", "id", "jump"), &DisplayServer::accessibility_update_set_num_jump);
1540
ClassDB::bind_method(D_METHOD("accessibility_update_set_scroll_x", "id", "position"), &DisplayServer::accessibility_update_set_scroll_x);
1541
ClassDB::bind_method(D_METHOD("accessibility_update_set_scroll_x_range", "id", "min", "max"), &DisplayServer::accessibility_update_set_scroll_x_range);
1542
ClassDB::bind_method(D_METHOD("accessibility_update_set_scroll_y", "id", "position"), &DisplayServer::accessibility_update_set_scroll_y);
1543
ClassDB::bind_method(D_METHOD("accessibility_update_set_scroll_y_range", "id", "min", "max"), &DisplayServer::accessibility_update_set_scroll_y_range);
1544
ClassDB::bind_method(D_METHOD("accessibility_update_set_text_decorations", "id", "underline", "strikethrough", "overline"), &DisplayServer::accessibility_update_set_text_decorations);
1545
ClassDB::bind_method(D_METHOD("accessibility_update_set_text_align", "id", "align"), &DisplayServer::accessibility_update_set_text_align);
1546
ClassDB::bind_method(D_METHOD("accessibility_update_set_text_selection", "id", "text_start_id", "start_char", "text_end_id", "end_char"), &DisplayServer::accessibility_update_set_text_selection);
1547
ClassDB::bind_method(D_METHOD("accessibility_update_set_flag", "id", "flag", "value"), &DisplayServer::accessibility_update_set_flag);
1548
ClassDB::bind_method(D_METHOD("accessibility_update_set_classname", "id", "classname"), &DisplayServer::accessibility_update_set_classname);
1549
ClassDB::bind_method(D_METHOD("accessibility_update_set_placeholder", "id", "placeholder"), &DisplayServer::accessibility_update_set_placeholder);
1550
ClassDB::bind_method(D_METHOD("accessibility_update_set_language", "id", "language"), &DisplayServer::accessibility_update_set_language);
1551
ClassDB::bind_method(D_METHOD("accessibility_update_set_text_orientation", "id", "vertical"), &DisplayServer::accessibility_update_set_text_orientation);
1552
ClassDB::bind_method(D_METHOD("accessibility_update_set_list_orientation", "id", "vertical"), &DisplayServer::accessibility_update_set_list_orientation);
1553
ClassDB::bind_method(D_METHOD("accessibility_update_set_shortcut", "id", "shortcut"), &DisplayServer::accessibility_update_set_shortcut);
1554
ClassDB::bind_method(D_METHOD("accessibility_update_set_url", "id", "url"), &DisplayServer::accessibility_update_set_url);
1555
ClassDB::bind_method(D_METHOD("accessibility_update_set_role_description", "id", "description"), &DisplayServer::accessibility_update_set_role_description);
1556
ClassDB::bind_method(D_METHOD("accessibility_update_set_state_description", "id", "description"), &DisplayServer::accessibility_update_set_state_description);
1557
ClassDB::bind_method(D_METHOD("accessibility_update_set_color_value", "id", "color"), &DisplayServer::accessibility_update_set_color_value);
1558
ClassDB::bind_method(D_METHOD("accessibility_update_set_background_color", "id", "color"), &DisplayServer::accessibility_update_set_background_color);
1559
ClassDB::bind_method(D_METHOD("accessibility_update_set_foreground_color", "id", "color"), &DisplayServer::accessibility_update_set_foreground_color);
1560
1561
ClassDB::bind_method(D_METHOD("ime_get_selection"), &DisplayServer::ime_get_selection);
1562
ClassDB::bind_method(D_METHOD("ime_get_text"), &DisplayServer::ime_get_text);
1563
1564
ClassDB::bind_method(D_METHOD("virtual_keyboard_show", "existing_text", "position", "type", "max_length", "cursor_start", "cursor_end"), &DisplayServer::virtual_keyboard_show, DEFVAL(Rect2()), DEFVAL(KEYBOARD_TYPE_DEFAULT), DEFVAL(-1), DEFVAL(-1), DEFVAL(-1));
1565
ClassDB::bind_method(D_METHOD("virtual_keyboard_hide"), &DisplayServer::virtual_keyboard_hide);
1566
1567
ClassDB::bind_method(D_METHOD("virtual_keyboard_get_height"), &DisplayServer::virtual_keyboard_get_height);
1568
1569
ClassDB::bind_method(D_METHOD("has_hardware_keyboard"), &DisplayServer::has_hardware_keyboard);
1570
ClassDB::bind_method(D_METHOD("set_hardware_keyboard_connection_change_callback", "callable"), &DisplayServer::set_hardware_keyboard_connection_change_callback);
1571
1572
ClassDB::bind_method(D_METHOD("cursor_set_shape", "shape"), &DisplayServer::cursor_set_shape);
1573
ClassDB::bind_method(D_METHOD("cursor_get_shape"), &DisplayServer::cursor_get_shape);
1574
ClassDB::bind_method(D_METHOD("cursor_set_custom_image", "cursor", "shape", "hotspot"), &DisplayServer::cursor_set_custom_image, DEFVAL(CURSOR_ARROW), DEFVAL(Vector2()));
1575
1576
ClassDB::bind_method(D_METHOD("get_swap_cancel_ok"), &DisplayServer::get_swap_cancel_ok);
1577
1578
ClassDB::bind_method(D_METHOD("enable_for_stealing_focus", "process_id"), &DisplayServer::enable_for_stealing_focus);
1579
1580
ClassDB::bind_method(D_METHOD("dialog_show", "title", "description", "buttons", "callback"), &DisplayServer::dialog_show);
1581
ClassDB::bind_method(D_METHOD("dialog_input_text", "title", "description", "existing_text", "callback"), &DisplayServer::dialog_input_text);
1582
1583
ClassDB::bind_method(D_METHOD("file_dialog_show", "title", "current_directory", "filename", "show_hidden", "mode", "filters", "callback", "parent_window_id"), &DisplayServer::file_dialog_show, DEFVAL(MAIN_WINDOW_ID));
1584
ClassDB::bind_method(D_METHOD("file_dialog_with_options_show", "title", "current_directory", "root", "filename", "show_hidden", "mode", "filters", "options", "callback", "parent_window_id"), &DisplayServer::file_dialog_with_options_show, DEFVAL(MAIN_WINDOW_ID));
1585
1586
ClassDB::bind_method(D_METHOD("beep"), &DisplayServer::beep);
1587
1588
ClassDB::bind_method(D_METHOD("keyboard_get_layout_count"), &DisplayServer::keyboard_get_layout_count);
1589
ClassDB::bind_method(D_METHOD("keyboard_get_current_layout"), &DisplayServer::keyboard_get_current_layout);
1590
ClassDB::bind_method(D_METHOD("keyboard_set_current_layout", "index"), &DisplayServer::keyboard_set_current_layout);
1591
ClassDB::bind_method(D_METHOD("keyboard_get_layout_language", "index"), &DisplayServer::keyboard_get_layout_language);
1592
ClassDB::bind_method(D_METHOD("keyboard_get_layout_name", "index"), &DisplayServer::keyboard_get_layout_name);
1593
ClassDB::bind_method(D_METHOD("keyboard_get_keycode_from_physical", "keycode"), &DisplayServer::keyboard_get_keycode_from_physical);
1594
ClassDB::bind_method(D_METHOD("keyboard_get_label_from_physical", "keycode"), &DisplayServer::keyboard_get_label_from_physical);
1595
1596
ClassDB::bind_method(D_METHOD("show_emoji_and_symbol_picker"), &DisplayServer::show_emoji_and_symbol_picker);
1597
ClassDB::bind_method(D_METHOD("color_picker", "callback"), &DisplayServer::color_picker);
1598
1599
ClassDB::bind_method(D_METHOD("process_events"), &DisplayServer::process_events);
1600
ClassDB::bind_method(D_METHOD("force_process_and_drop_events"), &DisplayServer::force_process_and_drop_events);
1601
1602
ClassDB::bind_method(D_METHOD("set_native_icon", "filename"), &DisplayServer::set_native_icon);
1603
ClassDB::bind_method(D_METHOD("set_icon", "image"), &DisplayServer::set_icon);
1604
1605
ClassDB::bind_method(D_METHOD("create_status_indicator", "icon", "tooltip", "callback"), &DisplayServer::create_status_indicator);
1606
ClassDB::bind_method(D_METHOD("status_indicator_set_icon", "id", "icon"), &DisplayServer::status_indicator_set_icon);
1607
ClassDB::bind_method(D_METHOD("status_indicator_set_tooltip", "id", "tooltip"), &DisplayServer::status_indicator_set_tooltip);
1608
ClassDB::bind_method(D_METHOD("status_indicator_set_menu", "id", "menu_rid"), &DisplayServer::status_indicator_set_menu);
1609
ClassDB::bind_method(D_METHOD("status_indicator_set_callback", "id", "callback"), &DisplayServer::status_indicator_set_callback);
1610
ClassDB::bind_method(D_METHOD("status_indicator_get_rect", "id"), &DisplayServer::status_indicator_get_rect);
1611
ClassDB::bind_method(D_METHOD("delete_status_indicator", "id"), &DisplayServer::delete_status_indicator);
1612
1613
ClassDB::bind_method(D_METHOD("tablet_get_driver_count"), &DisplayServer::tablet_get_driver_count);
1614
ClassDB::bind_method(D_METHOD("tablet_get_driver_name", "idx"), &DisplayServer::tablet_get_driver_name);
1615
ClassDB::bind_method(D_METHOD("tablet_get_current_driver"), &DisplayServer::tablet_get_current_driver);
1616
ClassDB::bind_method(D_METHOD("tablet_set_current_driver", "name"), &DisplayServer::tablet_set_current_driver);
1617
1618
ClassDB::bind_method(D_METHOD("is_window_transparency_available"), &DisplayServer::is_window_transparency_available);
1619
1620
ClassDB::bind_method(D_METHOD("register_additional_output", "object"), &DisplayServer::register_additional_output);
1621
ClassDB::bind_method(D_METHOD("unregister_additional_output", "object"), &DisplayServer::unregister_additional_output);
1622
ClassDB::bind_method(D_METHOD("has_additional_outputs"), &DisplayServer::has_additional_outputs);
1623
1624
#ifndef DISABLE_DEPRECATED
1625
BIND_ENUM_CONSTANT(FEATURE_GLOBAL_MENU);
1626
#endif
1627
BIND_ENUM_CONSTANT(FEATURE_SUBWINDOWS);
1628
BIND_ENUM_CONSTANT(FEATURE_TOUCHSCREEN);
1629
BIND_ENUM_CONSTANT(FEATURE_MOUSE);
1630
BIND_ENUM_CONSTANT(FEATURE_MOUSE_WARP);
1631
BIND_ENUM_CONSTANT(FEATURE_CLIPBOARD);
1632
BIND_ENUM_CONSTANT(FEATURE_VIRTUAL_KEYBOARD);
1633
BIND_ENUM_CONSTANT(FEATURE_CURSOR_SHAPE);
1634
BIND_ENUM_CONSTANT(FEATURE_CUSTOM_CURSOR_SHAPE);
1635
BIND_ENUM_CONSTANT(FEATURE_NATIVE_DIALOG);
1636
BIND_ENUM_CONSTANT(FEATURE_IME);
1637
BIND_ENUM_CONSTANT(FEATURE_WINDOW_TRANSPARENCY);
1638
BIND_ENUM_CONSTANT(FEATURE_HIDPI);
1639
BIND_ENUM_CONSTANT(FEATURE_ICON);
1640
BIND_ENUM_CONSTANT(FEATURE_NATIVE_ICON);
1641
BIND_ENUM_CONSTANT(FEATURE_ORIENTATION);
1642
BIND_ENUM_CONSTANT(FEATURE_SWAP_BUFFERS);
1643
BIND_ENUM_CONSTANT(FEATURE_CLIPBOARD_PRIMARY);
1644
BIND_ENUM_CONSTANT(FEATURE_TEXT_TO_SPEECH);
1645
BIND_ENUM_CONSTANT(FEATURE_EXTEND_TO_TITLE);
1646
BIND_ENUM_CONSTANT(FEATURE_SCREEN_CAPTURE);
1647
BIND_ENUM_CONSTANT(FEATURE_STATUS_INDICATOR);
1648
BIND_ENUM_CONSTANT(FEATURE_NATIVE_HELP);
1649
BIND_ENUM_CONSTANT(FEATURE_NATIVE_DIALOG_INPUT);
1650
BIND_ENUM_CONSTANT(FEATURE_NATIVE_DIALOG_FILE);
1651
BIND_ENUM_CONSTANT(FEATURE_NATIVE_DIALOG_FILE_EXTRA);
1652
BIND_ENUM_CONSTANT(FEATURE_WINDOW_DRAG);
1653
BIND_ENUM_CONSTANT(FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE);
1654
BIND_ENUM_CONSTANT(FEATURE_WINDOW_EMBEDDING);
1655
BIND_ENUM_CONSTANT(FEATURE_NATIVE_DIALOG_FILE_MIME);
1656
BIND_ENUM_CONSTANT(FEATURE_EMOJI_AND_SYMBOL_PICKER);
1657
BIND_ENUM_CONSTANT(FEATURE_NATIVE_COLOR_PICKER);
1658
BIND_ENUM_CONSTANT(FEATURE_SELF_FITTING_WINDOWS);
1659
BIND_ENUM_CONSTANT(FEATURE_ACCESSIBILITY_SCREEN_READER);
1660
1661
BIND_ENUM_CONSTANT(ROLE_UNKNOWN);
1662
BIND_ENUM_CONSTANT(ROLE_DEFAULT_BUTTON);
1663
BIND_ENUM_CONSTANT(ROLE_AUDIO);
1664
BIND_ENUM_CONSTANT(ROLE_VIDEO);
1665
BIND_ENUM_CONSTANT(ROLE_STATIC_TEXT);
1666
BIND_ENUM_CONSTANT(ROLE_CONTAINER);
1667
BIND_ENUM_CONSTANT(ROLE_PANEL);
1668
BIND_ENUM_CONSTANT(ROLE_BUTTON);
1669
BIND_ENUM_CONSTANT(ROLE_LINK);
1670
BIND_ENUM_CONSTANT(ROLE_CHECK_BOX);
1671
BIND_ENUM_CONSTANT(ROLE_RADIO_BUTTON);
1672
BIND_ENUM_CONSTANT(ROLE_CHECK_BUTTON);
1673
BIND_ENUM_CONSTANT(ROLE_SCROLL_BAR);
1674
BIND_ENUM_CONSTANT(ROLE_SCROLL_VIEW);
1675
BIND_ENUM_CONSTANT(ROLE_SPLITTER);
1676
BIND_ENUM_CONSTANT(ROLE_SLIDER);
1677
BIND_ENUM_CONSTANT(ROLE_SPIN_BUTTON);
1678
BIND_ENUM_CONSTANT(ROLE_PROGRESS_INDICATOR);
1679
BIND_ENUM_CONSTANT(ROLE_TEXT_FIELD);
1680
BIND_ENUM_CONSTANT(ROLE_MULTILINE_TEXT_FIELD);
1681
BIND_ENUM_CONSTANT(ROLE_COLOR_PICKER);
1682
BIND_ENUM_CONSTANT(ROLE_TABLE);
1683
BIND_ENUM_CONSTANT(ROLE_CELL);
1684
BIND_ENUM_CONSTANT(ROLE_ROW);
1685
BIND_ENUM_CONSTANT(ROLE_ROW_GROUP);
1686
BIND_ENUM_CONSTANT(ROLE_ROW_HEADER);
1687
BIND_ENUM_CONSTANT(ROLE_COLUMN_HEADER);
1688
BIND_ENUM_CONSTANT(ROLE_TREE);
1689
BIND_ENUM_CONSTANT(ROLE_TREE_ITEM);
1690
BIND_ENUM_CONSTANT(ROLE_LIST);
1691
BIND_ENUM_CONSTANT(ROLE_LIST_ITEM);
1692
BIND_ENUM_CONSTANT(ROLE_LIST_BOX);
1693
BIND_ENUM_CONSTANT(ROLE_LIST_BOX_OPTION);
1694
BIND_ENUM_CONSTANT(ROLE_TAB_BAR);
1695
BIND_ENUM_CONSTANT(ROLE_TAB);
1696
BIND_ENUM_CONSTANT(ROLE_TAB_PANEL);
1697
BIND_ENUM_CONSTANT(ROLE_MENU_BAR);
1698
BIND_ENUM_CONSTANT(ROLE_MENU);
1699
BIND_ENUM_CONSTANT(ROLE_MENU_ITEM);
1700
BIND_ENUM_CONSTANT(ROLE_MENU_ITEM_CHECK_BOX);
1701
BIND_ENUM_CONSTANT(ROLE_MENU_ITEM_RADIO);
1702
BIND_ENUM_CONSTANT(ROLE_IMAGE);
1703
BIND_ENUM_CONSTANT(ROLE_WINDOW);
1704
BIND_ENUM_CONSTANT(ROLE_TITLE_BAR);
1705
BIND_ENUM_CONSTANT(ROLE_DIALOG);
1706
BIND_ENUM_CONSTANT(ROLE_TOOLTIP);
1707
1708
BIND_ENUM_CONSTANT(POPUP_MENU);
1709
BIND_ENUM_CONSTANT(POPUP_LIST);
1710
BIND_ENUM_CONSTANT(POPUP_TREE);
1711
BIND_ENUM_CONSTANT(POPUP_DIALOG);
1712
1713
BIND_ENUM_CONSTANT(FLAG_HIDDEN);
1714
BIND_ENUM_CONSTANT(FLAG_MULTISELECTABLE);
1715
BIND_ENUM_CONSTANT(FLAG_REQUIRED);
1716
BIND_ENUM_CONSTANT(FLAG_VISITED);
1717
BIND_ENUM_CONSTANT(FLAG_BUSY);
1718
BIND_ENUM_CONSTANT(FLAG_MODAL);
1719
BIND_ENUM_CONSTANT(FLAG_TOUCH_PASSTHROUGH);
1720
BIND_ENUM_CONSTANT(FLAG_READONLY);
1721
BIND_ENUM_CONSTANT(FLAG_DISABLED);
1722
BIND_ENUM_CONSTANT(FLAG_CLIPS_CHILDREN);
1723
1724
BIND_ENUM_CONSTANT(ACTION_CLICK);
1725
BIND_ENUM_CONSTANT(ACTION_FOCUS);
1726
BIND_ENUM_CONSTANT(ACTION_BLUR);
1727
BIND_ENUM_CONSTANT(ACTION_COLLAPSE);
1728
BIND_ENUM_CONSTANT(ACTION_EXPAND);
1729
BIND_ENUM_CONSTANT(ACTION_DECREMENT);
1730
BIND_ENUM_CONSTANT(ACTION_INCREMENT);
1731
BIND_ENUM_CONSTANT(ACTION_HIDE_TOOLTIP);
1732
BIND_ENUM_CONSTANT(ACTION_SHOW_TOOLTIP);
1733
BIND_ENUM_CONSTANT(ACTION_SET_TEXT_SELECTION);
1734
BIND_ENUM_CONSTANT(ACTION_REPLACE_SELECTED_TEXT);
1735
BIND_ENUM_CONSTANT(ACTION_SCROLL_BACKWARD);
1736
BIND_ENUM_CONSTANT(ACTION_SCROLL_DOWN);
1737
BIND_ENUM_CONSTANT(ACTION_SCROLL_FORWARD);
1738
BIND_ENUM_CONSTANT(ACTION_SCROLL_LEFT);
1739
BIND_ENUM_CONSTANT(ACTION_SCROLL_RIGHT);
1740
BIND_ENUM_CONSTANT(ACTION_SCROLL_UP);
1741
BIND_ENUM_CONSTANT(ACTION_SCROLL_INTO_VIEW);
1742
BIND_ENUM_CONSTANT(ACTION_SCROLL_TO_POINT);
1743
BIND_ENUM_CONSTANT(ACTION_SET_SCROLL_OFFSET);
1744
BIND_ENUM_CONSTANT(ACTION_SET_VALUE);
1745
BIND_ENUM_CONSTANT(ACTION_SHOW_CONTEXT_MENU);
1746
BIND_ENUM_CONSTANT(ACTION_CUSTOM);
1747
1748
BIND_ENUM_CONSTANT(LIVE_OFF);
1749
BIND_ENUM_CONSTANT(LIVE_POLITE);
1750
BIND_ENUM_CONSTANT(LIVE_ASSERTIVE);
1751
1752
BIND_ENUM_CONSTANT(SCROLL_UNIT_ITEM);
1753
BIND_ENUM_CONSTANT(SCROLL_UNIT_PAGE);
1754
1755
BIND_ENUM_CONSTANT(SCROLL_HINT_TOP_LEFT);
1756
BIND_ENUM_CONSTANT(SCROLL_HINT_BOTTOM_RIGHT);
1757
BIND_ENUM_CONSTANT(SCROLL_HINT_TOP_EDGE);
1758
BIND_ENUM_CONSTANT(SCROLL_HINT_BOTTOM_EDGE);
1759
BIND_ENUM_CONSTANT(SCROLL_HINT_LEFT_EDGE);
1760
BIND_ENUM_CONSTANT(SCROLL_HINT_RIGHT_EDGE);
1761
1762
BIND_ENUM_CONSTANT(MOUSE_MODE_VISIBLE);
1763
BIND_ENUM_CONSTANT(MOUSE_MODE_HIDDEN);
1764
BIND_ENUM_CONSTANT(MOUSE_MODE_CAPTURED);
1765
BIND_ENUM_CONSTANT(MOUSE_MODE_CONFINED);
1766
BIND_ENUM_CONSTANT(MOUSE_MODE_CONFINED_HIDDEN);
1767
BIND_ENUM_CONSTANT(MOUSE_MODE_MAX);
1768
1769
BIND_CONSTANT(INVALID_SCREEN);
1770
BIND_CONSTANT(SCREEN_WITH_MOUSE_FOCUS);
1771
BIND_CONSTANT(SCREEN_WITH_KEYBOARD_FOCUS);
1772
BIND_CONSTANT(SCREEN_PRIMARY);
1773
BIND_CONSTANT(SCREEN_OF_MAIN_WINDOW);
1774
1775
BIND_CONSTANT(MAIN_WINDOW_ID);
1776
BIND_CONSTANT(INVALID_WINDOW_ID);
1777
BIND_CONSTANT(INVALID_INDICATOR_ID);
1778
1779
BIND_ENUM_CONSTANT(SCREEN_LANDSCAPE);
1780
BIND_ENUM_CONSTANT(SCREEN_PORTRAIT);
1781
BIND_ENUM_CONSTANT(SCREEN_REVERSE_LANDSCAPE);
1782
BIND_ENUM_CONSTANT(SCREEN_REVERSE_PORTRAIT);
1783
BIND_ENUM_CONSTANT(SCREEN_SENSOR_LANDSCAPE);
1784
BIND_ENUM_CONSTANT(SCREEN_SENSOR_PORTRAIT);
1785
BIND_ENUM_CONSTANT(SCREEN_SENSOR);
1786
1787
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_DEFAULT);
1788
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_MULTILINE);
1789
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_NUMBER);
1790
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_NUMBER_DECIMAL);
1791
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_PHONE);
1792
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_EMAIL_ADDRESS);
1793
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_PASSWORD);
1794
BIND_ENUM_CONSTANT(KEYBOARD_TYPE_URL);
1795
1796
BIND_ENUM_CONSTANT(CURSOR_ARROW);
1797
BIND_ENUM_CONSTANT(CURSOR_IBEAM);
1798
BIND_ENUM_CONSTANT(CURSOR_POINTING_HAND);
1799
BIND_ENUM_CONSTANT(CURSOR_CROSS);
1800
BIND_ENUM_CONSTANT(CURSOR_WAIT);
1801
BIND_ENUM_CONSTANT(CURSOR_BUSY);
1802
BIND_ENUM_CONSTANT(CURSOR_DRAG);
1803
BIND_ENUM_CONSTANT(CURSOR_CAN_DROP);
1804
BIND_ENUM_CONSTANT(CURSOR_FORBIDDEN);
1805
BIND_ENUM_CONSTANT(CURSOR_VSIZE);
1806
BIND_ENUM_CONSTANT(CURSOR_HSIZE);
1807
BIND_ENUM_CONSTANT(CURSOR_BDIAGSIZE);
1808
BIND_ENUM_CONSTANT(CURSOR_FDIAGSIZE);
1809
BIND_ENUM_CONSTANT(CURSOR_MOVE);
1810
BIND_ENUM_CONSTANT(CURSOR_VSPLIT);
1811
BIND_ENUM_CONSTANT(CURSOR_HSPLIT);
1812
BIND_ENUM_CONSTANT(CURSOR_HELP);
1813
BIND_ENUM_CONSTANT(CURSOR_MAX);
1814
1815
BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_FILE);
1816
BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_FILES);
1817
BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_DIR);
1818
BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_ANY);
1819
BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_SAVE_FILE);
1820
1821
BIND_ENUM_CONSTANT(WINDOW_MODE_WINDOWED);
1822
BIND_ENUM_CONSTANT(WINDOW_MODE_MINIMIZED);
1823
BIND_ENUM_CONSTANT(WINDOW_MODE_MAXIMIZED);
1824
BIND_ENUM_CONSTANT(WINDOW_MODE_FULLSCREEN);
1825
BIND_ENUM_CONSTANT(WINDOW_MODE_EXCLUSIVE_FULLSCREEN);
1826
1827
BIND_ENUM_CONSTANT(WINDOW_FLAG_RESIZE_DISABLED);
1828
BIND_ENUM_CONSTANT(WINDOW_FLAG_BORDERLESS);
1829
BIND_ENUM_CONSTANT(WINDOW_FLAG_ALWAYS_ON_TOP);
1830
BIND_ENUM_CONSTANT(WINDOW_FLAG_TRANSPARENT);
1831
BIND_ENUM_CONSTANT(WINDOW_FLAG_NO_FOCUS);
1832
BIND_ENUM_CONSTANT(WINDOW_FLAG_POPUP);
1833
BIND_ENUM_CONSTANT(WINDOW_FLAG_EXTEND_TO_TITLE);
1834
BIND_ENUM_CONSTANT(WINDOW_FLAG_MOUSE_PASSTHROUGH);
1835
BIND_ENUM_CONSTANT(WINDOW_FLAG_SHARP_CORNERS);
1836
BIND_ENUM_CONSTANT(WINDOW_FLAG_EXCLUDE_FROM_CAPTURE);
1837
BIND_ENUM_CONSTANT(WINDOW_FLAG_POPUP_WM_HINT);
1838
BIND_ENUM_CONSTANT(WINDOW_FLAG_MINIMIZE_DISABLED);
1839
BIND_ENUM_CONSTANT(WINDOW_FLAG_MAXIMIZE_DISABLED);
1840
BIND_ENUM_CONSTANT(WINDOW_FLAG_MAX);
1841
1842
BIND_ENUM_CONSTANT(WINDOW_EVENT_MOUSE_ENTER);
1843
BIND_ENUM_CONSTANT(WINDOW_EVENT_MOUSE_EXIT);
1844
BIND_ENUM_CONSTANT(WINDOW_EVENT_FOCUS_IN);
1845
BIND_ENUM_CONSTANT(WINDOW_EVENT_FOCUS_OUT);
1846
BIND_ENUM_CONSTANT(WINDOW_EVENT_CLOSE_REQUEST);
1847
BIND_ENUM_CONSTANT(WINDOW_EVENT_GO_BACK_REQUEST);
1848
BIND_ENUM_CONSTANT(WINDOW_EVENT_DPI_CHANGE);
1849
BIND_ENUM_CONSTANT(WINDOW_EVENT_TITLEBAR_CHANGE);
1850
BIND_ENUM_CONSTANT(WINDOW_EVENT_FORCE_CLOSE);
1851
1852
BIND_ENUM_CONSTANT(WINDOW_EDGE_TOP_LEFT);
1853
BIND_ENUM_CONSTANT(WINDOW_EDGE_TOP);
1854
BIND_ENUM_CONSTANT(WINDOW_EDGE_TOP_RIGHT);
1855
BIND_ENUM_CONSTANT(WINDOW_EDGE_LEFT);
1856
BIND_ENUM_CONSTANT(WINDOW_EDGE_RIGHT);
1857
BIND_ENUM_CONSTANT(WINDOW_EDGE_BOTTOM_LEFT);
1858
BIND_ENUM_CONSTANT(WINDOW_EDGE_BOTTOM);
1859
BIND_ENUM_CONSTANT(WINDOW_EDGE_BOTTOM_RIGHT);
1860
BIND_ENUM_CONSTANT(WINDOW_EDGE_MAX);
1861
1862
BIND_ENUM_CONSTANT(VSYNC_DISABLED);
1863
BIND_ENUM_CONSTANT(VSYNC_ENABLED);
1864
BIND_ENUM_CONSTANT(VSYNC_ADAPTIVE);
1865
BIND_ENUM_CONSTANT(VSYNC_MAILBOX);
1866
1867
BIND_ENUM_CONSTANT(DISPLAY_HANDLE);
1868
BIND_ENUM_CONSTANT(WINDOW_HANDLE);
1869
BIND_ENUM_CONSTANT(WINDOW_VIEW);
1870
BIND_ENUM_CONSTANT(OPENGL_CONTEXT);
1871
BIND_ENUM_CONSTANT(EGL_DISPLAY);
1872
BIND_ENUM_CONSTANT(EGL_CONFIG);
1873
1874
BIND_ENUM_CONSTANT(TTS_UTTERANCE_STARTED);
1875
BIND_ENUM_CONSTANT(TTS_UTTERANCE_ENDED);
1876
BIND_ENUM_CONSTANT(TTS_UTTERANCE_CANCELED);
1877
BIND_ENUM_CONSTANT(TTS_UTTERANCE_BOUNDARY);
1878
}
1879
1880
Ref<Image> DisplayServer::_get_cursor_image_from_resource(const Ref<Resource> &p_cursor, const Vector2 &p_hotspot) {
1881
Ref<Image> image;
1882
ERR_FAIL_COND_V_MSG(p_hotspot.x < 0 || p_hotspot.y < 0, image, "Hotspot outside cursor image.");
1883
1884
Ref<Texture2D> texture = p_cursor;
1885
if (texture.is_valid()) {
1886
image = texture->get_image();
1887
} else {
1888
image = p_cursor;
1889
}
1890
ERR_FAIL_COND_V(image.is_null(), image);
1891
1892
Size2 image_size = image->get_size();
1893
ERR_FAIL_COND_V_MSG(p_hotspot.x > image_size.width || p_hotspot.y > image_size.height, image, "Hotspot outside cursor image.");
1894
ERR_FAIL_COND_V_MSG(image_size.width > 256 || image_size.height > 256, image, "Cursor image too big. Max supported size is 256x256.");
1895
1896
if (image->is_compressed()) {
1897
image = image->duplicate(true);
1898
Error err = image->decompress();
1899
ERR_FAIL_COND_V_MSG(err != OK, Ref<Image>(), "Couldn't decompress VRAM-compressed custom mouse cursor image. Switch to a lossless compression mode in the Import dock.");
1900
}
1901
return image;
1902
}
1903
1904
void DisplayServer::register_create_function(const char *p_name, CreateFunction p_function, GetRenderingDriversFunction p_get_drivers) {
1905
ERR_FAIL_COND(server_create_count == MAX_SERVERS);
1906
// Headless display server is always last
1907
server_create_functions[server_create_count] = server_create_functions[server_create_count - 1];
1908
server_create_functions[server_create_count - 1].name = p_name;
1909
server_create_functions[server_create_count - 1].create_function = p_function;
1910
server_create_functions[server_create_count - 1].get_rendering_drivers_function = p_get_drivers;
1911
server_create_count++;
1912
}
1913
1914
int DisplayServer::get_create_function_count() {
1915
return server_create_count;
1916
}
1917
1918
const char *DisplayServer::get_create_function_name(int p_index) {
1919
ERR_FAIL_INDEX_V(p_index, server_create_count, nullptr);
1920
return server_create_functions[p_index].name;
1921
}
1922
1923
Vector<String> DisplayServer::get_create_function_rendering_drivers(int p_index) {
1924
ERR_FAIL_INDEX_V(p_index, server_create_count, Vector<String>());
1925
return server_create_functions[p_index].get_rendering_drivers_function();
1926
}
1927
1928
DisplayServer *DisplayServer::create(int p_index, const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Context p_context, int64_t p_parent_window, Error &r_error) {
1929
ERR_FAIL_INDEX_V(p_index, server_create_count, nullptr);
1930
return server_create_functions[p_index].create_function(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_position, p_resolution, p_screen, p_context, p_parent_window, r_error);
1931
}
1932
1933
void DisplayServer::_input_set_mouse_mode(Input::MouseMode p_mode) {
1934
singleton->mouse_set_mode(MouseMode(p_mode));
1935
}
1936
1937
Input::MouseMode DisplayServer::_input_get_mouse_mode() {
1938
return Input::MouseMode(singleton->mouse_get_mode());
1939
}
1940
1941
void DisplayServer::_input_set_mouse_mode_override(Input::MouseMode p_mode) {
1942
singleton->mouse_set_mode_override(MouseMode(p_mode));
1943
}
1944
1945
Input::MouseMode DisplayServer::_input_get_mouse_mode_override() {
1946
return Input::MouseMode(singleton->mouse_get_mode_override());
1947
}
1948
1949
void DisplayServer::_input_set_mouse_mode_override_enabled(bool p_enabled) {
1950
singleton->mouse_set_mode_override_enabled(p_enabled);
1951
}
1952
1953
bool DisplayServer::_input_is_mouse_mode_override_enabled() {
1954
return singleton->mouse_is_mode_override_enabled();
1955
}
1956
1957
void DisplayServer::_input_warp(const Vector2 &p_to_pos) {
1958
singleton->warp_mouse(p_to_pos);
1959
}
1960
1961
Input::CursorShape DisplayServer::_input_get_current_cursor_shape() {
1962
return (Input::CursorShape)singleton->cursor_get_shape();
1963
}
1964
1965
void DisplayServer::_input_set_custom_mouse_cursor_func(const Ref<Resource> &p_image, Input::CursorShape p_shape, const Vector2 &p_hotspot) {
1966
singleton->cursor_set_custom_image(p_image, (CursorShape)p_shape, p_hotspot);
1967
}
1968
1969
bool DisplayServer::is_rendering_device_supported() {
1970
#if defined(RD_ENABLED)
1971
RenderingDevice *device = RenderingDevice::get_singleton();
1972
if (device) {
1973
return true;
1974
}
1975
1976
if (supported_rendering_device == RenderingDeviceCreationStatus::SUCCESS) {
1977
return true;
1978
} else if (supported_rendering_device == RenderingDeviceCreationStatus::FAILURE) {
1979
return false;
1980
}
1981
1982
Error err;
1983
1984
#if defined(WINDOWS_ENABLED) || defined(LINUXBSD_ENABLED)
1985
// On some drivers combining OpenGL and RenderingDevice can result in crash, offload the check to the subprocess.
1986
List<String> arguments;
1987
arguments.push_back("--test-rd-support");
1988
if (get_singleton()) {
1989
arguments.push_back("--display-driver");
1990
arguments.push_back(get_singleton()->get_name().to_lower());
1991
}
1992
1993
String pipe;
1994
int exitcode = 0;
1995
err = OS::get_singleton()->execute(OS::get_singleton()->get_executable_path(), arguments, &pipe, &exitcode);
1996
if (err == OK && exitcode == 0) {
1997
supported_rendering_device = RenderingDeviceCreationStatus::SUCCESS;
1998
return true;
1999
} else {
2000
supported_rendering_device = RenderingDeviceCreationStatus::FAILURE;
2001
}
2002
#else // WINDOWS_ENABLED
2003
2004
RenderingContextDriver *rcd = nullptr;
2005
2006
#if defined(VULKAN_ENABLED)
2007
rcd = memnew(RenderingContextDriverVulkan);
2008
#endif
2009
#ifdef D3D12_ENABLED
2010
if (rcd == nullptr) {
2011
rcd = memnew(RenderingContextDriverD3D12);
2012
}
2013
#endif
2014
#ifdef METAL_ENABLED
2015
if (rcd == nullptr) {
2016
GODOT_CLANG_WARNING_PUSH_AND_IGNORE("-Wunguarded-availability")
2017
// Eliminate "RenderingContextDriverMetal is only available on iOS 14.0 or newer".
2018
rcd = memnew(RenderingContextDriverMetal);
2019
GODOT_CLANG_WARNING_POP
2020
}
2021
#endif
2022
2023
if (rcd != nullptr) {
2024
err = rcd->initialize();
2025
if (err == OK) {
2026
RenderingDevice *rd = memnew(RenderingDevice);
2027
err = rd->initialize(rcd);
2028
memdelete(rd);
2029
rd = nullptr;
2030
if (err == OK) {
2031
// Creating a RenderingDevice is quite slow.
2032
// Cache the result for future usage, so that it's much faster on subsequent calls.
2033
supported_rendering_device = RenderingDeviceCreationStatus::SUCCESS;
2034
memdelete(rcd);
2035
rcd = nullptr;
2036
return true;
2037
} else {
2038
supported_rendering_device = RenderingDeviceCreationStatus::FAILURE;
2039
}
2040
}
2041
2042
memdelete(rcd);
2043
rcd = nullptr;
2044
}
2045
2046
#endif // WINDOWS_ENABLED
2047
#endif // RD_ENABLED
2048
return false;
2049
}
2050
2051
bool DisplayServer::can_create_rendering_device() {
2052
if (get_singleton() && get_singleton()->get_name() == "headless") {
2053
return false;
2054
}
2055
2056
#if defined(RD_ENABLED)
2057
RenderingDevice *device = RenderingDevice::get_singleton();
2058
if (device) {
2059
return true;
2060
}
2061
2062
if (created_rendering_device == RenderingDeviceCreationStatus::SUCCESS) {
2063
return true;
2064
} else if (created_rendering_device == RenderingDeviceCreationStatus::FAILURE) {
2065
return false;
2066
}
2067
2068
Error err;
2069
2070
#ifdef WINDOWS_ENABLED
2071
// On some NVIDIA drivers combining OpenGL and RenderingDevice can result in crash, offload the check to the subprocess.
2072
List<String> arguments;
2073
arguments.push_back("--test-rd-creation");
2074
2075
String pipe;
2076
int exitcode = 0;
2077
err = OS::get_singleton()->execute(OS::get_singleton()->get_executable_path(), arguments, &pipe, &exitcode);
2078
if (err == OK && exitcode == 0) {
2079
created_rendering_device = RenderingDeviceCreationStatus::SUCCESS;
2080
return true;
2081
} else {
2082
created_rendering_device = RenderingDeviceCreationStatus::FAILURE;
2083
}
2084
#else // WINDOWS_ENABLED
2085
2086
RenderingContextDriver *rcd = nullptr;
2087
2088
#if defined(VULKAN_ENABLED)
2089
rcd = memnew(RenderingContextDriverVulkan);
2090
#endif
2091
#ifdef D3D12_ENABLED
2092
if (rcd == nullptr) {
2093
rcd = memnew(RenderingContextDriverD3D12);
2094
}
2095
#endif
2096
#ifdef METAL_ENABLED
2097
if (rcd == nullptr) {
2098
GODOT_CLANG_WARNING_PUSH_AND_IGNORE("-Wunguarded-availability")
2099
// Eliminate "RenderingContextDriverMetal is only available on iOS 14.0 or newer".
2100
rcd = memnew(RenderingContextDriverMetal);
2101
GODOT_CLANG_WARNING_POP
2102
}
2103
#endif
2104
2105
if (rcd != nullptr) {
2106
err = rcd->initialize();
2107
if (err == OK) {
2108
RenderingDevice *rd = memnew(RenderingDevice);
2109
err = rd->initialize(rcd);
2110
memdelete(rd);
2111
rd = nullptr;
2112
if (err == OK) {
2113
// Creating a RenderingDevice is quite slow.
2114
// Cache the result for future usage, so that it's much faster on subsequent calls.
2115
created_rendering_device = RenderingDeviceCreationStatus::SUCCESS;
2116
memdelete(rcd);
2117
rcd = nullptr;
2118
return true;
2119
} else {
2120
created_rendering_device = RenderingDeviceCreationStatus::FAILURE;
2121
}
2122
}
2123
2124
memdelete(rcd);
2125
rcd = nullptr;
2126
}
2127
2128
#endif // WINDOWS_ENABLED
2129
#endif // RD_ENABLED
2130
return false;
2131
}
2132
2133
DisplayServer::DisplayServer() {
2134
singleton = this;
2135
Input::set_mouse_mode_func = _input_set_mouse_mode;
2136
Input::get_mouse_mode_func = _input_get_mouse_mode;
2137
Input::set_mouse_mode_override_func = _input_set_mouse_mode_override;
2138
Input::get_mouse_mode_override_func = _input_get_mouse_mode_override;
2139
Input::set_mouse_mode_override_enabled_func = _input_set_mouse_mode_override_enabled;
2140
Input::is_mouse_mode_override_enabled_func = _input_is_mouse_mode_override_enabled;
2141
Input::warp_mouse_func = _input_warp;
2142
Input::get_current_cursor_shape_func = _input_get_current_cursor_shape;
2143
Input::set_custom_mouse_cursor_func = _input_set_custom_mouse_cursor_func;
2144
}
2145
2146
DisplayServer::~DisplayServer() {
2147
singleton = nullptr;
2148
}
2149
2150