diff options
Diffstat (limited to 'servers/display_server.cpp')
-rw-r--r-- | servers/display_server.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 41fa0d2d47..f41238b075 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -362,10 +362,18 @@ String DisplayServer::clipboard_get() const { ERR_FAIL_V_MSG(String(), "Clipboard is not supported by this display server."); } +Ref<Image> DisplayServer::clipboard_get_image() const { + ERR_FAIL_V_MSG(Ref<Image>(), "Clipboard is not supported by this display server."); +} + bool DisplayServer::clipboard_has() const { return !clipboard_get().is_empty(); } +bool DisplayServer::clipboard_has_image() const { + return clipboard_get_image().is_valid(); +} + void DisplayServer::clipboard_set_primary(const String &p_text) { WARN_PRINT("Primary clipboard is not supported by this display server."); } @@ -497,6 +505,11 @@ Error DisplayServer::dialog_input_text(String p_title, String p_description, Str return OK; } +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) { + WARN_PRINT("Native dialogs not supported by this display server."); + return OK; +} + int DisplayServer::keyboard_get_layout_count() const { return 0; } @@ -520,6 +533,10 @@ Key DisplayServer::keyboard_get_keycode_from_physical(Key p_keycode) const { ERR_FAIL_V_MSG(p_keycode, "Not supported by this display server."); } +Key DisplayServer::keyboard_get_label_from_physical(Key p_keycode) const { + ERR_FAIL_V_MSG(p_keycode, "Not supported by this display server."); +} + void DisplayServer::force_process_and_drop_events() { } @@ -640,7 +657,9 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("clipboard_set", "clipboard"), &DisplayServer::clipboard_set); ClassDB::bind_method(D_METHOD("clipboard_get"), &DisplayServer::clipboard_get); + ClassDB::bind_method(D_METHOD("clipboard_get_image"), &DisplayServer::clipboard_get_image); ClassDB::bind_method(D_METHOD("clipboard_has"), &DisplayServer::clipboard_has); + ClassDB::bind_method(D_METHOD("clipboard_has_image"), &DisplayServer::clipboard_has_image); ClassDB::bind_method(D_METHOD("clipboard_set_primary", "clipboard_primary"), &DisplayServer::clipboard_set_primary); ClassDB::bind_method(D_METHOD("clipboard_get_primary"), &DisplayServer::clipboard_get_primary); @@ -751,12 +770,15 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("dialog_show", "title", "description", "buttons", "callback"), &DisplayServer::dialog_show); ClassDB::bind_method(D_METHOD("dialog_input_text", "title", "description", "existing_text", "callback"), &DisplayServer::dialog_input_text); + ClassDB::bind_method(D_METHOD("file_dialog_show", "title", "current_directory", "filename", "show_hidden", "mode", "filters", "callback"), &DisplayServer::file_dialog_show); + ClassDB::bind_method(D_METHOD("keyboard_get_layout_count"), &DisplayServer::keyboard_get_layout_count); ClassDB::bind_method(D_METHOD("keyboard_get_current_layout"), &DisplayServer::keyboard_get_current_layout); ClassDB::bind_method(D_METHOD("keyboard_set_current_layout", "index"), &DisplayServer::keyboard_set_current_layout); ClassDB::bind_method(D_METHOD("keyboard_get_layout_language", "index"), &DisplayServer::keyboard_get_layout_language); ClassDB::bind_method(D_METHOD("keyboard_get_layout_name", "index"), &DisplayServer::keyboard_get_layout_name); ClassDB::bind_method(D_METHOD("keyboard_get_keycode_from_physical", "keycode"), &DisplayServer::keyboard_get_keycode_from_physical); + ClassDB::bind_method(D_METHOD("keyboard_get_label_from_physical", "keycode"), &DisplayServer::keyboard_get_label_from_physical); ClassDB::bind_method(D_METHOD("process_events"), &DisplayServer::process_events); ClassDB::bind_method(D_METHOD("force_process_and_drop_events"), &DisplayServer::force_process_and_drop_events); @@ -841,6 +863,12 @@ void DisplayServer::_bind_methods() { BIND_ENUM_CONSTANT(CURSOR_HELP); BIND_ENUM_CONSTANT(CURSOR_MAX); + BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_FILE); + BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_FILES); + BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_DIR); + BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_OPEN_ANY); + BIND_ENUM_CONSTANT(FILE_DIALOG_MODE_SAVE_FILE); + BIND_ENUM_CONSTANT(WINDOW_MODE_WINDOWED); BIND_ENUM_CONSTANT(WINDOW_MODE_MINIMIZED); BIND_ENUM_CONSTANT(WINDOW_MODE_MAXIMIZED); |