Move DisplayServer enums and typedefs to DisplayServerEnums
This will allow decoupling `display_server.h` from a number of headers in the codebase which only require those enums and not all the DisplayServer API.
This commit is contained in:
parent
778cf54dab
commit
a447ac95ec
160 changed files with 4584 additions and 4520 deletions
|
|
@ -457,7 +457,7 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
|
||||
void EditorNode::_update_vsync_mode() {
|
||||
const DisplayServer::VSyncMode window_vsync_mode = DisplayServer::VSyncMode(int(EDITOR_GET("interface/editor/display/vsync_mode")));
|
||||
const DisplayServerEnums::VSyncMode window_vsync_mode = DisplayServerEnums::VSyncMode(int(EDITOR_GET("interface/editor/display/vsync_mode")));
|
||||
DisplayServer::get_singleton()->window_set_vsync_mode(window_vsync_mode);
|
||||
}
|
||||
|
||||
|
|
@ -939,7 +939,7 @@ void EditorNode::_notification(int p_what) {
|
|||
get_tree()->set_quit_on_go_back(false);
|
||||
bool is_fullscreen = EDITOR_DEF("_is_editor_fullscreen", false);
|
||||
if (is_fullscreen) {
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_FULLSCREEN);
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServerEnums::WINDOW_MODE_FULLSCREEN);
|
||||
}
|
||||
#endif
|
||||
get_tree()->get_root()->connect("files_dropped", callable_mp(this, &EditorNode::_dropped_files));
|
||||
|
|
@ -1632,8 +1632,8 @@ void EditorNode::_viewport_resized() {
|
|||
}
|
||||
|
||||
void EditorNode::_titlebar_resized() {
|
||||
DisplayServer::get_singleton()->window_set_window_buttons_offset(Vector2i(title_bar->get_global_position().y + title_bar->get_size().y / 2, title_bar->get_global_position().y + title_bar->get_size().y / 2), DisplayServer::MAIN_WINDOW_ID);
|
||||
const Vector3i &margin = DisplayServer::get_singleton()->window_get_safe_title_margins(DisplayServer::MAIN_WINDOW_ID);
|
||||
DisplayServer::get_singleton()->window_set_window_buttons_offset(Vector2i(title_bar->get_global_position().y + title_bar->get_size().y / 2, title_bar->get_global_position().y + title_bar->get_size().y / 2), DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
const Vector3i &margin = DisplayServer::get_singleton()->window_get_safe_title_margins(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
if (left_menu_spacer) {
|
||||
int w = (gui_base->is_layout_rtl()) ? margin.y : margin.x;
|
||||
left_menu_spacer->set_custom_minimum_size(Size2(w, 0));
|
||||
|
|
@ -3816,8 +3816,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
feature_profile_manager->popup_centered_clamped(Size2(900, 800) * EDSCALE, 0.8);
|
||||
} break;
|
||||
case EDITOR_TOGGLE_FULLSCREEN: {
|
||||
DisplayServer::WindowMode mode = DisplayServer::get_singleton()->window_get_mode();
|
||||
if (mode == DisplayServer::WINDOW_MODE_FULLSCREEN || mode == DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
||||
DisplayServerEnums::WindowMode mode = DisplayServer::get_singleton()->window_get_mode();
|
||||
if (mode == DisplayServerEnums::WINDOW_MODE_FULLSCREEN || mode == DisplayServerEnums::WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
||||
DisplayServer::get_singleton()->window_set_mode(prev_mode);
|
||||
#ifdef ANDROID_ENABLED
|
||||
EditorSettings::get_singleton()->set("_is_editor_fullscreen", false);
|
||||
|
|
@ -3825,7 +3825,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
#endif
|
||||
} else {
|
||||
prev_mode = mode;
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_FULLSCREEN);
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServerEnums::WINDOW_MODE_FULLSCREEN);
|
||||
#ifdef ANDROID_ENABLED
|
||||
EditorSettings::get_singleton()->set("_is_editor_fullscreen", true);
|
||||
EditorSettings::get_singleton()->save();
|
||||
|
|
@ -5333,7 +5333,7 @@ void EditorNode::request_instantiate_scenes(const Vector<String> &p_files) {
|
|||
|
||||
String EditorNode::get_multiwindow_support_tooltip_text() const {
|
||||
if (SceneTree::get_singleton()->get_root()->is_embedding_subwindows()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SUBWINDOWS)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_SUBWINDOWS)) {
|
||||
return TTR("Multi-window support is not available because the `--single-window` command line argument was used to start the editor.");
|
||||
} else {
|
||||
return TTR("Multi-window support is not available because the current platform doesn't support multiple windows.");
|
||||
|
|
@ -8080,7 +8080,7 @@ void EditorNode::_add_to_main_menu(const String &p_name, PopupMenu *p_menu) {
|
|||
}
|
||||
|
||||
void EditorNode::_update_main_menu_type() {
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/appearance/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/appearance/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_EXTEND_TO_TITLE);
|
||||
bool use_menu_button = EDITOR_GET("interface/editor/appearance/collapse_main_menu");
|
||||
bool global_menu = !bool(EDITOR_GET("interface/editor/appearance/use_embedded_menu")) && NativeMenu::get_singleton()->has_feature(NativeMenu::FEATURE_GLOBAL_MENU);
|
||||
MenuType new_menu_type;
|
||||
|
|
@ -8282,7 +8282,7 @@ EditorNode::EditorNode() {
|
|||
// Only if no touchscreen ui hint, disable emulation just in case.
|
||||
Input::get_singleton()->set_emulate_touch_from_mouse(false);
|
||||
}
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CUSTOM_CURSOR_SHAPE)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_CUSTOM_CURSOR_SHAPE)) {
|
||||
DisplayServer::get_singleton()->cursor_set_custom_image(Ref<Resource>());
|
||||
}
|
||||
}
|
||||
|
|
@ -8899,7 +8899,7 @@ EditorNode::EditorNode() {
|
|||
ED_SHORTCUT_AND_COMMAND("editor/editor_prev", TTRC("Open the previous Editor"));
|
||||
|
||||
// Editor menu and toolbar.
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/appearance/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/appearance/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_EXTEND_TO_TITLE);
|
||||
|
||||
#ifdef MACOS_ENABLED
|
||||
if (NativeMenu::get_singleton()->has_system_menu(NativeMenu::APPLICATION_MENU_ID)) {
|
||||
|
|
@ -9498,7 +9498,7 @@ EditorNode::EditorNode() {
|
|||
// Extend menu bar to window title.
|
||||
if (can_expand) {
|
||||
DisplayServer::get_singleton()->process_events();
|
||||
DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_EXTEND_TO_TITLE, true, DisplayServer::MAIN_WINDOW_ID);
|
||||
DisplayServer::get_singleton()->window_set_flag(DisplayServerEnums::WINDOW_FLAG_EXTEND_TO_TITLE, true, DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
title_bar->set_can_move_window(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue