summaryrefslogtreecommitdiff
path: root/scene/main/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r--scene/main/window.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index a2a49aea75..19954299de 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -249,7 +249,7 @@ void Window::_make_window() {
}
}
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_VISIBLE);
}
void Window::_update_from_window() {
@@ -279,7 +279,7 @@ void Window::_clear_window() {
window_id = DisplayServer::INVALID_WINDOW_ID;
_update_viewport_size();
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
void Window::_rect_changed_callback(const Rect2i &p_callback) {
@@ -387,11 +387,11 @@ void Window::set_visible(bool p_visible) {
if (visible) {
embedder = embedder_vp;
embedder->_sub_window_register(this);
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
} else {
embedder->_sub_window_remove(this);
embedder = nullptr;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
_update_window_size();
}
@@ -402,7 +402,7 @@ void Window::set_visible(bool p_visible) {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), visible);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), visible);
}
void Window::_clear_transient() {
@@ -606,14 +606,14 @@ void Window::_update_viewport_size() {
//black bars and margin
if (content_scale_aspect != CONTENT_SCALE_ASPECT_EXPAND && screen_size.x < video_mode.x) {
margin.x = Math::round((video_mode.x - screen_size.x) / 2.0);
- //VisualServer::get_singleton()->black_bars_set_margins(margin.x, 0, margin.x, 0);
+ //RenderingServer::get_singleton()->black_bars_set_margins(margin.x, 0, margin.x, 0);
offset.x = Math::round(margin.x * viewport_size.y / screen_size.y);
} else if (content_scale_aspect != CONTENT_SCALE_ASPECT_EXPAND && screen_size.y < video_mode.y) {
margin.y = Math::round((video_mode.y - screen_size.y) / 2.0);
- //VisualServer::get_singleton()->black_bars_set_margins(0, margin.y, 0, margin.y);
+ //RenderingServer::get_singleton()->black_bars_set_margins(0, margin.y, 0, margin.y);
offset.y = Math::round(margin.y * viewport_size.x / screen_size.x);
} else {
- //VisualServer::get_singleton()->black_bars_set_margins(0, 0, 0, 0);
+ //RenderingServer::get_singleton()->black_bars_set_margins(0, 0, 0, 0);
}
switch (content_scale_mode) {
@@ -646,9 +646,9 @@ void Window::_update_viewport_size() {
_set_size(final_size, final_size_override, attach_to_screen_rect, stretch_transform, allocate);
if (window_id != DisplayServer::INVALID_WINDOW_ID) {
- VisualServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), attach_to_screen_rect, window_id);
+ RenderingServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), attach_to_screen_rect, window_id);
} else {
- VisualServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), Rect2i(), DisplayServer::INVALID_WINDOW_ID);
+ RenderingServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), Rect2i(), DisplayServer::INVALID_WINDOW_ID);
}
if (window_id == DisplayServer::MAIN_WINDOW_ID) {
@@ -718,7 +718,7 @@ void Window::_notification(int p_what) {
//create as embedded
if (embedder) {
embedder->_sub_window_register(this);
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
_update_window_size();
}
@@ -736,7 +736,7 @@ void Window::_notification(int p_what) {
}
_update_viewport_size(); //then feed back to the viewport
_update_window_callbacks();
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_VISIBLE);
} else {
//create
if (visible) {
@@ -752,7 +752,7 @@ void Window::_notification(int p_what) {
if (visible) {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
}
}
@@ -773,7 +773,7 @@ void Window::_notification(int p_what) {
if (window_id == DisplayServer::MAIN_WINDOW_ID) {
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
_update_window_callbacks();
} else {
_clear_window();
@@ -783,12 +783,12 @@ void Window::_notification(int p_what) {
if (embedder) {
embedder->_sub_window_remove(this);
embedder = nullptr;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
_update_viewport_size(); //called by clear and make, which does not happen here
}
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), false);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), false);
}
}
@@ -909,7 +909,7 @@ void Window::_window_input_text(const String &p_text) {
input_text(p_text);
}
void Window::_window_drop_files(const Vector<String> &p_files) {
- emit_signal("files_dropped", p_files);
+ emit_signal("files_dropped", p_files, current_screen);
}
Viewport *Window::get_parent_viewport() const {
@@ -1108,13 +1108,13 @@ void Window::remove_child_notify(Node *p_child) {
Control *child_c = Object::cast_to<Control>(p_child);
if (child_c && (child_c->data.theme_owner || child_c->data.theme_owner_window) && child_c->data.theme.is_null()) {
- Control::_propagate_theme_changed(child_c, NULL, NULL);
+ Control::_propagate_theme_changed(child_c, nullptr, nullptr);
}
Window *child_w = Object::cast_to<Window>(p_child);
if (child_w && (child_w->theme_owner || child_w->theme_owner_window) && child_w->theme.is_null()) {
- Control::_propagate_theme_changed(child_w, NULL, NULL);
+ Control::_propagate_theme_changed(child_w, nullptr, nullptr);
}
if (is_inside_tree() && wrap_controls) {
@@ -1285,7 +1285,7 @@ void Window::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_exclusive", "exclusive"), &Window::set_exclusive);
ClassDB::bind_method(D_METHOD("is_exclusive"), &Window::is_exclusive);
- ClassDB::bind_method(D_METHOD("can_draw"), &Window::is_transient);
+ ClassDB::bind_method(D_METHOD("can_draw"), &Window::can_draw);
ClassDB::bind_method(D_METHOD("has_focus"), &Window::has_focus);
ClassDB::bind_method(D_METHOD("grab_focus"), &Window::grab_focus);
@@ -1331,7 +1331,7 @@ void Window::_bind_methods() {
ClassDB::bind_method(D_METHOD("popup_on_parent", "parent_rect"), &Window::popup_on_parent);
ClassDB::bind_method(D_METHOD("popup_centered_ratio", "ratio"), &Window::popup_centered_ratio, DEFVAL(0.8));
ClassDB::bind_method(D_METHOD("popup_centered", "minsize"), &Window::popup_centered, DEFVAL(Size2i()));
- ClassDB::bind_method(D_METHOD("popup_centered_clamped", "minsize", "fallback_ratio"), &Window::popup_centered, DEFVAL(Size2i()), DEFVAL(0.75));
+ ClassDB::bind_method(D_METHOD("popup_centered_clamped", "minsize", "fallback_ratio"), &Window::popup_centered_clamped, DEFVAL(Size2i()), DEFVAL(0.75));
ADD_PROPERTY(PropertyInfo(Variant::STRING, "title"), "set_title", "get_title");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "position"), "set_position", "get_position");
@@ -1400,7 +1400,7 @@ Window::Window() {
}
content_scale_mode = CONTENT_SCALE_MODE_DISABLED;
content_scale_aspect = CONTENT_SCALE_ASPECT_IGNORE;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
Window::~Window() {
}