Merge pull request #116976 from akien-mga/displayserver-split-types
Decouple DisplayServer from as much of the codebase as possible
This commit is contained in:
commit
accfd9932b
244 changed files with 4974 additions and 4693 deletions
|
|
@ -84,3 +84,6 @@ f5a290ac462765afca34e64dd39f883511510147
|
|||
|
||||
# Style: Add `class_db.h` includes explicitly
|
||||
e380a417526c11f15a9ddb3997292409b10da2af
|
||||
|
||||
# Move DisplayServer enums and typedefs to DisplayServerEnums
|
||||
a447ac95ec170ee117c2eae55f1bfff0d0cf0dce
|
||||
|
|
|
|||
|
|
@ -1756,10 +1756,10 @@ ProjectSettings::ProjectSettings() {
|
|||
|
||||
_add_builtin_input_map();
|
||||
|
||||
// Keep the enum values in sync with the `DisplayServer::ScreenOrientation` enum.
|
||||
// Keep the enum values in sync with the `DisplayServerEnums::ScreenOrientation` enum.
|
||||
custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::INT, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait,Reverse Landscape,Reverse Portrait,Sensor Landscape,Sensor Portrait,Sensor");
|
||||
GLOBAL_DEF("display/window/subwindows/embed_subwindows", true);
|
||||
// Keep the enum values in sync with the `DisplayServer::VSyncMode` enum.
|
||||
// Keep the enum values in sync with the `DisplayServerEnums::VSyncMode` enum.
|
||||
custom_prop_info["display/window/vsync/vsync_mode"] = PropertyInfo(Variant::INT, "display/window/vsync/vsync_mode", PROPERTY_HINT_ENUM, "Disabled,Enabled,Adaptive,Mailbox");
|
||||
|
||||
GLOBAL_DEF("display/window/frame_pacing/android/enable_frame_pacing", true);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
class GamepadMotion;
|
||||
|
||||
namespace InputClassEnums {
|
||||
// Keep synced with "DisplayServer::MouseMode" enum.
|
||||
// Keep synced with DisplayServerEnums::MouseMode enum.
|
||||
enum MouseMode : int {
|
||||
MOUSE_MODE_VISIBLE,
|
||||
MOUSE_MODE_HIDDEN,
|
||||
|
|
@ -51,6 +51,7 @@ enum MouseMode : int {
|
|||
MOUSE_MODE_MAX,
|
||||
};
|
||||
|
||||
// Keep synced with DisplayServerEnums and Control enums.
|
||||
#undef CursorShape
|
||||
enum CursorShape : int {
|
||||
CURSOR_ARROW,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@
|
|||
#include "accessibility_server_accesskit.h"
|
||||
|
||||
#ifdef ACCESSKIT_DYNAMIC
|
||||
#include "core/config/engine.h"
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/os/os.h"
|
||||
#endif
|
||||
|
||||
#include "servers/text/text_server.h"
|
||||
|
|
@ -52,7 +54,7 @@ _FORCE_INLINE_ accesskit_action AccessibilityServerAccessKit::_accessibility_act
|
|||
return ACCESSKIT_ACTION_CLICK;
|
||||
}
|
||||
|
||||
bool AccessibilityServerAccessKit::window_create(DisplayServer::WindowID p_window_id, void *p_handle) {
|
||||
bool AccessibilityServerAccessKit::window_create(DisplayServerEnums::WindowID p_window_id, void *p_handle) {
|
||||
ERR_FAIL_COND_V(windows.has(p_window_id), false);
|
||||
|
||||
WindowData &wd = windows[p_window_id];
|
||||
|
|
@ -84,7 +86,7 @@ bool AccessibilityServerAccessKit::window_create(DisplayServer::WindowID p_windo
|
|||
}
|
||||
}
|
||||
|
||||
void AccessibilityServerAccessKit::window_destroy(DisplayServer::WindowID p_window_id) {
|
||||
void AccessibilityServerAccessKit::window_destroy(DisplayServerEnums::WindowID p_window_id) {
|
||||
WindowData *wd = windows.getptr(p_window_id);
|
||||
ERR_FAIL_NULL(wd);
|
||||
|
||||
|
|
@ -105,7 +107,7 @@ void AccessibilityServerAccessKit::window_destroy(DisplayServer::WindowID p_wind
|
|||
}
|
||||
|
||||
void AccessibilityServerAccessKit::_accessibility_deactivation_callback(void *p_user_data) {
|
||||
DisplayServer::WindowID window_id = (DisplayServer::WindowID)(size_t)p_user_data;
|
||||
DisplayServerEnums::WindowID window_id = (DisplayServerEnums::WindowID)(size_t)p_user_data;
|
||||
WindowData *wd = static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.getptr(window_id);
|
||||
ERR_FAIL_NULL(wd);
|
||||
|
||||
|
|
@ -126,7 +128,7 @@ void AccessibilityServerAccessKit::_accessibility_deactivation_callback(void *p_
|
|||
}
|
||||
|
||||
void AccessibilityServerAccessKit::_accessibility_action_callback(struct accesskit_action_request *p_request, void *p_user_data) {
|
||||
DisplayServer::WindowID window_id = (DisplayServer::WindowID)(size_t)p_user_data;
|
||||
DisplayServerEnums::WindowID window_id = (DisplayServerEnums::WindowID)(size_t)p_user_data;
|
||||
ERR_FAIL_COND(!static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.has(window_id));
|
||||
|
||||
RID rid = RID::from_uint64(p_request->target);
|
||||
|
|
@ -218,7 +220,7 @@ void AccessibilityServerAccessKit::_accessibility_action_callback(struct accessk
|
|||
}
|
||||
|
||||
accesskit_tree_update *AccessibilityServerAccessKit::_accessibility_initial_tree_update_callback(void *p_user_data) {
|
||||
DisplayServer::WindowID window_id = (DisplayServer::WindowID)(size_t)p_user_data;
|
||||
DisplayServerEnums::WindowID window_id = (DisplayServerEnums::WindowID)(size_t)p_user_data;
|
||||
WindowData *wd = static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.getptr(window_id);
|
||||
ERR_FAIL_NULL_V(wd, nullptr);
|
||||
|
||||
|
|
@ -243,7 +245,7 @@ accesskit_tree_update *AccessibilityServerAccessKit::_accessibility_initial_tree
|
|||
return tree_update;
|
||||
}
|
||||
|
||||
void AccessibilityServerAccessKit::set_window_callbacks(DisplayServer::WindowID p_window_id, const Callable &p_activate_callable, const Callable &p_deativate_callable) {
|
||||
void AccessibilityServerAccessKit::set_window_callbacks(DisplayServerEnums::WindowID p_window_id, const Callable &p_activate_callable, const Callable &p_deativate_callable) {
|
||||
WindowData *wd = static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.getptr(p_window_id);
|
||||
ERR_FAIL_NULL(wd);
|
||||
|
||||
|
|
@ -251,7 +253,7 @@ void AccessibilityServerAccessKit::set_window_callbacks(DisplayServer::WindowID
|
|||
wd->deactivate = p_deativate_callable;
|
||||
}
|
||||
|
||||
void AccessibilityServerAccessKit::window_activation_completed(DisplayServer::WindowID p_window_id) {
|
||||
void AccessibilityServerAccessKit::window_activation_completed(DisplayServerEnums::WindowID p_window_id) {
|
||||
WindowData *wd = static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.getptr(p_window_id);
|
||||
if (!wd) {
|
||||
return;
|
||||
|
|
@ -262,7 +264,7 @@ void AccessibilityServerAccessKit::window_activation_completed(DisplayServer::Wi
|
|||
wd->initial_update_completed = true;
|
||||
}
|
||||
|
||||
void AccessibilityServerAccessKit::window_deactivation_completed(DisplayServer::WindowID p_window_id) {
|
||||
void AccessibilityServerAccessKit::window_deactivation_completed(DisplayServerEnums::WindowID p_window_id) {
|
||||
WindowData *wd = static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.getptr(p_window_id);
|
||||
if (!wd) {
|
||||
return;
|
||||
|
|
@ -286,7 +288,7 @@ void AccessibilityServerAccessKit::window_deactivation_completed(DisplayServer::
|
|||
wd->initial_update_completed = false;
|
||||
}
|
||||
|
||||
RID AccessibilityServerAccessKit::create_element(DisplayServer::WindowID p_window_id, AccessibilityServerEnums::AccessibilityRole p_role) {
|
||||
RID AccessibilityServerAccessKit::create_element(DisplayServerEnums::WindowID p_window_id, AccessibilityServerEnums::AccessibilityRole p_role) {
|
||||
AccessibilityElement *ae = memnew(AccessibilityElement);
|
||||
ae->role = _accessibility_role(p_role);
|
||||
ae->window_id = p_window_id;
|
||||
|
|
@ -609,7 +611,7 @@ void AccessibilityServerAccessKit::update_set_focus(const RID &p_id) {
|
|||
}
|
||||
}
|
||||
|
||||
RID AccessibilityServerAccessKit::get_window_root(DisplayServer::WindowID p_window_id) const {
|
||||
RID AccessibilityServerAccessKit::get_window_root(DisplayServerEnums::WindowID p_window_id) const {
|
||||
const WindowData *wd = windows.getptr(p_window_id);
|
||||
ERR_FAIL_NULL_V(wd, RID());
|
||||
|
||||
|
|
@ -617,7 +619,7 @@ RID AccessibilityServerAccessKit::get_window_root(DisplayServer::WindowID p_wind
|
|||
}
|
||||
|
||||
accesskit_tree_update *AccessibilityServerAccessKit::_accessibility_build_tree_update(void *p_user_data) {
|
||||
DisplayServer::WindowID window_id = (DisplayServer::WindowID)(size_t)p_user_data;
|
||||
DisplayServerEnums::WindowID window_id = (DisplayServerEnums::WindowID)(size_t)p_user_data;
|
||||
|
||||
ERR_FAIL_COND_V(!static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows.has(window_id), nullptr);
|
||||
WindowData &wd = static_cast<AccessibilityServerAccessKit *>(get_singleton())->windows[window_id];
|
||||
|
|
@ -654,7 +656,7 @@ accesskit_tree_update *AccessibilityServerAccessKit::_accessibility_build_tree_u
|
|||
void AccessibilityServerAccessKit::update_if_active(const Callable &p_callable) {
|
||||
ERR_FAIL_COND(!p_callable.is_valid());
|
||||
update_cb = p_callable;
|
||||
for (KeyValue<DisplayServer::WindowID, WindowData> &window : windows) {
|
||||
for (KeyValue<DisplayServerEnums::WindowID, WindowData> &window : windows) {
|
||||
#ifdef WINDOWS_ENABLED
|
||||
accesskit_windows_queued_events *events = accesskit_windows_subclassing_adapter_update_if_active(window.value.adapter, _accessibility_build_tree_update, (void *)(size_t)window.key);
|
||||
if (events) {
|
||||
|
|
@ -691,7 +693,7 @@ _FORCE_INLINE_ void AccessibilityServerAccessKit::_ensure_node(const RID &p_id,
|
|||
}
|
||||
}
|
||||
|
||||
void AccessibilityServerAccessKit::set_window_rect(DisplayServer::WindowID p_window_id, const Rect2 &p_rect_out, const Rect2 &p_rect_in) {
|
||||
void AccessibilityServerAccessKit::set_window_rect(DisplayServerEnums::WindowID p_window_id, const Rect2 &p_rect_out, const Rect2 &p_rect_in) {
|
||||
#ifdef LINUXBSD_ENABLED
|
||||
const WindowData *wd = windows.getptr(p_window_id);
|
||||
ERR_FAIL_NULL(wd);
|
||||
|
|
@ -702,7 +704,7 @@ void AccessibilityServerAccessKit::set_window_rect(DisplayServer::WindowID p_win
|
|||
#endif
|
||||
}
|
||||
|
||||
void AccessibilityServerAccessKit::set_window_focused(DisplayServer::WindowID p_window_id, bool p_focused) {
|
||||
void AccessibilityServerAccessKit::set_window_focused(DisplayServerEnums::WindowID p_window_id, bool p_focused) {
|
||||
const WindowData *wd = windows.getptr(p_window_id);
|
||||
ERR_FAIL_NULL(wd);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class AccessibilityServerAccessKit : public AccessibilityServer {
|
|||
struct AccessibilityElement {
|
||||
HashMap<accesskit_action, Callable> actions;
|
||||
|
||||
DisplayServer::WindowID window_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID window_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
RID parent;
|
||||
LocalVector<RID> children;
|
||||
Vector3i run;
|
||||
|
|
@ -94,7 +94,7 @@ class AccessibilityServerAccessKit : public AccessibilityServer {
|
|||
|
||||
RID focus;
|
||||
|
||||
HashMap<DisplayServer::WindowID, WindowData> windows;
|
||||
HashMap<DisplayServerEnums::WindowID, WindowData> windows;
|
||||
|
||||
HashMap<AccessibilityServerEnums::AccessibilityRole, accesskit_role> role_map;
|
||||
HashMap<AccessibilityServerEnums::AccessibilityAction, accesskit_action> action_map;
|
||||
|
|
@ -116,10 +116,10 @@ class AccessibilityServerAccessKit : public AccessibilityServer {
|
|||
public:
|
||||
bool is_supported() const override { return true; }
|
||||
|
||||
bool window_create(DisplayServer::WindowID p_window_id, void *p_handle) override;
|
||||
void window_destroy(DisplayServer::WindowID p_window_id) override;
|
||||
bool window_create(DisplayServerEnums::WindowID p_window_id, void *p_handle) override;
|
||||
void window_destroy(DisplayServerEnums::WindowID p_window_id) override;
|
||||
|
||||
RID create_element(DisplayServer::WindowID p_window_id, AccessibilityServerEnums::AccessibilityRole p_role) override;
|
||||
RID create_element(DisplayServerEnums::WindowID p_window_id, AccessibilityServerEnums::AccessibilityRole p_role) override;
|
||||
RID create_sub_element(const RID &p_parent_rid, AccessibilityServerEnums::AccessibilityRole p_role, int p_insert_pos = -1) override;
|
||||
virtual RID create_sub_text_edit_elements(const RID &p_parent_rid, const RID &p_shaped_text, float p_min_height, int p_insert_pos = -1, bool p_is_last_line = false) override;
|
||||
bool has_element(const RID &p_id) const override;
|
||||
|
|
@ -131,13 +131,13 @@ public:
|
|||
void update_if_active(const Callable &p_callable) override;
|
||||
|
||||
void update_set_focus(const RID &p_id) override;
|
||||
RID get_window_root(DisplayServer::WindowID p_window_id) const override;
|
||||
RID get_window_root(DisplayServerEnums::WindowID p_window_id) const override;
|
||||
|
||||
void set_window_rect(DisplayServer::WindowID p_window_id, const Rect2 &p_rect_out, const Rect2 &p_rect_in) override;
|
||||
void set_window_focused(DisplayServer::WindowID p_window_id, bool p_focused) override;
|
||||
void set_window_callbacks(DisplayServer::WindowID p_window_id, const Callable &p_activate_callable, const Callable &p_deativate_callable) override;
|
||||
void window_activation_completed(DisplayServer::WindowID p_window_id) override;
|
||||
void window_deactivation_completed(DisplayServer::WindowID p_window_id) override;
|
||||
void set_window_rect(DisplayServerEnums::WindowID p_window_id, const Rect2 &p_rect_out, const Rect2 &p_rect_in) override;
|
||||
void set_window_focused(DisplayServerEnums::WindowID p_window_id, bool p_focused) override;
|
||||
void set_window_callbacks(DisplayServerEnums::WindowID p_window_id, const Callable &p_activate_callable, const Callable &p_deativate_callable) override;
|
||||
void window_activation_completed(DisplayServerEnums::WindowID p_window_id) override;
|
||||
void window_deactivation_completed(DisplayServerEnums::WindowID p_window_id) override;
|
||||
|
||||
void update_set_role(const RID &p_id, AccessibilityServerEnums::AccessibilityRole p_role) override;
|
||||
void update_set_name(const RID &p_id, const String &p_name) override;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class DisplayServerAppleEmbedded : public DisplayServer {
|
|||
|
||||
id tts = nullptr;
|
||||
|
||||
DisplayServer::ScreenOrientation screen_orientation;
|
||||
DisplayServerEnums::ScreenOrientation screen_orientation;
|
||||
|
||||
ObjectID window_attached_instance_id;
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ protected:
|
|||
virtual float _screen_current_edr_headroom() const { return 1.0f; }
|
||||
float hardware_reference_luminance_nits = 100.0f;
|
||||
|
||||
DisplayServerAppleEmbedded(const String &p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::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);
|
||||
DisplayServerAppleEmbedded(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
~DisplayServerAppleEmbedded();
|
||||
|
||||
public:
|
||||
|
|
@ -112,16 +112,16 @@ public:
|
|||
|
||||
virtual void process_events() override;
|
||||
|
||||
virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_rect_changed_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_window_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_text_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_drop_files_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
static void _dispatch_input_events(const Ref<InputEvent> &p_event);
|
||||
void send_input_event(const Ref<InputEvent> &p_event) const;
|
||||
void send_input_text(const String &p_text) const;
|
||||
void send_window_event(DisplayServer::WindowEvent p_event) const;
|
||||
void send_window_event(DisplayServerEnums::WindowEvent p_event) const;
|
||||
void _window_callback(const Callable &p_callable, const Variant &p_arg) const;
|
||||
|
||||
void emit_system_theme_changed();
|
||||
|
|
@ -148,7 +148,7 @@ public:
|
|||
|
||||
// MARK: -
|
||||
|
||||
virtual bool has_feature(Feature p_feature) const override;
|
||||
virtual bool has_feature(DisplayServerEnums::Feature p_feature) const override;
|
||||
|
||||
virtual bool tts_is_speaking() const override;
|
||||
virtual bool tts_is_paused() const override;
|
||||
|
|
@ -167,67 +167,67 @@ public:
|
|||
|
||||
virtual int get_screen_count() const override;
|
||||
virtual int get_primary_screen() const override;
|
||||
virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Point2i screen_get_position(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Size2i screen_get_size(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
|
||||
virtual Vector<DisplayServer::WindowID> get_window_list() const override;
|
||||
virtual Vector<DisplayServerEnums::WindowID> get_window_list() const override;
|
||||
|
||||
virtual WindowID get_window_at_screen_position(const Point2i &p_position) const override;
|
||||
virtual DisplayServerEnums::WindowID get_window_at_screen_position(const Point2i &p_position) const override;
|
||||
|
||||
virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual int64_t window_get_native_handle(DisplayServerEnums::HandleType p_handle_type, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_attach_instance_id(ObjectID p_instance, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual ObjectID window_get_attached_instance_id(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_title(const String &p_title, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_title(const String &p_title, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual int window_get_current_screen(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_current_screen(int p_screen, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual Point2i window_get_position_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Point2i window_get_position(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual Point2i window_get_position_with_decorations(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_position(const Point2i &p_position, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual void window_set_transient(WindowID p_window, WindowID p_parent) override;
|
||||
virtual void window_set_transient(DisplayServerEnums::WindowID p_window, DisplayServerEnums::WindowID p_parent) override;
|
||||
|
||||
virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_max_size(const Size2i p_size, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_max_size(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_min_size(const Size2i p_size, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_min_size(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual Size2i window_get_size_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_size(const Size2i p_size, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_size(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual Size2i window_get_size_with_decorations(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_mode(DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServerEnums::WindowMode window_get_mode(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_is_maximize_allowed(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_flag(DisplayServerEnums::WindowFlags p_flag, bool p_enabled, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_get_flag(DisplayServerEnums::WindowFlags p_flag, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_request_attention(WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_request_attention(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_move_to_foreground(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_focused(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual float screen_get_max_scale() const override;
|
||||
|
||||
virtual void screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) override;
|
||||
virtual DisplayServer::ScreenOrientation screen_get_orientation(int p_screen) const override;
|
||||
virtual void screen_set_orientation(DisplayServerEnums::ScreenOrientation p_orientation, int p_screen) override;
|
||||
virtual DisplayServerEnums::ScreenOrientation screen_get_orientation(int p_screen) const override;
|
||||
|
||||
virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_can_draw(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool can_any_window_draw() const override;
|
||||
|
||||
virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_vsync_mode) const override;
|
||||
virtual void window_set_vsync_mode(DisplayServerEnums::VSyncMode p_vsync_mode, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServerEnums::VSyncMode window_get_vsync_mode(DisplayServerEnums::WindowID p_vsync_mode) const override;
|
||||
|
||||
virtual bool is_touchscreen_available() const override;
|
||||
|
||||
virtual void 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) override;
|
||||
virtual void virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect, DisplayServerEnums::VirtualKeyboardType p_type, int p_max_length, int p_cursor_start, int p_cursor_end) override;
|
||||
virtual void virtual_keyboard_hide() override;
|
||||
|
||||
void virtual_keyboard_set_height(int height);
|
||||
|
|
@ -243,20 +243,20 @@ public:
|
|||
// MARK: - HDR / EDR
|
||||
|
||||
void current_edr_headroom_changed();
|
||||
virtual bool window_is_hdr_output_supported(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_request_hdr_output(const bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_hdr_output_requested(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_is_hdr_output_enabled(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_is_hdr_output_supported(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_request_hdr_output(const bool p_enabled, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_hdr_output_requested(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_is_hdr_output_enabled(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_hdr_output_reference_luminance(const float p_reference_luminance, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual float window_get_hdr_output_reference_luminance(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual float window_get_hdr_output_current_reference_luminance(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_hdr_output_reference_luminance(const float p_reference_luminance, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual float window_get_hdr_output_reference_luminance(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual float window_get_hdr_output_current_reference_luminance(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_hdr_output_max_luminance(const float p_max_luminance, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual float window_get_hdr_output_max_luminance(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual float window_get_hdr_output_current_max_luminance(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_hdr_output_max_luminance(const float p_max_luminance, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual float window_get_hdr_output_max_luminance(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual float window_get_hdr_output_current_max_luminance(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual float window_get_output_max_linear_value(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual float window_get_output_max_linear_value(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
void resize_window(CGSize size);
|
||||
virtual void swap_buffers() override {}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ DisplayServerAppleEmbedded *DisplayServerAppleEmbedded::get_singleton() {
|
|||
return (DisplayServerAppleEmbedded *)DisplayServer::get_singleton();
|
||||
}
|
||||
|
||||
DisplayServerAppleEmbedded::DisplayServerAppleEmbedded(const String &p_rendering_driver, WindowMode p_mode, DisplayServer::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) {
|
||||
DisplayServerAppleEmbedded::DisplayServerAppleEmbedded(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error) {
|
||||
KeyMappingAppleEmbedded::initialize();
|
||||
|
||||
rendering_driver = p_rendering_driver;
|
||||
|
|
@ -129,7 +129,7 @@ DisplayServerAppleEmbedded::DisplayServerAppleEmbedded(const String &p_rendering
|
|||
}
|
||||
|
||||
if (rendering_context) {
|
||||
if (rendering_context->window_create(MAIN_WINDOW_ID, &wpd) != OK) {
|
||||
if (rendering_context->window_create(DisplayServerEnums::MAIN_WINDOW_ID, &wpd) != OK) {
|
||||
ERR_PRINT(vformat("Failed to create %s window.", rendering_driver));
|
||||
memdelete(rendering_context);
|
||||
rendering_context = nullptr;
|
||||
|
|
@ -138,18 +138,18 @@ DisplayServerAppleEmbedded::DisplayServerAppleEmbedded(const String &p_rendering
|
|||
}
|
||||
|
||||
Size2i size = Size2i(layer.bounds.size.width, layer.bounds.size.height) * screen_get_max_scale();
|
||||
rendering_context->window_set_size(MAIN_WINDOW_ID, size.width, size.height);
|
||||
rendering_context->window_set_vsync_mode(MAIN_WINDOW_ID, p_vsync_mode);
|
||||
rendering_context->window_set_size(DisplayServerEnums::MAIN_WINDOW_ID, size.width, size.height);
|
||||
rendering_context->window_set_vsync_mode(DisplayServerEnums::MAIN_WINDOW_ID, p_vsync_mode);
|
||||
|
||||
rendering_device = memnew(RenderingDevice);
|
||||
if (rendering_device->initialize(rendering_context, MAIN_WINDOW_ID) != OK) {
|
||||
if (rendering_device->initialize(rendering_context, DisplayServerEnums::MAIN_WINDOW_ID) != OK) {
|
||||
rendering_device = nullptr;
|
||||
memdelete(rendering_context);
|
||||
rendering_context = nullptr;
|
||||
r_error = ERR_UNAVAILABLE;
|
||||
return;
|
||||
}
|
||||
rendering_device->screen_create(MAIN_WINDOW_ID);
|
||||
rendering_device->screen_create(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
|
||||
RendererCompositorRD::make_current();
|
||||
has_made_render_compositor_current = true;
|
||||
|
|
@ -187,13 +187,13 @@ DisplayServerAppleEmbedded::~DisplayServerAppleEmbedded() {
|
|||
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_device) {
|
||||
rendering_device->screen_free(MAIN_WINDOW_ID);
|
||||
rendering_device->screen_free(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
memdelete(rendering_device);
|
||||
rendering_device = nullptr;
|
||||
}
|
||||
|
||||
if (rendering_context) {
|
||||
rendering_context->window_destroy(MAIN_WINDOW_ID);
|
||||
rendering_context->window_destroy(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
memdelete(rendering_context);
|
||||
rendering_context = nullptr;
|
||||
}
|
||||
|
|
@ -220,22 +220,22 @@ Vector<String> DisplayServerAppleEmbedded::get_rendering_drivers_func() {
|
|||
|
||||
// MARK: Events
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_rect_changed_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
window_resize_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_window_event_callback(const Callable &p_callable, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_window_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
window_event_callback = p_callable;
|
||||
}
|
||||
void DisplayServerAppleEmbedded::window_set_input_event_callback(const Callable &p_callable, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_input_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
input_event_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_input_text_callback(const Callable &p_callable, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_input_text_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
input_text_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_drop_files_callback(const Callable &p_callable, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_drop_files_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ void DisplayServerAppleEmbedded::send_input_text(const String &p_text) const {
|
|||
_window_callback(input_text_callback, p_text);
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::send_window_event(DisplayServer::WindowEvent p_event) const {
|
||||
void DisplayServerAppleEmbedded::send_window_event(DisplayServerEnums::WindowEvent p_event) const {
|
||||
_window_callback(window_event_callback, int(p_event));
|
||||
}
|
||||
|
||||
|
|
@ -354,34 +354,34 @@ void DisplayServerAppleEmbedded::update_gyroscope(const Vector3 &p_gyroscope) {
|
|||
|
||||
// MARK: -
|
||||
|
||||
bool DisplayServerAppleEmbedded::has_feature(Feature p_feature) const {
|
||||
bool DisplayServerAppleEmbedded::has_feature(DisplayServerEnums::Feature p_feature) const {
|
||||
switch (p_feature) {
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
case FEATURE_GLOBAL_MENU: {
|
||||
case DisplayServerEnums::FEATURE_GLOBAL_MENU: {
|
||||
return (native_menu && native_menu->has_feature(NativeMenu::FEATURE_GLOBAL_MENU));
|
||||
} break;
|
||||
#endif
|
||||
// case FEATURE_CURSOR_SHAPE:
|
||||
// case FEATURE_CUSTOM_CURSOR_SHAPE:
|
||||
// case FEATURE_HIDPI:
|
||||
// case FEATURE_ICON:
|
||||
// case FEATURE_IME:
|
||||
// case FEATURE_MOUSE:
|
||||
// case FEATURE_MOUSE_WARP:
|
||||
// case FEATURE_NATIVE_DIALOG:
|
||||
// case FEATURE_NATIVE_DIALOG_INPUT:
|
||||
// case FEATURE_NATIVE_DIALOG_FILE:
|
||||
// case FEATURE_NATIVE_DIALOG_FILE_EXTRA:
|
||||
// case FEATURE_NATIVE_DIALOG_FILE_MIME:
|
||||
// case FEATURE_NATIVE_ICON:
|
||||
// case FEATURE_WINDOW_TRANSPARENCY:
|
||||
case FEATURE_CLIPBOARD:
|
||||
case FEATURE_HDR_OUTPUT:
|
||||
case FEATURE_KEEP_SCREEN_ON:
|
||||
case FEATURE_ORIENTATION:
|
||||
case FEATURE_TOUCHSCREEN:
|
||||
case FEATURE_VIRTUAL_KEYBOARD:
|
||||
case FEATURE_TEXT_TO_SPEECH:
|
||||
// case DisplayServerEnums::FEATURE_CURSOR_SHAPE:
|
||||
// case DisplayServerEnums::FEATURE_CUSTOM_CURSOR_SHAPE:
|
||||
// case DisplayServerEnums::FEATURE_HIDPI:
|
||||
// case DisplayServerEnums::FEATURE_ICON:
|
||||
// case DisplayServerEnums::FEATURE_IME:
|
||||
// case DisplayServerEnums::FEATURE_MOUSE:
|
||||
// case DisplayServerEnums::FEATURE_MOUSE_WARP:
|
||||
// case DisplayServerEnums::FEATURE_NATIVE_DIALOG:
|
||||
// case DisplayServerEnums::FEATURE_NATIVE_DIALOG_INPUT:
|
||||
// case DisplayServerEnums::FEATURE_NATIVE_DIALOG_FILE:
|
||||
// case DisplayServerEnums::FEATURE_NATIVE_DIALOG_FILE_EXTRA:
|
||||
// case DisplayServerEnums::FEATURE_NATIVE_DIALOG_FILE_MIME:
|
||||
// case DisplayServerEnums::FEATURE_NATIVE_ICON:
|
||||
// case DisplayServerEnums::FEATURE_WINDOW_TRANSPARENCY:
|
||||
case DisplayServerEnums::FEATURE_CLIPBOARD:
|
||||
case DisplayServerEnums::FEATURE_HDR_OUTPUT:
|
||||
case DisplayServerEnums::FEATURE_KEEP_SCREEN_ON:
|
||||
case DisplayServerEnums::FEATURE_ORIENTATION:
|
||||
case DisplayServerEnums::FEATURE_TOUCHSCREEN:
|
||||
case DisplayServerEnums::FEATURE_VIRTUAL_KEYBOARD:
|
||||
case DisplayServerEnums::FEATURE_TEXT_TO_SPEECH:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
@ -529,26 +529,26 @@ Rect2i DisplayServerAppleEmbedded::screen_get_usable_rect(int p_screen) const {
|
|||
return Rect2i(screen_get_position(p_screen), screen_get_size(p_screen));
|
||||
}
|
||||
|
||||
Vector<DisplayServer::WindowID> DisplayServerAppleEmbedded::get_window_list() const {
|
||||
Vector<DisplayServer::WindowID> list;
|
||||
list.push_back(MAIN_WINDOW_ID);
|
||||
Vector<DisplayServerEnums::WindowID> DisplayServerAppleEmbedded::get_window_list() const {
|
||||
Vector<DisplayServerEnums::WindowID> list;
|
||||
list.push_back(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
return list;
|
||||
}
|
||||
|
||||
DisplayServer::WindowID DisplayServerAppleEmbedded::get_window_at_screen_position(const Point2i &p_position) const {
|
||||
return MAIN_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID DisplayServerAppleEmbedded::get_window_at_screen_position(const Point2i &p_position) const {
|
||||
return DisplayServerEnums::MAIN_WINDOW_ID;
|
||||
}
|
||||
|
||||
int64_t DisplayServerAppleEmbedded::window_get_native_handle(HandleType p_handle_type, WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, 0);
|
||||
int64_t DisplayServerAppleEmbedded::window_get_native_handle(DisplayServerEnums::HandleType p_handle_type, DisplayServerEnums::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != DisplayServerEnums::MAIN_WINDOW_ID, 0);
|
||||
switch (p_handle_type) {
|
||||
case DISPLAY_HANDLE: {
|
||||
case DisplayServerEnums::DISPLAY_HANDLE: {
|
||||
return 0; // Not supported.
|
||||
}
|
||||
case WINDOW_HANDLE: {
|
||||
case DisplayServerEnums::WINDOW_HANDLE: {
|
||||
return (int64_t)GDTAppDelegateService.viewController;
|
||||
}
|
||||
case WINDOW_VIEW: {
|
||||
case DisplayServerEnums::WINDOW_VIEW: {
|
||||
return (int64_t)GDTAppDelegateService.viewController.godotView;
|
||||
}
|
||||
default: {
|
||||
|
|
@ -557,109 +557,109 @@ int64_t DisplayServerAppleEmbedded::window_get_native_handle(HandleType p_handle
|
|||
}
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_attach_instance_id(ObjectID p_instance, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_attach_instance_id(ObjectID p_instance, DisplayServerEnums::WindowID p_window) {
|
||||
window_attached_instance_id = p_instance;
|
||||
}
|
||||
|
||||
ObjectID DisplayServerAppleEmbedded::window_get_attached_instance_id(WindowID p_window) const {
|
||||
ObjectID DisplayServerAppleEmbedded::window_get_attached_instance_id(DisplayServerEnums::WindowID p_window) const {
|
||||
return window_attached_instance_id;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_title(const String &p_title, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_title(const String &p_title, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
int DisplayServerAppleEmbedded::window_get_current_screen(WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, INVALID_SCREEN);
|
||||
int DisplayServerAppleEmbedded::window_get_current_screen(DisplayServerEnums::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != DisplayServerEnums::MAIN_WINDOW_ID, DisplayServerEnums::INVALID_SCREEN);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_current_screen(int p_screen, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_current_screen(int p_screen, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
Point2i DisplayServerAppleEmbedded::window_get_position(WindowID p_window) const {
|
||||
Point2i DisplayServerAppleEmbedded::window_get_position(DisplayServerEnums::WindowID p_window) const {
|
||||
return Point2i();
|
||||
}
|
||||
|
||||
Point2i DisplayServerAppleEmbedded::window_get_position_with_decorations(WindowID p_window) const {
|
||||
Point2i DisplayServerAppleEmbedded::window_get_position_with_decorations(DisplayServerEnums::WindowID p_window) const {
|
||||
return Point2i();
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_position(const Point2i &p_position, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_position(const Point2i &p_position, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for single window iOS app
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_transient(WindowID p_window, WindowID p_parent) {
|
||||
void DisplayServerAppleEmbedded::window_set_transient(DisplayServerEnums::WindowID p_window, DisplayServerEnums::WindowID p_parent) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_max_size(const Size2i p_size, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_max_size(const Size2i p_size, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
Size2i DisplayServerAppleEmbedded::window_get_max_size(WindowID p_window) const {
|
||||
Size2i DisplayServerAppleEmbedded::window_get_max_size(DisplayServerEnums::WindowID p_window) const {
|
||||
return Size2i();
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_min_size(const Size2i p_size, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_min_size(const Size2i p_size, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
Size2i DisplayServerAppleEmbedded::window_get_min_size(WindowID p_window) const {
|
||||
Size2i DisplayServerAppleEmbedded::window_get_min_size(DisplayServerEnums::WindowID p_window) const {
|
||||
return Size2i();
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_size(const Size2i p_size, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_size(const Size2i p_size, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
Size2i DisplayServerAppleEmbedded::window_get_size(WindowID p_window) const {
|
||||
Size2i DisplayServerAppleEmbedded::window_get_size(DisplayServerEnums::WindowID p_window) const {
|
||||
CGRect viewBounds = GDTAppDelegateService.viewController.view.bounds;
|
||||
return Size2i(viewBounds.size.width, viewBounds.size.height) * screen_get_max_scale();
|
||||
}
|
||||
|
||||
Size2i DisplayServerAppleEmbedded::window_get_size_with_decorations(WindowID p_window) const {
|
||||
Size2i DisplayServerAppleEmbedded::window_get_size_with_decorations(DisplayServerEnums::WindowID p_window) const {
|
||||
return window_get_size(p_window);
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_mode(WindowMode p_mode, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_mode(DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
DisplayServer::WindowMode DisplayServerAppleEmbedded::window_get_mode(WindowID p_window) const {
|
||||
return WindowMode::WINDOW_MODE_FULLSCREEN;
|
||||
DisplayServerEnums::WindowMode DisplayServerAppleEmbedded::window_get_mode(DisplayServerEnums::WindowID p_window) const {
|
||||
return DisplayServerEnums::WindowMode::WINDOW_MODE_FULLSCREEN;
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_is_maximize_allowed(WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_is_maximize_allowed(DisplayServerEnums::WindowID p_window) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_flag(DisplayServerEnums::WindowFlags p_flag, bool p_enabled, DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_get_flag(WindowFlags p_flag, WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_get_flag(DisplayServerEnums::WindowFlags p_flag, DisplayServerEnums::WindowID p_window) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_request_attention(WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_request_attention(DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_move_to_foreground(WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_move_to_foreground(DisplayServerEnums::WindowID p_window) {
|
||||
// Probably not supported for iOS
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_is_focused(WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_is_focused(DisplayServerEnums::WindowID p_window) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
float DisplayServerAppleEmbedded::screen_get_max_scale() const {
|
||||
return screen_get_scale(SCREEN_OF_MAIN_WINDOW);
|
||||
return screen_get_scale(DisplayServerEnums::SCREEN_OF_MAIN_WINDOW);
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) {
|
||||
void DisplayServerAppleEmbedded::screen_set_orientation(DisplayServerEnums::ScreenOrientation p_orientation, int p_screen) {
|
||||
p_screen = _get_screen_index(p_screen);
|
||||
int screen_count = get_screen_count();
|
||||
ERR_FAIL_INDEX(p_screen, screen_count);
|
||||
|
|
@ -675,15 +675,15 @@ void DisplayServerAppleEmbedded::screen_set_orientation(DisplayServer::ScreenOri
|
|||
#endif
|
||||
}
|
||||
|
||||
DisplayServer::ScreenOrientation DisplayServerAppleEmbedded::screen_get_orientation(int p_screen) const {
|
||||
DisplayServerEnums::ScreenOrientation DisplayServerAppleEmbedded::screen_get_orientation(int p_screen) const {
|
||||
p_screen = _get_screen_index(p_screen);
|
||||
int screen_count = get_screen_count();
|
||||
ERR_FAIL_INDEX_V(p_screen, screen_count, SCREEN_LANDSCAPE);
|
||||
ERR_FAIL_INDEX_V(p_screen, screen_count, DisplayServerEnums::SCREEN_LANDSCAPE);
|
||||
|
||||
return screen_orientation;
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_can_draw(WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_can_draw(DisplayServerEnums::WindowID p_window) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -705,37 +705,37 @@ _FORCE_INLINE_ int _convert_utf32_offset_to_utf16(const String &p_existing_text,
|
|||
return limit;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::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) {
|
||||
void DisplayServerAppleEmbedded::virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect, DisplayServerEnums::VirtualKeyboardType p_type, int p_max_length, int p_cursor_start, int p_cursor_end) {
|
||||
NSString *existingString = [[NSString alloc] initWithUTF8String:p_existing_text.utf8().get_data()];
|
||||
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeDefault;
|
||||
GDTAppDelegateService.viewController.keyboardView.textContentType = nil;
|
||||
switch (p_type) {
|
||||
case KEYBOARD_TYPE_DEFAULT: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_DEFAULT: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeDefault;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_MULTILINE: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_MULTILINE: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeDefault;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_NUMBER: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_NUMBER: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeNumberPad;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_NUMBER_DECIMAL: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_NUMBER_DECIMAL: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeDecimalPad;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_PHONE: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_PHONE: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypePhonePad;
|
||||
GDTAppDelegateService.viewController.keyboardView.textContentType = UITextContentTypeTelephoneNumber;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_EMAIL_ADDRESS: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_EMAIL_ADDRESS: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeEmailAddress;
|
||||
GDTAppDelegateService.viewController.keyboardView.textContentType = UITextContentTypeEmailAddress;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_PASSWORD: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_PASSWORD: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeDefault;
|
||||
GDTAppDelegateService.viewController.keyboardView.textContentType = UITextContentTypePassword;
|
||||
} break;
|
||||
case KEYBOARD_TYPE_URL: {
|
||||
case DisplayServerEnums::KEYBOARD_TYPE_URL: {
|
||||
GDTAppDelegateService.viewController.keyboardView.keyboardType = UIKeyboardTypeWebSearch;
|
||||
GDTAppDelegateService.viewController.keyboardView.textContentType = UITextContentTypeURL;
|
||||
} break;
|
||||
|
|
@ -794,7 +794,7 @@ void DisplayServerAppleEmbedded::resize_window(CGSize viewSize) {
|
|||
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context) {
|
||||
rendering_context->window_set_size(MAIN_WINDOW_ID, size.x, size.y);
|
||||
rendering_context->window_set_size(DisplayServerEnums::MAIN_WINDOW_ID, size.x, size.y);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -802,7 +802,7 @@ void DisplayServerAppleEmbedded::resize_window(CGSize viewSize) {
|
|||
_window_callback(window_resize_callback, resize_rect);
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_vsync_mode(DisplayServerEnums::VSyncMode p_vsync_mode, DisplayServerEnums::WindowID p_window) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context) {
|
||||
|
|
@ -811,14 +811,14 @@ void DisplayServerAppleEmbedded::window_set_vsync_mode(DisplayServer::VSyncMode
|
|||
#endif
|
||||
}
|
||||
|
||||
DisplayServer::VSyncMode DisplayServerAppleEmbedded::window_get_vsync_mode(WindowID p_window) const {
|
||||
DisplayServerEnums::VSyncMode DisplayServerAppleEmbedded::window_get_vsync_mode(DisplayServerEnums::WindowID p_window) const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context) {
|
||||
return rendering_context->window_get_vsync_mode(p_window);
|
||||
}
|
||||
#endif
|
||||
return DisplayServer::VSYNC_ENABLED;
|
||||
return DisplayServerEnums::VSYNC_ENABLED;
|
||||
}
|
||||
|
||||
// MARK: - HDR / EDR
|
||||
|
|
@ -830,15 +830,15 @@ void DisplayServerAppleEmbedded::_update_hdr_output() {
|
|||
}
|
||||
|
||||
bool desired = edr_requested && _screen_hdr_is_supported();
|
||||
if (rendering_context->window_get_hdr_output_enabled(MAIN_WINDOW_ID) != desired) {
|
||||
rendering_context->window_set_hdr_output_enabled(MAIN_WINDOW_ID, desired);
|
||||
if (rendering_context->window_get_hdr_output_enabled(DisplayServerEnums::MAIN_WINDOW_ID) != desired) {
|
||||
rendering_context->window_set_hdr_output_enabled(DisplayServerEnums::MAIN_WINDOW_ID, desired);
|
||||
}
|
||||
|
||||
float reference_luminance = _calculate_current_reference_luminance();
|
||||
rendering_context->window_set_hdr_output_reference_luminance(MAIN_WINDOW_ID, reference_luminance);
|
||||
rendering_context->window_set_hdr_output_reference_luminance(DisplayServerEnums::MAIN_WINDOW_ID, reference_luminance);
|
||||
|
||||
float max_luminance = _screen_potential_edr_headroom() * hardware_reference_luminance_nits;
|
||||
rendering_context->window_set_hdr_output_max_luminance(MAIN_WINDOW_ID, max_luminance);
|
||||
rendering_context->window_set_hdr_output_max_luminance(DisplayServerEnums::MAIN_WINDOW_ID, max_luminance);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -846,7 +846,7 @@ void DisplayServerAppleEmbedded::current_edr_headroom_changed() {
|
|||
_update_hdr_output();
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_is_hdr_output_supported(WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_is_hdr_output_supported(DisplayServerEnums::WindowID p_window) const {
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_device && !rendering_device->has_feature(RenderingDevice::Features::SUPPORTS_HDR_OUTPUT)) {
|
||||
return false;
|
||||
|
|
@ -855,7 +855,7 @@ bool DisplayServerAppleEmbedded::window_is_hdr_output_supported(WindowID p_windo
|
|||
return _screen_hdr_is_supported();
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_request_hdr_output(const bool p_enabled, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_request_hdr_output(const bool p_enabled, DisplayServerEnums::WindowID p_window) {
|
||||
#if defined(RD_ENABLED)
|
||||
ERR_FAIL_COND_MSG(p_enabled && rendering_device && !rendering_device->has_feature(RenderingDevice::Features::SUPPORTS_HDR_OUTPUT), "HDR output is not supported by the rendering device.");
|
||||
#endif
|
||||
|
|
@ -864,11 +864,11 @@ void DisplayServerAppleEmbedded::window_request_hdr_output(const bool p_enabled,
|
|||
_update_hdr_output();
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_is_hdr_output_requested(WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_is_hdr_output_requested(DisplayServerEnums::WindowID p_window) const {
|
||||
return edr_requested;
|
||||
}
|
||||
|
||||
bool DisplayServerAppleEmbedded::window_is_hdr_output_enabled(WindowID p_window) const {
|
||||
bool DisplayServerAppleEmbedded::window_is_hdr_output_enabled(DisplayServerEnums::WindowID p_window) const {
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context) {
|
||||
return rendering_context->window_get_hdr_output_enabled(p_window);
|
||||
|
|
@ -877,11 +877,11 @@ bool DisplayServerAppleEmbedded::window_is_hdr_output_enabled(WindowID p_window)
|
|||
return false;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_hdr_output_reference_luminance(const float p_reference_luminance, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_hdr_output_reference_luminance(const float p_reference_luminance, DisplayServerEnums::WindowID p_window) {
|
||||
ERR_PRINT_ONCE("Manually setting reference white luminance is not supported on Apple devices, as they provide a user-facing brightness setting that directly controls reference white luminance.");
|
||||
}
|
||||
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_reference_luminance(WindowID p_window) const {
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_reference_luminance(DisplayServerEnums::WindowID p_window) const {
|
||||
return -1.0f; // Always auto-adjusted by the OS on Apple platforms.
|
||||
}
|
||||
|
||||
|
|
@ -891,7 +891,7 @@ float DisplayServerAppleEmbedded::_calculate_current_reference_luminance() const
|
|||
return potential * hardware_reference_luminance_nits / current;
|
||||
}
|
||||
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_current_reference_luminance(WindowID p_window) const {
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_current_reference_luminance(DisplayServerEnums::WindowID p_window) const {
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context) {
|
||||
return rendering_context->window_get_hdr_output_reference_luminance(p_window);
|
||||
|
|
@ -900,19 +900,19 @@ float DisplayServerAppleEmbedded::window_get_hdr_output_current_reference_lumina
|
|||
return 200.0f;
|
||||
}
|
||||
|
||||
void DisplayServerAppleEmbedded::window_set_hdr_output_max_luminance(const float p_max_luminance, WindowID p_window) {
|
||||
void DisplayServerAppleEmbedded::window_set_hdr_output_max_luminance(const float p_max_luminance, DisplayServerEnums::WindowID p_window) {
|
||||
ERR_PRINT_ONCE("Manually setting max luminance is not supported on Apple embedded devices as they provide accurate max luminance values for their built-in screens.");
|
||||
}
|
||||
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_max_luminance(WindowID p_window) const {
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_max_luminance(DisplayServerEnums::WindowID p_window) const {
|
||||
return -1.0f;
|
||||
}
|
||||
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_current_max_luminance(WindowID p_window) const {
|
||||
float DisplayServerAppleEmbedded::window_get_hdr_output_current_max_luminance(DisplayServerEnums::WindowID p_window) const {
|
||||
return _screen_potential_edr_headroom() * hardware_reference_luminance_nits;
|
||||
}
|
||||
|
||||
float DisplayServerAppleEmbedded::window_get_output_max_linear_value(WindowID p_window) const {
|
||||
float DisplayServerAppleEmbedded::window_get_output_max_linear_value(DisplayServerEnums::WindowID p_window) const {
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context) {
|
||||
return rendering_context->window_get_output_max_linear_value(p_window);
|
||||
|
|
|
|||
|
|
@ -281,10 +281,10 @@
|
|||
return NO;
|
||||
}
|
||||
|
||||
switch (DisplayServerAppleEmbedded::get_singleton()->screen_get_orientation(DisplayServer::SCREEN_OF_MAIN_WINDOW)) {
|
||||
case DisplayServer::SCREEN_SENSOR:
|
||||
case DisplayServer::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServer::SCREEN_SENSOR_PORTRAIT:
|
||||
switch (DisplayServerAppleEmbedded::get_singleton()->screen_get_orientation(DisplayServerEnums::SCREEN_OF_MAIN_WINDOW)) {
|
||||
case DisplayServerEnums::SCREEN_SENSOR:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_PORTRAIT:
|
||||
return YES;
|
||||
default:
|
||||
return NO;
|
||||
|
|
@ -296,24 +296,24 @@
|
|||
return UIInterfaceOrientationMaskAll;
|
||||
}
|
||||
|
||||
switch (DisplayServerAppleEmbedded::get_singleton()->screen_get_orientation(DisplayServer::SCREEN_OF_MAIN_WINDOW)) {
|
||||
case DisplayServer::SCREEN_PORTRAIT:
|
||||
switch (DisplayServerAppleEmbedded::get_singleton()->screen_get_orientation(DisplayServerEnums::SCREEN_OF_MAIN_WINDOW)) {
|
||||
case DisplayServerEnums::SCREEN_PORTRAIT:
|
||||
return UIInterfaceOrientationMaskPortrait;
|
||||
case DisplayServer::SCREEN_REVERSE_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_LANDSCAPE:
|
||||
if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
|
||||
return UIInterfaceOrientationMaskLandscapeLeft;
|
||||
} else {
|
||||
return UIInterfaceOrientationMaskLandscapeRight;
|
||||
}
|
||||
case DisplayServer::SCREEN_REVERSE_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_PORTRAIT:
|
||||
return UIInterfaceOrientationMaskPortraitUpsideDown;
|
||||
case DisplayServer::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_LANDSCAPE:
|
||||
return UIInterfaceOrientationMaskLandscape;
|
||||
case DisplayServer::SCREEN_SENSOR_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_PORTRAIT:
|
||||
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
|
||||
case DisplayServer::SCREEN_SENSOR:
|
||||
case DisplayServerEnums::SCREEN_SENSOR:
|
||||
return UIInterfaceOrientationMaskAll;
|
||||
case DisplayServer::SCREEN_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_LANDSCAPE:
|
||||
if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
|
||||
return UIInterfaceOrientationMaskLandscapeRight;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -761,7 +761,7 @@ void OS_AppleEmbedded::on_focus_out() {
|
|||
is_focused = false;
|
||||
|
||||
if (DisplayServerAppleEmbedded::get_singleton()) {
|
||||
DisplayServerAppleEmbedded::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_OUT);
|
||||
DisplayServerAppleEmbedded::get_singleton()->send_window_event(DisplayServerEnums::WINDOW_EVENT_FOCUS_OUT);
|
||||
}
|
||||
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
|
|
@ -779,7 +779,7 @@ void OS_AppleEmbedded::on_focus_in() {
|
|||
is_focused = true;
|
||||
|
||||
if (DisplayServerAppleEmbedded::get_singleton()) {
|
||||
DisplayServerAppleEmbedded::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_IN);
|
||||
DisplayServerAppleEmbedded::get_singleton()->send_window_event(DisplayServerEnums::WINDOW_EVENT_FOCUS_IN);
|
||||
}
|
||||
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/list.h"
|
||||
#include "core/variant/array.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#if __has_include(<AVFAudio/AVSpeechSynthesis.h>)
|
||||
#import <AVFAudio/AVSpeechSynthesis.h>
|
||||
|
|
@ -42,12 +41,14 @@
|
|||
#import <AVFoundation/AVFoundation.h>
|
||||
#endif
|
||||
|
||||
struct TTSUtterance;
|
||||
|
||||
@interface GDTTTS : NSObject <AVSpeechSynthesizerDelegate> {
|
||||
bool speaking;
|
||||
HashMap<id, int64_t> ids;
|
||||
|
||||
AVSpeechSynthesizer *av_synth;
|
||||
List<DisplayServer::TTSUtterance> queue;
|
||||
List<TTSUtterance> queue;
|
||||
}
|
||||
|
||||
- (void)pauseSpeaking;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#import "tts_apple_embedded.h"
|
||||
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
@implementation GDTTTS
|
||||
|
||||
- (id)init {
|
||||
|
|
@ -54,18 +56,18 @@
|
|||
pos++;
|
||||
}
|
||||
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, ids[utterance], pos);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_BOUNDARY, ids[utterance], pos);
|
||||
}
|
||||
|
||||
- (void)speechSynthesizer:(AVSpeechSynthesizer *)av_synth didCancelSpeechUtterance:(AVSpeechUtterance *)utterance {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[utterance]);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, ids[utterance]);
|
||||
ids.erase(utterance);
|
||||
speaking = false;
|
||||
[self update];
|
||||
}
|
||||
|
||||
- (void)speechSynthesizer:(AVSpeechSynthesizer *)av_synth didFinishSpeechUtterance:(AVSpeechUtterance *)utterance {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, ids[utterance]);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_ENDED, ids[utterance]);
|
||||
ids.erase(utterance);
|
||||
speaking = false;
|
||||
[self update];
|
||||
|
|
@ -73,7 +75,7 @@
|
|||
|
||||
- (void)update {
|
||||
if (!speaking && queue.size() > 0) {
|
||||
DisplayServer::TTSUtterance &message = queue.front()->get();
|
||||
TTSUtterance &message = queue.front()->get();
|
||||
|
||||
AVSpeechUtterance *new_utterance = [[AVSpeechUtterance alloc] initWithString:[NSString stringWithUTF8String:message.text.utf8().get_data()]];
|
||||
[new_utterance setVoice:[AVSpeechSynthesisVoice voiceWithIdentifier:[NSString stringWithUTF8String:message.voice.utf8().get_data()]]];
|
||||
|
|
@ -87,7 +89,7 @@
|
|||
|
||||
ids[new_utterance] = message.id;
|
||||
[av_synth speakUtterance:new_utterance];
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, message.id);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_STARTED, message.id);
|
||||
|
||||
queue.pop_front();
|
||||
speaking = true;
|
||||
|
|
@ -103,8 +105,8 @@
|
|||
}
|
||||
|
||||
- (void)stopSpeaking {
|
||||
for (DisplayServer::TTSUtterance &message : queue) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id);
|
||||
for (TTSUtterance &message : queue) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, message.id);
|
||||
}
|
||||
queue.clear();
|
||||
[av_synth stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
|
||||
|
|
@ -125,11 +127,11 @@
|
|||
}
|
||||
|
||||
if (text.is_empty()) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, utterance_id);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, utterance_id);
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayServer::TTSUtterance message;
|
||||
TTSUtterance message;
|
||||
message.text = text;
|
||||
message.voice = voice;
|
||||
message.volume = CLAMP(volume, 0, 100);
|
||||
|
|
|
|||
|
|
@ -278,13 +278,13 @@ void RenderingContextDriverD3D12::surface_set_size(SurfaceID p_surface, uint32_t
|
|||
surface->needs_resize = true;
|
||||
}
|
||||
|
||||
void RenderingContextDriverD3D12::surface_set_vsync_mode(SurfaceID p_surface, DisplayServer::VSyncMode p_vsync_mode) {
|
||||
void RenderingContextDriverD3D12::surface_set_vsync_mode(SurfaceID p_surface, DisplayServerEnums::VSyncMode p_vsync_mode) {
|
||||
Surface *surface = (Surface *)(p_surface);
|
||||
surface->vsync_mode = p_vsync_mode;
|
||||
surface->needs_resize = true;
|
||||
}
|
||||
|
||||
DisplayServer::VSyncMode RenderingContextDriverD3D12::surface_get_vsync_mode(SurfaceID p_surface) const {
|
||||
DisplayServerEnums::VSyncMode RenderingContextDriverD3D12::surface_get_vsync_mode(SurfaceID p_surface) const {
|
||||
Surface *surface = (Surface *)(p_surface);
|
||||
return surface->vsync_mode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include "core/string/ustring.h"
|
||||
#include "core/templates/rid_owner.h"
|
||||
#include "rendering_device_driver_d3d12.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/display/display_server_enums.h"
|
||||
#include "servers/rendering/rendering_context_driver.h"
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__REQUIRED_RPCNDR_H_VERSION__)
|
||||
|
|
@ -92,8 +92,8 @@ public:
|
|||
virtual void driver_free(RenderingDeviceDriver *p_driver) override;
|
||||
virtual SurfaceID surface_create(const void *p_platform_data) override;
|
||||
virtual void surface_set_size(SurfaceID p_surface, uint32_t p_width, uint32_t p_height) override;
|
||||
virtual void surface_set_vsync_mode(SurfaceID p_surface, DisplayServer::VSyncMode p_vsync_mode) override;
|
||||
virtual DisplayServer::VSyncMode surface_get_vsync_mode(SurfaceID p_surface) const override;
|
||||
virtual void surface_set_vsync_mode(SurfaceID p_surface, DisplayServerEnums::VSyncMode p_vsync_mode) override;
|
||||
virtual DisplayServerEnums::VSyncMode surface_get_vsync_mode(SurfaceID p_surface) const override;
|
||||
virtual void surface_set_hdr_output_enabled(SurfaceID p_surface, bool p_enabled) override;
|
||||
virtual bool surface_get_hdr_output_enabled(SurfaceID p_surface) const override;
|
||||
virtual void surface_set_hdr_output_reference_luminance(SurfaceID p_surface, float p_reference_luminance) override;
|
||||
|
|
@ -120,7 +120,7 @@ public:
|
|||
HWND hwnd = nullptr;
|
||||
uint32_t width = 0;
|
||||
uint32_t height = 0;
|
||||
DisplayServer::VSyncMode vsync_mode = DisplayServer::VSYNC_ENABLED;
|
||||
DisplayServerEnums::VSyncMode vsync_mode = DisplayServerEnums::VSYNC_ENABLED;
|
||||
bool needs_resize = false;
|
||||
|
||||
bool hdr_output = false;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,11 @@
|
|||
|
||||
#include "d3d12_hooks.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/io/marshalls.h"
|
||||
#include "core/os/os.h"
|
||||
|
||||
#include "thirdparty/zlib/zlib.h"
|
||||
|
||||
#include "d3d12_godot_nir_bridge.h"
|
||||
|
|
@ -2793,20 +2796,20 @@ Error RenderingDeviceDriverD3D12::swap_chain_resize(CommandQueueID p_cmd_queue,
|
|||
UINT present_flags = 0;
|
||||
UINT creation_flags = 0;
|
||||
switch (surface->vsync_mode) {
|
||||
case DisplayServer::VSYNC_MAILBOX: {
|
||||
case DisplayServerEnums::VSYNC_MAILBOX: {
|
||||
sync_interval = 1;
|
||||
present_flags = DXGI_PRESENT_RESTART;
|
||||
} break;
|
||||
case DisplayServer::VSYNC_ENABLED: {
|
||||
case DisplayServerEnums::VSYNC_ENABLED: {
|
||||
sync_interval = 1;
|
||||
present_flags = 0;
|
||||
} break;
|
||||
case DisplayServer::VSYNC_DISABLED: {
|
||||
case DisplayServerEnums::VSYNC_DISABLED: {
|
||||
sync_interval = 0;
|
||||
present_flags = is_tearing_supported ? DXGI_PRESENT_ALLOW_TEARING : 0;
|
||||
creation_flags = is_tearing_supported ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0;
|
||||
} break;
|
||||
case DisplayServer::VSYNC_ADAPTIVE: // Unsupported.
|
||||
case DisplayServerEnums::VSYNC_ADAPTIVE: // Unsupported.
|
||||
default:
|
||||
sync_interval = 1;
|
||||
present_flags = 0;
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@
|
|||
|
||||
#include "egl_manager.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/crypto/crypto_core.h"
|
||||
#include "core/io/dir_access.h"
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/os/os.h"
|
||||
|
||||
#ifdef WINDOWS_ENABLED
|
||||
#include "drivers/gles3/rasterizer_gles3.h"
|
||||
|
|
@ -252,7 +254,7 @@ int EGLManager::display_get_native_visual_id(void *p_display) {
|
|||
return native_visual_id;
|
||||
}
|
||||
|
||||
Error EGLManager::window_create(DisplayServer::WindowID p_window_id, void *p_display, void *p_native_window, int p_width, int p_height) {
|
||||
Error EGLManager::window_create(DisplayServerEnums::WindowID p_window_id, void *p_display, void *p_native_window, int p_width, int p_height) {
|
||||
int gldisplay_id = _get_gldisplay_id(p_display);
|
||||
ERR_FAIL_COND_V(gldisplay_id < 0, ERR_CANT_CREATE);
|
||||
|
||||
|
|
@ -320,7 +322,7 @@ Error EGLManager::window_create(DisplayServer::WindowID p_window_id, void *p_dis
|
|||
return OK;
|
||||
}
|
||||
|
||||
void EGLManager::window_destroy(DisplayServer::WindowID p_window_id) {
|
||||
void EGLManager::window_destroy(DisplayServerEnums::WindowID p_window_id) {
|
||||
ERR_FAIL_INDEX(p_window_id, (int)windows.size());
|
||||
|
||||
GLWindow &glwindow = windows[p_window_id];
|
||||
|
|
@ -365,8 +367,8 @@ void EGLManager::swap_buffers() {
|
|||
eglSwapBuffers(current_display.egl_display, current_window->egl_surface);
|
||||
}
|
||||
|
||||
void EGLManager::window_make_current(DisplayServer::WindowID p_window_id) {
|
||||
if (p_window_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
void EGLManager::window_make_current(DisplayServerEnums::WindowID p_window_id) {
|
||||
if (p_window_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +410,7 @@ bool EGLManager::is_using_vsync() const {
|
|||
return use_vsync;
|
||||
}
|
||||
|
||||
EGLContext EGLManager::get_context(DisplayServer::WindowID p_window_id) {
|
||||
EGLContext EGLManager::get_context(DisplayServerEnums::WindowID p_window_id) {
|
||||
GLWindow &glwindow = windows[p_window_id];
|
||||
|
||||
if (!glwindow.initialized) {
|
||||
|
|
@ -420,7 +422,7 @@ EGLContext EGLManager::get_context(DisplayServer::WindowID p_window_id) {
|
|||
return display.egl_context;
|
||||
}
|
||||
|
||||
EGLDisplay EGLManager::get_display(DisplayServer::WindowID p_window_id) {
|
||||
EGLDisplay EGLManager::get_display(DisplayServerEnums::WindowID p_window_id) {
|
||||
GLWindow &glwindow = windows[p_window_id];
|
||||
|
||||
if (!glwindow.initialized) {
|
||||
|
|
@ -432,7 +434,7 @@ EGLDisplay EGLManager::get_display(DisplayServer::WindowID p_window_id) {
|
|||
return display.egl_display;
|
||||
}
|
||||
|
||||
EGLConfig EGLManager::get_config(DisplayServer::WindowID p_window_id) {
|
||||
EGLConfig EGLManager::get_config(DisplayServerEnums::WindowID p_window_id) {
|
||||
GLWindow &glwindow = windows[p_window_id];
|
||||
|
||||
if (!glwindow.initialized) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include "platform_gl.h"
|
||||
|
||||
#include "core/templates/local_vector.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/display/display_server_enums.h"
|
||||
|
||||
class EGLManager {
|
||||
private:
|
||||
|
|
@ -95,21 +95,21 @@ public:
|
|||
int display_get_native_visual_id(void *p_display);
|
||||
|
||||
Error open_display(void *p_display);
|
||||
Error window_create(DisplayServer::WindowID p_window_id, void *p_display, void *p_native_window, int p_width, int p_height);
|
||||
Error window_create(DisplayServerEnums::WindowID p_window_id, void *p_display, void *p_native_window, int p_width, int p_height);
|
||||
|
||||
void window_destroy(DisplayServer::WindowID p_window_id);
|
||||
void window_destroy(DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
void release_current();
|
||||
void swap_buffers();
|
||||
|
||||
void window_make_current(DisplayServer::WindowID p_window_id);
|
||||
void window_make_current(DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
void set_use_vsync(bool p_use);
|
||||
bool is_using_vsync() const;
|
||||
|
||||
EGLContext get_context(DisplayServer::WindowID p_window_id);
|
||||
EGLDisplay get_display(DisplayServer::WindowID p_window_id);
|
||||
EGLConfig get_config(DisplayServer::WindowID p_window_id);
|
||||
EGLContext get_context(DisplayServerEnums::WindowID p_window_id);
|
||||
EGLDisplay get_display(DisplayServerEnums::WindowID p_window_id);
|
||||
EGLConfig get_config(DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
Error initialize(void *p_native_display = nullptr);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "core/io/dir_access.h"
|
||||
#include "core/io/image.h"
|
||||
#include "core/os/os.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
#include "servers/rendering/rendering_server_types.h"
|
||||
|
||||
|
|
@ -367,7 +368,7 @@ RasterizerGLES3::RasterizerGLES3() {
|
|||
RasterizerGLES3::~RasterizerGLES3() {
|
||||
}
|
||||
|
||||
void RasterizerGLES3::_blit_render_target_to_screen(DisplayServer::WindowID p_screen, const RenderingServerTypes::BlitToScreen &p_blit, bool p_first) {
|
||||
void RasterizerGLES3::_blit_render_target_to_screen(DisplayServerEnums::WindowID p_screen, const RenderingServerTypes::BlitToScreen &p_blit, bool p_first) {
|
||||
GLES3::RenderTarget *rt = GLES3::TextureStorage::get_singleton()->get_render_target(p_blit.render_target);
|
||||
|
||||
ERR_FAIL_NULL(rt);
|
||||
|
|
@ -442,7 +443,7 @@ void RasterizerGLES3::_blit_render_target_to_screen(DisplayServer::WindowID p_sc
|
|||
}
|
||||
|
||||
// is this p_screen useless in a multi window environment?
|
||||
void RasterizerGLES3::blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const RenderingServerTypes::BlitToScreen *p_render_targets, int p_amount) {
|
||||
void RasterizerGLES3::blit_render_targets_to_screen(DisplayServerEnums::WindowID p_screen, const RenderingServerTypes::BlitToScreen *p_render_targets, int p_amount) {
|
||||
for (int i = 0; i < p_amount; i++) {
|
||||
_blit_render_target_to_screen(p_screen, p_render_targets[i], i == 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#ifdef GLES3_ENABLED
|
||||
|
||||
#include "core/os/os.h"
|
||||
#include "drivers/gles3/effects/copy_effects.h"
|
||||
#include "drivers/gles3/effects/cubemap_filter.h"
|
||||
#include "drivers/gles3/effects/feed_effects.h"
|
||||
|
|
@ -81,7 +82,7 @@ protected:
|
|||
RasterizerSceneGLES3 *scene = nullptr;
|
||||
static RasterizerGLES3 *singleton;
|
||||
|
||||
void _blit_render_target_to_screen(DisplayServer::WindowID p_screen, const RenderingServerTypes::BlitToScreen &p_blit, bool p_first = true);
|
||||
void _blit_render_target_to_screen(DisplayServerEnums::WindowID p_screen, const RenderingServerTypes::BlitToScreen &p_blit, bool p_first = true);
|
||||
|
||||
public:
|
||||
RendererUtilities *get_utilities() { return utilities; }
|
||||
|
|
@ -100,7 +101,7 @@ public:
|
|||
void initialize();
|
||||
void begin_frame(double frame_step);
|
||||
|
||||
void blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const RenderingServerTypes::BlitToScreen *p_render_targets, int p_amount);
|
||||
void blit_render_targets_to_screen(DisplayServerEnums::WindowID p_screen, const RenderingServerTypes::BlitToScreen *p_render_targets, int p_amount);
|
||||
|
||||
bool is_opengl() { return true; }
|
||||
void gl_end_frame(bool p_swap_buffers);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#ifdef GLES3_ENABLED
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "drivers/gles3/effects/copy_effects.h"
|
||||
#include "drivers/gles3/rasterizer_gles3.h"
|
||||
#include "drivers/gles3/rasterizer_util_gles3.h"
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
#ifdef GLES3_ENABLED
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/os/os.h"
|
||||
#include "drivers/gles3/rasterizer_util_gles3.h"
|
||||
#include "drivers/gles3/storage/config.h"
|
||||
#include "drivers/gles3/storage/light_storage.h"
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
|
||||
#include "metal_utils.h"
|
||||
|
||||
#include "core/os/os.h"
|
||||
#include "servers/rendering/renderer_rd/effects/metal_fx.h"
|
||||
|
||||
#include <MetalFX/MetalFX.hpp>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "metal_objects_shared.h"
|
||||
#include "rendering_device_driver_metal3.h"
|
||||
|
||||
#include "core/os/os.h"
|
||||
#include "core/templates/sort_array.h"
|
||||
|
||||
#include <os/log.h>
|
||||
|
|
@ -138,12 +139,12 @@ public:
|
|||
#if TARGET_OS_OSX
|
||||
// Display sync is only supported on macOS.
|
||||
switch (vsync_mode) {
|
||||
case DisplayServer::VSYNC_MAILBOX:
|
||||
case DisplayServer::VSYNC_ADAPTIVE:
|
||||
case DisplayServer::VSYNC_ENABLED:
|
||||
case DisplayServerEnums::VSYNC_MAILBOX:
|
||||
case DisplayServerEnums::VSYNC_ADAPTIVE:
|
||||
case DisplayServerEnums::VSYNC_ENABLED:
|
||||
layer->setDisplaySyncEnabled(true);
|
||||
break;
|
||||
case DisplayServer::VSYNC_DISABLED:
|
||||
case DisplayServerEnums::VSYNC_DISABLED:
|
||||
layer->setDisplaySyncEnabled(false);
|
||||
break;
|
||||
}
|
||||
|
|
@ -212,7 +213,7 @@ public:
|
|||
count--;
|
||||
front = (front + 1) % frame_buffers.size();
|
||||
|
||||
if (vsync_mode != DisplayServer::VSYNC_DISABLED) {
|
||||
if (vsync_mode != DisplayServerEnums::VSYNC_DISABLED) {
|
||||
p_cmd_buffer->get_command_buffer()->presentDrawableAfterMinimumDuration(drawable, present_minimum_duration);
|
||||
} else {
|
||||
p_cmd_buffer->get_command_buffer()->presentDrawable(drawable);
|
||||
|
|
@ -385,7 +386,7 @@ void RenderingContextDriverMetal::surface_set_size(SurfaceID p_surface, uint32_t
|
|||
surface->needs_resize = true;
|
||||
}
|
||||
|
||||
void RenderingContextDriverMetal::surface_set_vsync_mode(SurfaceID p_surface, DisplayServer::VSyncMode p_vsync_mode) {
|
||||
void RenderingContextDriverMetal::surface_set_vsync_mode(SurfaceID p_surface, DisplayServerEnums::VSyncMode p_vsync_mode) {
|
||||
Surface *surface = (Surface *)(p_surface);
|
||||
if (surface->vsync_mode == p_vsync_mode) {
|
||||
return;
|
||||
|
|
@ -394,7 +395,7 @@ void RenderingContextDriverMetal::surface_set_vsync_mode(SurfaceID p_surface, Di
|
|||
surface->needs_resize = true;
|
||||
}
|
||||
|
||||
DisplayServer::VSyncMode RenderingContextDriverMetal::surface_get_vsync_mode(SurfaceID p_surface) const {
|
||||
DisplayServerEnums::VSyncMode RenderingContextDriverMetal::surface_get_vsync_mode(SurfaceID p_surface) const {
|
||||
Surface *surface = (Surface *)(p_surface);
|
||||
return surface->vsync_mode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ public:
|
|||
void driver_free(RenderingDeviceDriver *p_driver) final override;
|
||||
SurfaceID surface_create(const void *p_platform_data) final override;
|
||||
void surface_set_size(SurfaceID p_surface, uint32_t p_width, uint32_t p_height) final override;
|
||||
void surface_set_vsync_mode(SurfaceID p_surface, DisplayServer::VSyncMode p_vsync_mode) final override;
|
||||
DisplayServer::VSyncMode surface_get_vsync_mode(SurfaceID p_surface) const final override;
|
||||
void surface_set_vsync_mode(SurfaceID p_surface, DisplayServerEnums::VSyncMode p_vsync_mode) final override;
|
||||
DisplayServerEnums::VSyncMode surface_get_vsync_mode(SurfaceID p_surface) const final override;
|
||||
virtual void surface_set_hdr_output_enabled(SurfaceID p_surface, bool p_enabled) final override;
|
||||
virtual bool surface_get_hdr_output_enabled(SurfaceID p_surface) const final override;
|
||||
virtual void surface_set_hdr_output_reference_luminance(SurfaceID p_surface, float p_reference_luminance) final override;
|
||||
|
|
@ -90,7 +90,7 @@ public:
|
|||
public:
|
||||
uint32_t width = 0;
|
||||
uint32_t height = 0;
|
||||
DisplayServer::VSyncMode vsync_mode = DisplayServer::VSYNC_ENABLED;
|
||||
DisplayServerEnums::VSyncMode vsync_mode = DisplayServerEnums::VSYNC_ENABLED;
|
||||
double present_minimum_duration = 0.0;
|
||||
MTL::PixelFormat pixel_format = MTL::PixelFormatBGRA8Unorm;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/io/marshalls.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/string/ustring.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "drivers/apple/foundation_helpers.h"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "rendering_context_driver_metal.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/string/ustring.h"
|
||||
|
||||
namespace MTL3 {
|
||||
|
|
@ -243,7 +244,7 @@ Error RenderingDeviceDriverMetal::_execute_and_present_barriers(CommandQueueID p
|
|||
|
||||
struct DrawRequest {
|
||||
NS::SharedPtr<MTL::Drawable> drawable;
|
||||
DisplayServer::VSyncMode vsync_mode;
|
||||
DisplayServerEnums::VSyncMode vsync_mode;
|
||||
double duration;
|
||||
};
|
||||
|
||||
|
|
@ -268,7 +269,7 @@ Error RenderingDeviceDriverMetal::_execute_and_present_barriers(CommandQueueID p
|
|||
cb->addCompletedHandler([drawables = std::move(drawables)](MTL::CommandBuffer *) {
|
||||
for (const DrawRequest &dr : drawables) {
|
||||
switch (dr.vsync_mode) {
|
||||
case DisplayServer::VSYNC_DISABLED: {
|
||||
case DisplayServerEnums::VSYNC_DISABLED: {
|
||||
dr.drawable->present();
|
||||
} break;
|
||||
default: {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/io/marshalls.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/templates/fixed_vector.h"
|
||||
|
||||
#include "thirdparty/spirv-reflect/spirv_reflect.h"
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@
|
|||
|
||||
#include "vk_enum_string_helper.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/version.h"
|
||||
|
||||
#include "rendering_device_driver_vulkan.h"
|
||||
|
|
@ -983,13 +985,13 @@ void RenderingContextDriverVulkan::surface_set_size(SurfaceID p_surface, uint32_
|
|||
surface->needs_resize = true;
|
||||
}
|
||||
|
||||
void RenderingContextDriverVulkan::surface_set_vsync_mode(SurfaceID p_surface, DisplayServer::VSyncMode p_vsync_mode) {
|
||||
void RenderingContextDriverVulkan::surface_set_vsync_mode(SurfaceID p_surface, DisplayServerEnums::VSyncMode p_vsync_mode) {
|
||||
Surface *surface = (Surface *)(p_surface);
|
||||
surface->vsync_mode = p_vsync_mode;
|
||||
surface->needs_resize = true;
|
||||
}
|
||||
|
||||
DisplayServer::VSyncMode RenderingContextDriverVulkan::surface_get_vsync_mode(SurfaceID p_surface) const {
|
||||
DisplayServerEnums::VSyncMode RenderingContextDriverVulkan::surface_get_vsync_mode(SurfaceID p_surface) const {
|
||||
Surface *surface = (Surface *)(p_surface);
|
||||
return surface->vsync_mode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
#ifdef VULKAN_ENABLED
|
||||
|
||||
#include "core/templates/hash_set.h"
|
||||
#include "core/templates/local_vector.h"
|
||||
#include "servers/rendering/rendering_context_driver.h"
|
||||
|
||||
#if defined(DEBUG_ENABLED) || defined(DEV_ENABLED)
|
||||
|
|
@ -136,8 +138,8 @@ public:
|
|||
virtual void driver_free(RenderingDeviceDriver *p_driver) override;
|
||||
virtual SurfaceID surface_create(const void *p_platform_data) override;
|
||||
virtual void surface_set_size(SurfaceID p_surface, uint32_t p_width, uint32_t p_height) override;
|
||||
virtual void surface_set_vsync_mode(SurfaceID p_surface, DisplayServer::VSyncMode p_vsync_mode) override;
|
||||
virtual DisplayServer::VSyncMode surface_get_vsync_mode(SurfaceID p_surface) const override;
|
||||
virtual void surface_set_vsync_mode(SurfaceID p_surface, DisplayServerEnums::VSyncMode p_vsync_mode) override;
|
||||
virtual DisplayServerEnums::VSyncMode surface_get_vsync_mode(SurfaceID p_surface) const override;
|
||||
virtual void surface_set_hdr_output_enabled(SurfaceID p_surface, bool p_enabled) override;
|
||||
virtual bool surface_get_hdr_output_enabled(SurfaceID p_surface) const override;
|
||||
virtual void surface_set_hdr_output_reference_luminance(SurfaceID p_surface, float p_reference_luminance) override;
|
||||
|
|
@ -160,7 +162,7 @@ public:
|
|||
VkSurfaceKHR vk_surface = VK_NULL_HANDLE;
|
||||
uint32_t width = 0;
|
||||
uint32_t height = 0;
|
||||
DisplayServer::VSyncMode vsync_mode = DisplayServer::VSYNC_ENABLED;
|
||||
DisplayServerEnums::VSyncMode vsync_mode = DisplayServerEnums::VSYNC_ENABLED;
|
||||
bool needs_resize = false;
|
||||
|
||||
bool hdr_output = false;
|
||||
|
|
|
|||
|
|
@ -30,8 +30,10 @@
|
|||
|
||||
#include "rendering_device_driver_vulkan.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/io/marshalls.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/templates/fixed_vector.h"
|
||||
#include "vulkan_hooks.h"
|
||||
|
||||
|
|
@ -3627,19 +3629,19 @@ Error RenderingDeviceDriverVulkan::swap_chain_resize(CommandQueueID p_cmd_queue,
|
|||
VkPresentModeKHR present_mode = VkPresentModeKHR::VK_PRESENT_MODE_FIFO_KHR;
|
||||
String present_mode_name = "Enabled";
|
||||
switch (surface->vsync_mode) {
|
||||
case DisplayServer::VSYNC_MAILBOX:
|
||||
case DisplayServerEnums::VSYNC_MAILBOX:
|
||||
present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
|
||||
present_mode_name = "Mailbox";
|
||||
break;
|
||||
case DisplayServer::VSYNC_ADAPTIVE:
|
||||
case DisplayServerEnums::VSYNC_ADAPTIVE:
|
||||
present_mode = VK_PRESENT_MODE_FIFO_RELAXED_KHR;
|
||||
present_mode_name = "Adaptive";
|
||||
break;
|
||||
case DisplayServer::VSYNC_ENABLED:
|
||||
case DisplayServerEnums::VSYNC_ENABLED:
|
||||
present_mode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
present_mode_name = "Enabled";
|
||||
break;
|
||||
case DisplayServer::VSYNC_DISABLED:
|
||||
case DisplayServerEnums::VSYNC_DISABLED:
|
||||
present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR;
|
||||
present_mode_name = "Disabled";
|
||||
break;
|
||||
|
|
@ -3649,7 +3651,7 @@ Error RenderingDeviceDriverVulkan::swap_chain_resize(CommandQueueID p_cmd_queue,
|
|||
if (!present_mode_available) {
|
||||
// Present mode is not available, fall back to FIFO which is guaranteed to be supported.
|
||||
WARN_PRINT(vformat("The requested V-Sync mode %s is not available. Falling back to V-Sync mode Enabled.", present_mode_name));
|
||||
surface->vsync_mode = DisplayServer::VSYNC_ENABLED;
|
||||
surface->vsync_mode = DisplayServerEnums::VSYNC_ENABLED;
|
||||
present_mode = VkPresentModeKHR::VK_PRESENT_MODE_FIFO_KHR;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
#include "drivers/vulkan/godot_vulkan.h"
|
||||
|
||||
class FileAccess;
|
||||
|
||||
// Design principles:
|
||||
// - Vulkan structs are zero-initialized and fields not requiring a non-zero value are omitted (except in cases where expresivity reasons apply).
|
||||
class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include "scene/main/window.h"
|
||||
#include "scene/resources/animation.h"
|
||||
#include "scene/resources/image_texture.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
///////////////////////////////////
|
||||
|
|
@ -1715,7 +1716,7 @@ void AnimationPlayerEditor::_editor_visibility_changed() {
|
|||
bool AnimationPlayerEditor::_are_onion_layers_valid() {
|
||||
ERR_FAIL_COND_V(!onion.past && !onion.future, false);
|
||||
|
||||
Size2 capture_size = DisplayServer::get_singleton()->window_get_size(DisplayServer::MAIN_WINDOW_ID);
|
||||
Size2 capture_size = DisplayServer::get_singleton()->window_get_size(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
return onion.captures.size() == onion.get_capture_count() && onion.capture_size == capture_size;
|
||||
}
|
||||
|
||||
|
|
@ -1723,7 +1724,7 @@ void AnimationPlayerEditor::_allocate_onion_layers() {
|
|||
_free_onion_layers();
|
||||
|
||||
int captures = onion.get_capture_count();
|
||||
Size2 capture_size = DisplayServer::get_singleton()->window_get_size(DisplayServer::MAIN_WINDOW_ID);
|
||||
Size2 capture_size = DisplayServer::get_singleton()->window_get_size(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
|
||||
onion.captures.resize(captures);
|
||||
onion.captures_valid.resize(captures);
|
||||
|
|
@ -1834,8 +1835,8 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
|
|||
|
||||
// Tweak the root viewport to ensure it's rendered before our target.
|
||||
RID root_vp = get_tree()->get_root()->get_viewport_rid();
|
||||
onion.temp.screen_rect = Rect2(Vector2(), DisplayServer::get_singleton()->window_get_size(DisplayServer::MAIN_WINDOW_ID));
|
||||
RS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2(), DisplayServer::INVALID_WINDOW_ID);
|
||||
onion.temp.screen_rect = Rect2(Vector2(), DisplayServer::get_singleton()->window_get_size(DisplayServerEnums::MAIN_WINDOW_ID));
|
||||
RS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2(), DisplayServerEnums::INVALID_WINDOW_ID);
|
||||
RS::get_singleton()->viewport_set_update_mode(root_vp, RSE::VIEWPORT_UPDATE_ALWAYS);
|
||||
|
||||
RID present_rid;
|
||||
|
|
@ -1921,7 +1922,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_epilog() {
|
|||
// Restore root viewport.
|
||||
RID root_vp = get_tree()->get_root()->get_viewport_rid();
|
||||
RS::get_singleton()->viewport_set_parent_viewport(root_vp, RID());
|
||||
RS::get_singleton()->viewport_attach_to_screen(root_vp, onion.temp.screen_rect, DisplayServer::MAIN_WINDOW_ID);
|
||||
RS::get_singleton()->viewport_attach_to_screen(root_vp, onion.temp.screen_rect, DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
RS::get_singleton()->viewport_set_update_mode(root_vp, RSE::VIEWPORT_UPDATE_WHEN_VISIBLE);
|
||||
|
||||
// Restore animation state.
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
template <typename Func>
|
||||
void _for_all(TabContainer *p_node, const Func &p_func) {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include "editor/settings/editor_settings.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/line_edit.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#include "modules/modules_enabled.gen.h" // For gdscript, mono.
|
||||
|
||||
|
|
@ -4741,7 +4742,7 @@ void EditorHelpBitTooltip::popup_under_position(const Point2 &p_point) {
|
|||
vr = window->get_usable_parent_rect();
|
||||
}
|
||||
|
||||
if (!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS) || is_embedded()) {
|
||||
if (!DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_SELF_FITTING_WINDOWS) || is_embedded()) {
|
||||
if (r.size.x + r.position.x > vr.size.x + vr.position.x) {
|
||||
// Place it in the opposite direction. If it fails, just hug the border.
|
||||
r.position.x = p_point.x - r.size.x - tooltip_offset.x;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "editor/themes/editor_theme_manager.h"
|
||||
#include "scene/gui/line_edit.h"
|
||||
#include "scene/gui/margin_container.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
bool EditorHelpSearch::_all_terms_in_name(const Vector<String> &p_terms, const String &p_name) const {
|
||||
for (int i = 0; i < p_terms.size(); i++) {
|
||||
|
|
@ -197,13 +198,13 @@ void EditorHelpSearch::_confirmed() {
|
|||
void EditorHelpSearch::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_HELP)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_NATIVE_HELP)) {
|
||||
DisplayServer::get_singleton()->help_set_search_callbacks(callable_mp(this, &EditorHelpSearch::_native_search_cb), callable_mp(this, &EditorHelpSearch::_native_action_cb));
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_HELP)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_NATIVE_HELP)) {
|
||||
DisplayServer::get_singleton()->help_set_search_callbacks();
|
||||
}
|
||||
} break;
|
||||
|
|
|
|||
|
|
@ -31,13 +31,6 @@
|
|||
#include "editor_dock_manager.h"
|
||||
|
||||
#include "core/object/class_db.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/main/window.h"
|
||||
|
||||
#include "editor/docks/dock_tab_container.h"
|
||||
#include "editor/docks/editor_dock.h"
|
||||
#include "editor/editor_node.h"
|
||||
|
|
@ -45,6 +38,13 @@
|
|||
#include "editor/gui/window_wrapper.h"
|
||||
#include "editor/settings/editor_settings.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include "scene/gui/grid_container.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
static bool can_edit(Node *p_node, const String &p_group) {
|
||||
Node *n = p_node;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
#include "scene/main/window.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "scene/resources/theme.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
EditorInterface *EditorInterface::singleton = nullptr;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include "scene/gui/separator.h"
|
||||
#include "scene/main/timer.h"
|
||||
#include "scene/resources/font.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type) {
|
||||
EditorLog *self = static_cast<EditorLog *>(p_self);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@
|
|||
#pragma once
|
||||
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/templates/safe_refcount.h"
|
||||
#include "editor/editor_data.h"
|
||||
#include "editor/plugins/editor_plugin.h"
|
||||
#include "editor/settings/editor_folding.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/display/display_server_enums.h"
|
||||
|
||||
typedef void (*EditorNodeInitCallback)();
|
||||
typedef void (*EditorPluginInitializeCallback)();
|
||||
|
|
@ -317,7 +318,7 @@ private:
|
|||
bool exiting = false;
|
||||
bool dimmed = false;
|
||||
|
||||
DisplayServer::WindowMode prev_mode = DisplayServer::WINDOW_MODE_MAXIMIZED;
|
||||
DisplayServerEnums::WindowMode prev_mode = DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
int old_split_ofs = 0;
|
||||
VSplitContainer *top_split = nullptr;
|
||||
Control *vp_base = nullptr;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "editor/script/script_editor_plugin.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "main/main.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#include "modules/modules_enabled.gen.h" // For mono.
|
||||
#include "modules/svg/image_loader_svg.h"
|
||||
|
|
@ -523,33 +524,33 @@ String EditorExportPlatformAppleEmbedded::_process_config_file_line(const Ref<Ed
|
|||
strnew += p_line.replace("$required_device_capabilities", capabilities);
|
||||
} else if (p_line.contains("$interface_orientations")) {
|
||||
String orientations;
|
||||
const DisplayServer::ScreenOrientation screen_orientation =
|
||||
DisplayServer::ScreenOrientation(int(get_project_setting(p_preset, "display/window/handheld/orientation")));
|
||||
const DisplayServerEnums::ScreenOrientation screen_orientation =
|
||||
DisplayServerEnums::ScreenOrientation(int(get_project_setting(p_preset, "display/window/handheld/orientation")));
|
||||
|
||||
switch (screen_orientation) {
|
||||
case DisplayServer::SCREEN_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_LANDSCAPE:
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeLeft</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_PORTRAIT:
|
||||
orientations += "<string>UIInterfaceOrientationPortrait</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_REVERSE_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_LANDSCAPE:
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeRight</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_REVERSE_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_PORTRAIT:
|
||||
orientations += "<string>UIInterfaceOrientationPortraitUpsideDown</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_LANDSCAPE:
|
||||
// Allow both landscape orientations depending on sensor direction.
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeLeft</string>\n";
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeRight</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_SENSOR_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_PORTRAIT:
|
||||
// Allow both portrait orientations depending on sensor direction.
|
||||
orientations += "<string>UIInterfaceOrientationPortrait</string>\n";
|
||||
orientations += "<string>UIInterfaceOrientationPortraitUpsideDown</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_SENSOR:
|
||||
case DisplayServerEnums::SCREEN_SENSOR:
|
||||
// Allow all screen orientations depending on sensor direction.
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeLeft</string>\n";
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeRight</string>\n";
|
||||
|
|
@ -561,33 +562,33 @@ String EditorExportPlatformAppleEmbedded::_process_config_file_line(const Ref<Ed
|
|||
strnew += p_line.replace("$interface_orientations", orientations);
|
||||
} else if (p_line.contains("$ipad_interface_orientations")) {
|
||||
String orientations;
|
||||
const DisplayServer::ScreenOrientation screen_orientation =
|
||||
DisplayServer::ScreenOrientation(int(get_project_setting(p_preset, "display/window/handheld/orientation")));
|
||||
const DisplayServerEnums::ScreenOrientation screen_orientation =
|
||||
DisplayServerEnums::ScreenOrientation(int(get_project_setting(p_preset, "display/window/handheld/orientation")));
|
||||
|
||||
switch (screen_orientation) {
|
||||
case DisplayServer::SCREEN_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_LANDSCAPE:
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeRight</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_PORTRAIT:
|
||||
orientations += "<string>UIInterfaceOrientationPortrait</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_REVERSE_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_LANDSCAPE:
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeLeft</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_REVERSE_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_PORTRAIT:
|
||||
orientations += "<string>UIInterfaceOrientationPortraitUpsideDown</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_LANDSCAPE:
|
||||
// Allow both landscape orientations depending on sensor direction.
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeLeft</string>\n";
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeRight</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_SENSOR_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_PORTRAIT:
|
||||
// Allow both portrait orientations depending on sensor direction.
|
||||
orientations += "<string>UIInterfaceOrientationPortrait</string>\n";
|
||||
orientations += "<string>UIInterfaceOrientationPortraitUpsideDown</string>\n";
|
||||
break;
|
||||
case DisplayServer::SCREEN_SENSOR:
|
||||
case DisplayServerEnums::SCREEN_SENSOR:
|
||||
// Allow all screen orientations depending on sensor direction.
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeLeft</string>\n";
|
||||
orientations += "<string>UIInterfaceOrientationLandscapeRight</string>\n";
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
#include "scene/gui/separator.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "scene/main/http_request.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
enum DownloadsAvailability {
|
||||
DOWNLOADS_AVAILABLE,
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#include <zstd.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "editor/settings/editor_settings.h"
|
||||
#include "editor/settings/project_settings_editor.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
EditorFileSystem *EditorFileSystem::singleton = nullptr;
|
||||
int EditorFileSystem::nb_files_total = 0;
|
||||
|
|
@ -3242,9 +3243,9 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
|
|||
// this could lead to a slow import process, especially when the editor is unfocused.
|
||||
// Temporarily disabling VSync and low_processor_usage_mode while reimporting fixes this.
|
||||
const bool old_low_processor_usage_mode = OS::get_singleton()->is_in_low_processor_usage_mode();
|
||||
const DisplayServer::VSyncMode old_vsync_mode = DisplayServer::get_singleton()->window_get_vsync_mode(DisplayServer::MAIN_WINDOW_ID);
|
||||
const DisplayServerEnums::VSyncMode old_vsync_mode = DisplayServer::get_singleton()->window_get_vsync_mode(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
OS::get_singleton()->set_low_processor_usage_mode(false);
|
||||
DisplayServer::get_singleton()->window_set_vsync_mode(DisplayServer::VSyncMode::VSYNC_DISABLED);
|
||||
DisplayServer::get_singleton()->window_set_vsync_mode(DisplayServerEnums::VSyncMode::VSYNC_DISABLED);
|
||||
|
||||
Vector<ImportFile> reimport_files;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@
|
|||
|
||||
#include "editor_spin_slider.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/input/input.h"
|
||||
#include "core/math/expression.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/string/translation_server.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/settings/editor_settings.h"
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "editor_title_bar.h"
|
||||
|
||||
#include "core/object/callable_method_pointer.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void EditorTitleBar::gui_input(const Ref<InputEvent> &p_event) {
|
||||
if (!can_move) {
|
||||
|
|
@ -56,7 +57,7 @@ void EditorTitleBar::gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (w) {
|
||||
if (mb->get_button_index() == MouseButton::LEFT) {
|
||||
if (mb->is_pressed()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_DRAG)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_WINDOW_DRAG)) {
|
||||
DisplayServer::get_singleton()->window_start_drag(w->get_window_id());
|
||||
} else {
|
||||
click_pos = DisplayServer::get_singleton()->mouse_get_position() - w->get_position();
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "scene/gui/panel.h"
|
||||
#include "scene/gui/popup.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
// WindowWrapper
|
||||
|
||||
|
|
@ -237,7 +238,7 @@ void WindowWrapper::restore_window_from_saved_position(const Rect2 p_window_rect
|
|||
int screen = p_screen;
|
||||
Rect2 restored_screen_rect = p_screen_rect;
|
||||
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_SELF_FITTING_WINDOWS)) {
|
||||
window_rect = Rect2i();
|
||||
restored_screen_rect = Rect2i();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "scene/resources/3d/importer_mesh.h"
|
||||
#include "scene/resources/sky.h"
|
||||
#include "scene/resources/surface_tool.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
class SceneImportSettingsData : public Object {
|
||||
GDCLASS(SceneImportSettingsData, Object)
|
||||
|
|
@ -1258,8 +1259,8 @@ void SceneImportSettingsDialog::_viewport_input(const Ref<InputEvent> &p_input)
|
|||
(*rot_x) = CLAMP((*rot_x), -Math::PI / 2, Math::PI / 2);
|
||||
_update_camera();
|
||||
}
|
||||
if (mm.is_valid() && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CURSOR_SHAPE)) {
|
||||
DisplayServer::get_singleton()->cursor_set_shape(DisplayServer::CursorShape::CURSOR_ARROW);
|
||||
if (mm.is_valid() && DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_CURSOR_SHAPE)) {
|
||||
DisplayServer::get_singleton()->cursor_set_shape(DisplayServerEnums::CursorShape::CURSOR_ARROW);
|
||||
}
|
||||
Ref<InputEventMouseButton> mb = p_input;
|
||||
if (mb.is_valid() && mb->get_button_index() == MouseButton::WHEEL_DOWN) {
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
#include "scene/resources/style_box_flat.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
#include "servers/display/accessibility_server.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
void EditorInspectorActionButton::_notification(int p_what) {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@
|
|||
#include "scene/resources/mesh.h"
|
||||
#include "scene/resources/sky.h"
|
||||
#include "scene/resources/visual_shader_nodes.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
///////////////////// NIL /////////////////////////
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/resources/image_texture.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/renderer_compositor.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
#include "servers/rendering/rendering_server_globals.h"
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include "scene/gui/option_button.h"
|
||||
#include "scene/gui/separator.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
void ProjectDialog::_set_message(const String &p_msg, MessageType p_type, InputType p_input_type) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "core/input/input.h"
|
||||
#include "core/io/dir_access.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/os/time.h"
|
||||
#include "core/version.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
|
|
@ -52,6 +53,7 @@
|
|||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/resources/image_texture.h"
|
||||
#include "servers/display/accessibility_server.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void ProjectListItemControl::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
|
|
|
|||
|
|
@ -1299,8 +1299,8 @@ void ProjectManager::_files_dropped(PackedStringArray p_files) {
|
|||
}
|
||||
|
||||
void ProjectManager::_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 = (root_container->is_layout_rtl()) ? margin.y : margin.x;
|
||||
left_menu_spacer->set_custom_minimum_size(Size2(w, 0));
|
||||
|
|
@ -1422,7 +1422,7 @@ ProjectManager::ProjectManager() {
|
|||
root_container->add_child(main_vbox);
|
||||
|
||||
// Title bar.
|
||||
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);
|
||||
|
||||
{
|
||||
title_bar = memnew(EditorTitleBar);
|
||||
|
|
@ -1967,7 +1967,7 @@ ProjectManager::ProjectManager() {
|
|||
// 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);
|
||||
title_bar->connect(SceneStringName(item_rect_changed), callable_mp(this, &ProjectManager::_titlebar_resized));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/option_button.h"
|
||||
#include "scene/gui/panel_container.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void QuickSettingsDialog::_fetch_setting_values() {
|
||||
#ifndef ANDROID_ENABLED
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ EditorRun::WindowPlacement EditorRun::get_window_placement() {
|
|||
|
||||
int window_placement = EDITOR_GET("run/window_placement/rect");
|
||||
if (screen_rect != Rect2()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_HIDPI)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_HIDPI)) {
|
||||
bool hidpi_proj = GET_CONFIG_WITH_OVERRIDE("display", "window/dpi/allow_hidpi");
|
||||
int display_scale = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,11 +33,13 @@
|
|||
#include "core/config/project_settings.h"
|
||||
#include "core/input/input.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/os.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "scene/main/timer.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/resources/style_box_flat.h"
|
||||
#include "scene/theme/theme_db.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void EmbeddedProcessBase::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
|
|
@ -193,7 +195,7 @@ void EmbeddedProcess::embed_process(OS::ProcessID p_pid) {
|
|||
return;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_MSG(!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_EMBEDDING), "Embedded process not supported by this display server.");
|
||||
ERR_FAIL_COND_MSG(!DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_WINDOW_EMBEDDING), "Embedded process not supported by this display server.");
|
||||
|
||||
if (current_process_id != 0) {
|
||||
// Stop embedding the last process.
|
||||
|
|
@ -369,7 +371,7 @@ void EmbeddedProcess::_check_mouse_over() {
|
|||
}
|
||||
|
||||
// Don't grab the focus if mouse over another window.
|
||||
DisplayServer::WindowID window_id_over = DisplayServer::get_singleton()->get_window_at_screen_position(mouse_position);
|
||||
DisplayServerEnums::WindowID window_id_over = DisplayServer::get_singleton()->get_window_at_screen_position(mouse_position);
|
||||
if (window_id_over > 0 && window_id_over != window->get_window_id()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -377,8 +379,8 @@ void EmbeddedProcess::_check_mouse_over() {
|
|||
// Check if there's an exclusive popup, an open menu, or a tooltip.
|
||||
// We don't want to grab focus to prevent the game window from coming to the front of the modal window
|
||||
// or the open menu from closing when the mouse cursor moves outside the menu and over the embedded game.
|
||||
Vector<DisplayServer::WindowID> wl = DisplayServer::get_singleton()->get_window_list();
|
||||
for (const DisplayServer::WindowID &window_id : wl) {
|
||||
Vector<DisplayServerEnums::WindowID> wl = DisplayServer::get_singleton()->get_window_list();
|
||||
for (const DisplayServerEnums::WindowID &window_id : wl) {
|
||||
Window *w = Window::get_from_id(window_id);
|
||||
if (w && (w->is_exclusive() || w->get_flag(Window::FLAG_POPUP))) {
|
||||
return;
|
||||
|
|
@ -428,8 +430,8 @@ void EmbeddedProcess::_check_focused_process_id() {
|
|||
}
|
||||
|
||||
Window *EmbeddedProcess::_get_current_modal_window() {
|
||||
Vector<DisplayServer::WindowID> wl = DisplayServer::get_singleton()->get_window_list();
|
||||
for (const DisplayServer::WindowID &window_id : wl) {
|
||||
Vector<DisplayServerEnums::WindowID> wl = DisplayServer::get_singleton()->get_window_list();
|
||||
for (const DisplayServerEnums::WindowID &window_id : wl) {
|
||||
Window *w = Window::get_from_id(window_id);
|
||||
if (!w) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/panel.h"
|
||||
#include "scene/gui/separator.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void GameViewDebugger::_session_started(Ref<EditorDebuggerSession> p_session) {
|
||||
if (!is_feature_enabled) {
|
||||
|
|
@ -723,7 +724,7 @@ void GameView::_update_speed_state_size() {
|
|||
}
|
||||
|
||||
GameView::EmbedAvailability GameView::_get_embed_available() {
|
||||
if (!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_EMBEDDING)) {
|
||||
if (!DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_WINDOW_EMBEDDING)) {
|
||||
return EMBED_NOT_AVAILABLE_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
if (get_tree()->get_root()->is_embedding_subwindows()) {
|
||||
|
|
@ -750,14 +751,14 @@ GameView::EmbedAvailability GameView::_get_embed_available() {
|
|||
return EMBED_NOT_AVAILABLE_MAXIMIZED;
|
||||
}
|
||||
|
||||
DisplayServer::WindowMode window_mode = (DisplayServer::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
|
||||
if (window_mode == DisplayServer::WindowMode::WINDOW_MODE_MINIMIZED) {
|
||||
DisplayServerEnums::WindowMode window_mode = (DisplayServerEnums::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
|
||||
if (window_mode == DisplayServerEnums::WindowMode::WINDOW_MODE_MINIMIZED) {
|
||||
return EMBED_NOT_AVAILABLE_MINIMIZED;
|
||||
}
|
||||
if (window_mode == DisplayServer::WindowMode::WINDOW_MODE_MAXIMIZED) {
|
||||
if (window_mode == DisplayServerEnums::WindowMode::WINDOW_MODE_MAXIMIZED) {
|
||||
return EMBED_NOT_AVAILABLE_MAXIMIZED;
|
||||
}
|
||||
if (window_mode == DisplayServer::WindowMode::WINDOW_MODE_FULLSCREEN || window_mode == DisplayServer::WindowMode::WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
||||
if (window_mode == DisplayServerEnums::WindowMode::WINDOW_MODE_FULLSCREEN || window_mode == DisplayServerEnums::WindowMode::WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
||||
return EMBED_NOT_AVAILABLE_FULLSCREEN;
|
||||
}
|
||||
|
||||
|
|
@ -945,7 +946,7 @@ void GameView::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_READY: {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_EMBEDDING)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_WINDOW_EMBEDDING)) {
|
||||
// Embedding available.
|
||||
int game_mode = EDITOR_GET("run/window_placement/game_embed_mode");
|
||||
switch (game_mode) {
|
||||
|
|
@ -1099,7 +1100,7 @@ void GameView::_update_arguments_for_instance(int p_idx, List<String> &r_argumen
|
|||
|
||||
// Add the editor window's native ID so the started game can directly set it as its parent.
|
||||
List<String>::Element *N = r_arguments.insert_before(user_args_element, "--wid");
|
||||
N = r_arguments.insert_after(N, itos(DisplayServer::get_singleton()->window_get_native_handle(DisplayServer::WINDOW_HANDLE, get_window()->get_window_id())));
|
||||
N = r_arguments.insert_after(N, itos(DisplayServer::get_singleton()->window_get_native_handle(DisplayServerEnums::WINDOW_HANDLE, get_window()->get_window_id())));
|
||||
|
||||
#if MACOS_ENABLED
|
||||
N = r_arguments.insert_after(N, "--embedded");
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "run_instances_dialog.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/os/os.h"
|
||||
#include "editor/settings/editor_settings.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/check_box.h"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/gui/editor_file_dialog.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
#include "modules/modules_enabled.gen.h" // For lightmapper_rd.
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
#include "scene/gui/margin_container.h"
|
||||
#include "scene/gui/popup_menu.h"
|
||||
#include "scene/gui/spin_box.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
static Node *_find_first_script(Node *p_root, Node *p_node) {
|
||||
if (p_node != p_root && p_node->get_owner() != p_root) {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/rich_text_label.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
void ScriptEditorBase::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo("name_changed"));
|
||||
|
|
@ -274,7 +275,7 @@ TextEditorBase::EditMenus::EditMenus() {
|
|||
|
||||
void TextEditorBase::_make_context_menu(bool p_selection, bool p_foldable, const Vector2 &p_position, bool p_show) {
|
||||
context_menu->clear();
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EMOJI_AND_SYMBOL_PICKER)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_EMOJI_AND_SYMBOL_PICKER)) {
|
||||
context_menu->add_item(TTRC("Emoji & Symbols"), EDIT_EMOJI_AND_SYMBOL);
|
||||
context_menu->add_separator();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include "scene/main/scene_tree.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/resources/animation.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
// PRIVATE METHODS
|
||||
|
||||
|
|
@ -1947,12 +1948,12 @@ String EditorSettings::get_editor_layouts_config() const {
|
|||
float EditorSettings::get_auto_display_scale() {
|
||||
#ifdef LINUXBSD_ENABLED
|
||||
if (DisplayServer::get_singleton()->get_name() == "Wayland") {
|
||||
float main_window_scale = DisplayServer::get_singleton()->screen_get_scale(DisplayServer::SCREEN_OF_MAIN_WINDOW);
|
||||
float main_window_scale = DisplayServer::get_singleton()->screen_get_scale(DisplayServerEnums::SCREEN_OF_MAIN_WINDOW);
|
||||
|
||||
if (DisplayServer::get_singleton()->get_screen_count() == 1 || Math::fract(main_window_scale) != 0) {
|
||||
// If we have a single screen or the screen of the window is fractional, all
|
||||
// bets are off. At this point, let's just return the current's window scale,
|
||||
// which is special-cased to the scale of `SCREEN_OF_MAIN_WINDOW`.
|
||||
// which is special-cased to the scale of `DisplayServerEnums::SCREEN_OF_MAIN_WINDOW`.
|
||||
return main_window_scale;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ public:
|
|||
NETWORK_ONLINE,
|
||||
};
|
||||
|
||||
// Keep values synced with DisplayServerEnums constants.
|
||||
enum InitialScreen {
|
||||
INITIAL_SCREEN_AUTO = -5, // Remembers last screen position.
|
||||
INITIAL_SCREEN_WITH_MOUSE_FOCUS = -4,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/input/input_map.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/os.h"
|
||||
#include "scene/gui/dialogs.h"
|
||||
#include "servers/display/accessibility_server.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "scene/gui/item_list.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
Ref<Resource> ShaderEditorPlugin::_get_current_shader() {
|
||||
int index = shader_tabs->get_current_tab();
|
||||
|
|
|
|||
|
|
@ -38,13 +38,10 @@
|
|||
#include "scene/gui/flow_container.h"
|
||||
#include "scene/gui/item_list.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_device_binds.h"
|
||||
|
||||
/*** SHADER SCRIPT EDITOR ****/
|
||||
|
||||
/*** SCRIPT EDITOR ******/
|
||||
|
||||
void ShaderFileEditor::_update_version(const StringName &p_version_txt, const RD::ShaderStage p_stage) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "editor/themes/editor_scale.h"
|
||||
#include "editor/themes/editor_theme_manager.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
#include "servers/rendering/shader_preprocessor.h"
|
||||
#include "servers/rendering/shader_types.h"
|
||||
|
|
@ -1161,7 +1162,7 @@ void TextShaderEditor::_bookmark_item_pressed(int p_idx) {
|
|||
|
||||
void TextShaderEditor::_make_context_menu(bool p_selection, Vector2 p_position) {
|
||||
context_menu->clear();
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EMOJI_AND_SYMBOL_PICKER)) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_EMOJI_AND_SYMBOL_PICKER)) {
|
||||
context_menu->add_item(TTR("Emoji & Symbols"), EDIT_EMOJI_AND_SYMBOL);
|
||||
context_menu->add_separator();
|
||||
}
|
||||
|
|
|
|||
110
main/main.cpp
110
main/main.cpp
|
|
@ -235,13 +235,13 @@ static bool single_threaded_scene = false;
|
|||
|
||||
// Display
|
||||
|
||||
static DisplayServer::WindowMode window_mode = DisplayServer::WINDOW_MODE_WINDOWED;
|
||||
static DisplayServer::ScreenOrientation window_orientation = DisplayServer::SCREEN_LANDSCAPE;
|
||||
static DisplayServer::VSyncMode window_vsync_mode = DisplayServer::VSYNC_ENABLED;
|
||||
static DisplayServerEnums::WindowMode window_mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
static DisplayServerEnums::ScreenOrientation window_orientation = DisplayServerEnums::SCREEN_LANDSCAPE;
|
||||
static DisplayServerEnums::VSyncMode window_vsync_mode = DisplayServerEnums::VSYNC_ENABLED;
|
||||
static uint32_t window_flags = 0;
|
||||
static Size2i window_size = Size2i(1152, 648);
|
||||
|
||||
static int init_screen = DisplayServer::SCREEN_PRIMARY;
|
||||
static int init_screen = DisplayServerEnums::SCREEN_PRIMARY;
|
||||
static bool init_fullscreen = false;
|
||||
static bool init_maximized = false;
|
||||
static bool init_windowed = false;
|
||||
|
|
@ -1302,10 +1302,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
} else if (arg == "-f" || arg == "--fullscreen") { // force fullscreen
|
||||
init_fullscreen = true;
|
||||
window_mode = DisplayServer::WINDOW_MODE_FULLSCREEN;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_FULLSCREEN;
|
||||
} else if (arg == "-m" || arg == "--maximized") { // force maximized window
|
||||
init_maximized = true;
|
||||
window_mode = DisplayServer::WINDOW_MODE_MAXIMIZED;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
} else if (arg == "-w" || arg == "--windowed") { // force windowed window
|
||||
|
||||
init_windowed = true;
|
||||
|
|
@ -2174,7 +2174,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
main_args.push_back("--editor");
|
||||
if (!init_windowed && !init_fullscreen) {
|
||||
init_maximized = true;
|
||||
window_mode = DisplayServer::WINDOW_MODE_MAXIMIZED;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2645,33 +2645,33 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
|
||||
if (!bool(GLOBAL_GET("display/window/size/resizable"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_RESIZE_DISABLED_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_RESIZE_DISABLED_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/minimize_disabled"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_MINIMIZE_DISABLED_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_MINIMIZE_DISABLED_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/maximize_disabled"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_MAXIMIZE_DISABLED_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_MAXIMIZE_DISABLED_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/borderless"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_BORDERLESS_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_BORDERLESS_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/always_on_top"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_ALWAYS_ON_TOP_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/transparent"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_TRANSPARENT_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_TRANSPARENT_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/extend_to_title"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_EXTEND_TO_TITLE_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_EXTEND_TO_TITLE_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/no_focus"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_NO_FOCUS_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_NO_FOCUS_BIT;
|
||||
}
|
||||
if (bool(GLOBAL_GET("display/window/size/sharp_corners"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_SHARP_CORNERS_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_SHARP_CORNERS_BIT;
|
||||
}
|
||||
window_mode = (DisplayServer::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
|
||||
window_mode = (DisplayServerEnums::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
|
||||
int initial_position_type = GLOBAL_GET("display/window/size/initial_position_type").operator int();
|
||||
if (initial_position_type == Window::WINDOW_INITIAL_POSITION_ABSOLUTE) { // Absolute.
|
||||
if (!init_use_custom_pos) {
|
||||
|
|
@ -2680,7 +2680,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN || initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN) { // Center of Primary Screen.
|
||||
if (!init_use_custom_screen) {
|
||||
init_screen = DisplayServer::SCREEN_PRIMARY;
|
||||
init_screen = DisplayServerEnums::SCREEN_PRIMARY;
|
||||
init_use_custom_screen = true;
|
||||
}
|
||||
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN) { // Center of Other Screen.
|
||||
|
|
@ -2690,12 +2690,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS) { // Center of Screen With Mouse Pointer.
|
||||
if (!init_use_custom_screen) {
|
||||
init_screen = DisplayServer::SCREEN_WITH_MOUSE_FOCUS;
|
||||
init_screen = DisplayServerEnums::SCREEN_WITH_MOUSE_FOCUS;
|
||||
init_use_custom_screen = true;
|
||||
}
|
||||
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_KEYBOARD_FOCUS) { // Center of Screen With Keyboard Focus.
|
||||
if (!init_use_custom_screen) {
|
||||
init_screen = DisplayServer::SCREEN_WITH_KEYBOARD_FOCUS;
|
||||
init_screen = DisplayServerEnums::SCREEN_WITH_KEYBOARD_FOCUS;
|
||||
init_use_custom_screen = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -2778,12 +2778,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
|
||||
{
|
||||
window_orientation = DisplayServer::ScreenOrientation(int(GLOBAL_DEF_BASIC("display/window/handheld/orientation", DisplayServer::ScreenOrientation::SCREEN_LANDSCAPE)));
|
||||
window_orientation = DisplayServerEnums::ScreenOrientation(int(GLOBAL_DEF_BASIC("display/window/handheld/orientation", DisplayServerEnums::ScreenOrientation::SCREEN_LANDSCAPE)));
|
||||
}
|
||||
{
|
||||
window_vsync_mode = DisplayServer::VSyncMode(int(GLOBAL_DEF_BASIC("display/window/vsync/vsync_mode", DisplayServer::VSyncMode::VSYNC_ENABLED)));
|
||||
window_vsync_mode = DisplayServerEnums::VSyncMode(int(GLOBAL_DEF_BASIC("display/window/vsync/vsync_mode", DisplayServerEnums::VSyncMode::VSYNC_ENABLED)));
|
||||
if (disable_vsync) {
|
||||
window_vsync_mode = DisplayServer::VSyncMode::VSYNC_DISABLED;
|
||||
window_vsync_mode = DisplayServerEnums::VSyncMode::VSYNC_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3115,13 +3115,13 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
String mode = config->get_value("EditorWindow", "mode", "maximized");
|
||||
window_size = config->get_value("EditorWindow", "size", window_size);
|
||||
if (mode == "windowed") {
|
||||
window_mode = DisplayServer::WINDOW_MODE_WINDOWED;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
init_windowed = true;
|
||||
} else if (mode == "fullscreen") {
|
||||
window_mode = DisplayServer::WINDOW_MODE_FULLSCREEN;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_FULLSCREEN;
|
||||
init_fullscreen = true;
|
||||
} else {
|
||||
window_mode = DisplayServer::WINDOW_MODE_MAXIMIZED;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
init_maximized = true;
|
||||
}
|
||||
|
||||
|
|
@ -3133,7 +3133,7 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
}
|
||||
|
||||
if (init_screen == EditorSettings::InitialScreen::INITIAL_SCREEN_AUTO) {
|
||||
init_screen = DisplayServer::SCREEN_PRIMARY;
|
||||
init_screen = DisplayServerEnums::SCREEN_PRIMARY;
|
||||
}
|
||||
|
||||
OS::get_singleton()->benchmark_end_measure("Startup", "Initialize Early Settings");
|
||||
|
|
@ -3222,28 +3222,28 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color);
|
||||
DisplayServer::set_early_window_clear_color_override(true, boot_bg_color);
|
||||
|
||||
DisplayServer::Context context;
|
||||
DisplayServerEnums::Context context;
|
||||
if (editor) {
|
||||
context = DisplayServer::CONTEXT_EDITOR;
|
||||
context = DisplayServerEnums::CONTEXT_EDITOR;
|
||||
} else if (project_manager) {
|
||||
context = DisplayServer::CONTEXT_PROJECTMAN;
|
||||
context = DisplayServerEnums::CONTEXT_PROJECTMAN;
|
||||
} else {
|
||||
context = DisplayServer::CONTEXT_ENGINE;
|
||||
context = DisplayServerEnums::CONTEXT_ENGINE;
|
||||
}
|
||||
|
||||
if (init_embed_parent_window_id) {
|
||||
// Reset flags and other settings to be sure it's borderless and windowed. The position and size should have been initialized correctly
|
||||
// from --position and --resolution parameters.
|
||||
window_mode = DisplayServer::WINDOW_MODE_WINDOWED;
|
||||
window_flags = DisplayServer::WINDOW_FLAG_BORDERLESS_BIT;
|
||||
window_mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
window_flags = DisplayServerEnums::WINDOW_FLAG_BORDERLESS_BIT;
|
||||
if (bool(GLOBAL_GET("display/window/size/transparent"))) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_TRANSPARENT_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_TRANSPARENT_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if ((project_manager || editor) && init_expand_to_title) {
|
||||
window_flags |= DisplayServer::WINDOW_FLAG_EXTEND_TO_TITLE_BIT;
|
||||
window_flags |= DisplayServerEnums::WINDOW_FLAG_EXTEND_TO_TITLE_BIT;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3390,20 +3390,20 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
break;
|
||||
}
|
||||
if (!(force_res || use_custom_res)) {
|
||||
display_server->window_set_size(Size2(window_size) * ui_scale, DisplayServer::MAIN_WINDOW_ID);
|
||||
display_server->window_set_size(Size2(window_size) * ui_scale, DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
}
|
||||
if (display_server->has_feature(DisplayServer::FEATURE_SUBWINDOWS) && !display_server->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS)) {
|
||||
if (display_server->has_feature(DisplayServerEnums::FEATURE_SUBWINDOWS) && !display_server->has_feature(DisplayServerEnums::FEATURE_SELF_FITTING_WINDOWS)) {
|
||||
Size2 real_size = DisplayServer::get_singleton()->window_get_size();
|
||||
Rect2i scr_rect = display_server->screen_get_usable_rect(init_screen);
|
||||
display_server->window_set_position(scr_rect.position + (scr_rect.size - real_size) / 2, DisplayServer::MAIN_WINDOW_ID);
|
||||
display_server->window_set_position(scr_rect.position + (scr_rect.size - real_size) / 2, DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (display_server->has_feature(DisplayServer::FEATURE_SUBWINDOWS)) {
|
||||
display_server->show_window(DisplayServer::MAIN_WINDOW_ID);
|
||||
if (display_server->has_feature(DisplayServerEnums::FEATURE_SUBWINDOWS)) {
|
||||
display_server->show_window(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
}
|
||||
|
||||
if (display_server->has_feature(DisplayServer::FEATURE_ORIENTATION)) {
|
||||
if (display_server->has_feature(DisplayServerEnums::FEATURE_ORIENTATION)) {
|
||||
display_server->screen_set_orientation(window_orientation);
|
||||
}
|
||||
|
||||
|
|
@ -3422,7 +3422,7 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
if (editor && init_windowed) {
|
||||
// We still need to check we are actually in windowed mode, because
|
||||
// certain platform might only support one fullscreen window.
|
||||
if (DisplayServer::get_singleton()->window_get_mode() == DisplayServer::WINDOW_MODE_WINDOWED) {
|
||||
if (DisplayServer::get_singleton()->window_get_mode() == DisplayServerEnums::WINDOW_MODE_WINDOWED) {
|
||||
Vector2i current_size = DisplayServer::get_singleton()->window_get_size();
|
||||
Vector2i current_pos = DisplayServer::get_singleton()->window_get_position();
|
||||
int screen = DisplayServer::get_singleton()->window_get_current_screen();
|
||||
|
|
@ -3443,16 +3443,16 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) {
|
||||
// Print requested V-Sync mode at startup to diagnose the printed FPS not going above the monitor refresh rate.
|
||||
switch (window_vsync_mode) {
|
||||
case DisplayServer::VSyncMode::VSYNC_DISABLED:
|
||||
case DisplayServerEnums::VSyncMode::VSYNC_DISABLED:
|
||||
print_line("Requested V-Sync mode: Disabled");
|
||||
break;
|
||||
case DisplayServer::VSyncMode::VSYNC_ENABLED:
|
||||
case DisplayServerEnums::VSyncMode::VSYNC_ENABLED:
|
||||
print_line("Requested V-Sync mode: Enabled - FPS will likely be capped to the monitor refresh rate.");
|
||||
break;
|
||||
case DisplayServer::VSyncMode::VSYNC_ADAPTIVE:
|
||||
case DisplayServerEnums::VSyncMode::VSYNC_ADAPTIVE:
|
||||
print_line("Requested V-Sync mode: Adaptive");
|
||||
break;
|
||||
case DisplayServer::VSyncMode::VSYNC_MAILBOX:
|
||||
case DisplayServerEnums::VSyncMode::VSYNC_MAILBOX:
|
||||
print_line("Requested V-Sync mode: Mailbox");
|
||||
break;
|
||||
}
|
||||
|
|
@ -3572,12 +3572,12 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||
if (init_windowed) {
|
||||
//do none..
|
||||
} else if (init_maximized) {
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_MAXIMIZED);
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServerEnums::WINDOW_MODE_MAXIMIZED);
|
||||
} else if (init_fullscreen) {
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_FULLSCREEN);
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServerEnums::WINDOW_MODE_FULLSCREEN);
|
||||
}
|
||||
if (init_always_on_top) {
|
||||
DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP, true);
|
||||
DisplayServer::get_singleton()->window_set_flag(DisplayServerEnums::WINDOW_FLAG_ALWAYS_ON_TOP, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3934,7 +3934,7 @@ void Main::setup_boot_logo() {
|
|||
}
|
||||
|
||||
#if defined(TOOLS_ENABLED) && defined(MACOS_ENABLED)
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_ICON) && OS::get_singleton()->get_bundle_icon_path().is_empty()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_ICON) && OS::get_singleton()->get_bundle_icon_path().is_empty()) {
|
||||
Ref<Image> icon = memnew(Image(app_icon_png));
|
||||
DisplayServer::get_singleton()->set_icon(icon);
|
||||
}
|
||||
|
|
@ -4431,7 +4431,7 @@ int Main::start() {
|
|||
|
||||
bool embed_subwindows = GLOBAL_GET("display/window/subwindows/embed_subwindows");
|
||||
|
||||
if (single_window || (!project_manager && !editor && embed_subwindows) || !DisplayServer::get_singleton()->has_feature(DisplayServer::Feature::FEATURE_SUBWINDOWS)) {
|
||||
if (single_window || (!project_manager && !editor && embed_subwindows) || !DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_SUBWINDOWS)) {
|
||||
sml->get_root()->set_embedding_subwindows(true);
|
||||
}
|
||||
|
||||
|
|
@ -4718,7 +4718,7 @@ int Main::start() {
|
|||
}
|
||||
#endif
|
||||
String mac_icon_path = GLOBAL_GET("application/config/macos_native_icon");
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_ICON) && !mac_icon_path.is_empty() && !has_icon) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_NATIVE_ICON) && !mac_icon_path.is_empty() && !has_icon) {
|
||||
DisplayServer::get_singleton()->set_native_icon(mac_icon_path);
|
||||
has_icon = true;
|
||||
}
|
||||
|
|
@ -4726,14 +4726,14 @@ int Main::start() {
|
|||
|
||||
#ifdef WINDOWS_ENABLED
|
||||
String win_icon_path = GLOBAL_GET("application/config/windows_native_icon");
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_ICON) && !win_icon_path.is_empty()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_NATIVE_ICON) && !win_icon_path.is_empty()) {
|
||||
DisplayServer::get_singleton()->set_native_icon(win_icon_path);
|
||||
has_icon = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
String icon_path = GLOBAL_GET("application/config/icon");
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_ICON) && !icon_path.is_empty() && !has_icon) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_ICON) && !icon_path.is_empty() && !has_icon) {
|
||||
Ref<Image> icon;
|
||||
icon.instantiate();
|
||||
if (ImageLoader::load_image(icon_path, icon) == OK) {
|
||||
|
|
@ -4776,7 +4776,7 @@ int Main::start() {
|
|||
#endif
|
||||
}
|
||||
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_ICON) && !has_icon && OS::get_singleton()->get_bundle_icon_path().is_empty()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_ICON) && !has_icon && OS::get_singleton()->get_bundle_icon_path().is_empty()) {
|
||||
Ref<Image> icon = memnew(Image(app_icon_png));
|
||||
DisplayServer::get_singleton()->set_icon(icon);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,8 +243,8 @@ int64_t MainTimerSync::DeltaSmoother::smooth_delta(int64_t p_delta) {
|
|||
}
|
||||
|
||||
// only attempt smoothing if vsync is selected
|
||||
DisplayServer::VSyncMode vsync_mode = DisplayServer::get_singleton()->window_get_vsync_mode(DisplayServer::MAIN_WINDOW_ID);
|
||||
if (vsync_mode != DisplayServer::VSYNC_ENABLED) {
|
||||
DisplayServerEnums::VSyncMode vsync_mode = DisplayServer::get_singleton()->window_get_vsync_mode(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
if (vsync_mode != DisplayServerEnums::VSYNC_ENABLED) {
|
||||
return p_delta;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "editor/themes/editor_scale.h"
|
||||
#include "main/main.h"
|
||||
#include "scene/gui/line_edit.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#ifdef WINDOWS_ENABLED
|
||||
#include <shlwapi.h>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "jolt_body_3d.h"
|
||||
#include "jolt_group_filter.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
#include "Jolt/Physics/SoftBody/SoftBodyMotionProperties.h"
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "noise.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "noise.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "../../openxr_util.h"
|
||||
|
||||
#include "drivers/gles3/storage/texture_storage.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
// OpenXR requires us to submit sRGB textures so that it recognizes the content
|
||||
// as being in sRGB color space. We do fall back on "normal" textures but this
|
||||
|
|
@ -156,15 +157,15 @@ void *OpenXROpenGLExtension::set_session_create_and_get_next_pointer(void *p_nex
|
|||
graphics_binding_gl.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR,
|
||||
graphics_binding_gl.next = p_next_pointer;
|
||||
|
||||
graphics_binding_gl.hDC = (HDC)display_server->window_get_native_handle(DisplayServer::WINDOW_VIEW);
|
||||
graphics_binding_gl.hGLRC = (HGLRC)display_server->window_get_native_handle(DisplayServer::OPENGL_CONTEXT);
|
||||
graphics_binding_gl.hDC = (HDC)display_server->window_get_native_handle(DisplayServerEnums::WINDOW_VIEW);
|
||||
graphics_binding_gl.hGLRC = (HGLRC)display_server->window_get_native_handle(DisplayServerEnums::OPENGL_CONTEXT);
|
||||
#elif defined(ANDROID_ENABLED)
|
||||
graphics_binding_gl.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR;
|
||||
graphics_binding_gl.next = p_next_pointer;
|
||||
|
||||
graphics_binding_gl.display = (void *)display_server->window_get_native_handle(DisplayServer::DISPLAY_HANDLE);
|
||||
graphics_binding_gl.display = (void *)display_server->window_get_native_handle(DisplayServerEnums::DISPLAY_HANDLE);
|
||||
graphics_binding_gl.config = (EGLConfig)0; // https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/master/src/tests/hello_xr/graphicsplugin_opengles.cpp#L122
|
||||
graphics_binding_gl.context = (void *)display_server->window_get_native_handle(DisplayServer::OPENGL_CONTEXT);
|
||||
graphics_binding_gl.context = (void *)display_server->window_get_native_handle(DisplayServerEnums::OPENGL_CONTEXT);
|
||||
#else
|
||||
#if defined(EGL_ENABLED) && defined(WAYLAND_ENABLED)
|
||||
if (display_server->get_name() == "Wayland") {
|
||||
|
|
@ -174,9 +175,9 @@ void *OpenXROpenGLExtension::set_session_create_and_get_next_pointer(void *p_nex
|
|||
graphics_binding_egl.next = p_next_pointer;
|
||||
|
||||
graphics_binding_egl.getProcAddress = eglGetProcAddress;
|
||||
graphics_binding_egl.display = (void *)display_server->window_get_native_handle(DisplayServer::EGL_DISPLAY);
|
||||
graphics_binding_egl.config = (void *)display_server->window_get_native_handle(DisplayServer::EGL_CONFIG);
|
||||
graphics_binding_egl.context = (void *)display_server->window_get_native_handle(DisplayServer::OPENGL_CONTEXT);
|
||||
graphics_binding_egl.display = (void *)display_server->window_get_native_handle(DisplayServerEnums::EGL_DISPLAY);
|
||||
graphics_binding_egl.config = (void *)display_server->window_get_native_handle(DisplayServerEnums::EGL_CONFIG);
|
||||
graphics_binding_egl.context = (void *)display_server->window_get_native_handle(DisplayServerEnums::OPENGL_CONTEXT);
|
||||
|
||||
return &graphics_binding_egl;
|
||||
}
|
||||
|
|
@ -185,11 +186,11 @@ void *OpenXROpenGLExtension::set_session_create_and_get_next_pointer(void *p_nex
|
|||
graphics_binding_gl.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR;
|
||||
graphics_binding_gl.next = p_next_pointer;
|
||||
|
||||
void *display_handle = (void *)display_server->window_get_native_handle(DisplayServer::DISPLAY_HANDLE);
|
||||
void *glxcontext_handle = (void *)display_server->window_get_native_handle(DisplayServer::OPENGL_CONTEXT);
|
||||
void *glxdrawable_handle = (void *)display_server->window_get_native_handle(DisplayServer::WINDOW_HANDLE);
|
||||
void *glx_fbconfig_handle = (void *)display_server->window_get_native_handle(DisplayServer::GLX_FBCONFIG);
|
||||
VisualID glx_visualid = (VisualID)display_server->window_get_native_handle(DisplayServer::GLX_VISUALID);
|
||||
void *display_handle = (void *)display_server->window_get_native_handle(DisplayServerEnums::DISPLAY_HANDLE);
|
||||
void *glxcontext_handle = (void *)display_server->window_get_native_handle(DisplayServerEnums::OPENGL_CONTEXT);
|
||||
void *glxdrawable_handle = (void *)display_server->window_get_native_handle(DisplayServerEnums::WINDOW_HANDLE);
|
||||
void *glx_fbconfig_handle = (void *)display_server->window_get_native_handle(DisplayServerEnums::GLX_FBCONFIG);
|
||||
VisualID glx_visualid = (VisualID)display_server->window_get_native_handle(DisplayServerEnums::GLX_VISUALID);
|
||||
|
||||
graphics_binding_gl.xDisplay = (Display *)display_handle;
|
||||
graphics_binding_gl.glxContext = (GLXContext)glxcontext_handle;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "core/config/engine.h"
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/profiling/profiling.h"
|
||||
#include "core/version.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "scene/main/scene_tree.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/xr/xr_hand_tracker.h"
|
||||
|
||||
#include <emscripten.h>
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ void AndroidInputHandler::process_key_event(int p_physical_keycode, int p_unicod
|
|||
|
||||
if (p_physical_keycode == AKEYCODE_BACK && p_pressed) {
|
||||
if (DisplayServerAndroid *dsa = Object::cast_to<DisplayServerAndroid>(DisplayServer::get_singleton())) {
|
||||
dsa->send_window_event(DisplayServer::WINDOW_EVENT_GO_BACK_REQUEST, true);
|
||||
dsa->send_window_event(DisplayServerEnums::WINDOW_EVENT_GO_BACK_REQUEST, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,33 +64,33 @@ DisplayServerAndroid *DisplayServerAndroid::get_singleton() {
|
|||
return static_cast<DisplayServerAndroid *>(DisplayServer::get_singleton());
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::has_feature(Feature p_feature) const {
|
||||
bool DisplayServerAndroid::has_feature(DisplayServerEnums::Feature p_feature) const {
|
||||
switch (p_feature) {
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
case FEATURE_GLOBAL_MENU: {
|
||||
case DisplayServerEnums::FEATURE_GLOBAL_MENU: {
|
||||
return (native_menu && native_menu->has_feature(NativeMenu::FEATURE_GLOBAL_MENU));
|
||||
} break;
|
||||
#endif
|
||||
case FEATURE_CURSOR_SHAPE:
|
||||
//case FEATURE_CUSTOM_CURSOR_SHAPE:
|
||||
//case FEATURE_HIDPI:
|
||||
//case FEATURE_ICON:
|
||||
//case FEATURE_IME:
|
||||
case FEATURE_MOUSE:
|
||||
//case FEATURE_MOUSE_WARP:
|
||||
case FEATURE_NATIVE_DIALOG:
|
||||
case FEATURE_NATIVE_DIALOG_INPUT:
|
||||
case FEATURE_NATIVE_DIALOG_FILE:
|
||||
//case FEATURE_NATIVE_DIALOG_FILE_EXTRA:
|
||||
case FEATURE_NATIVE_DIALOG_FILE_MIME:
|
||||
//case FEATURE_NATIVE_ICON:
|
||||
case FEATURE_WINDOW_TRANSPARENCY:
|
||||
case FEATURE_CLIPBOARD:
|
||||
case FEATURE_KEEP_SCREEN_ON:
|
||||
case FEATURE_ORIENTATION:
|
||||
case FEATURE_TOUCHSCREEN:
|
||||
case FEATURE_VIRTUAL_KEYBOARD:
|
||||
case FEATURE_TEXT_TO_SPEECH:
|
||||
case DisplayServerEnums::FEATURE_CURSOR_SHAPE:
|
||||
//case DisplayServerEnums::FEATURE_CUSTOM_CURSOR_SHAPE:
|
||||
//case DisplayServerEnums::FEATURE_HIDPI:
|
||||
//case DisplayServerEnums::FEATURE_ICON:
|
||||
//case DisplayServerEnums::FEATURE_IME:
|
||||
case DisplayServerEnums::FEATURE_MOUSE:
|
||||
//case DisplayServerEnums::FEATURE_MOUSE_WARP:
|
||||
case DisplayServerEnums::FEATURE_NATIVE_DIALOG:
|
||||
case DisplayServerEnums::FEATURE_NATIVE_DIALOG_INPUT:
|
||||
case DisplayServerEnums::FEATURE_NATIVE_DIALOG_FILE:
|
||||
//case DisplayServerEnums::FEATURE_NATIVE_DIALOG_FILE_EXTRA:
|
||||
case DisplayServerEnums::FEATURE_NATIVE_DIALOG_FILE_MIME:
|
||||
//case DisplayServerEnums::FEATURE_NATIVE_ICON:
|
||||
case DisplayServerEnums::FEATURE_WINDOW_TRANSPARENCY:
|
||||
case DisplayServerEnums::FEATURE_CLIPBOARD:
|
||||
case DisplayServerEnums::FEATURE_KEEP_SCREEN_ON:
|
||||
case DisplayServerEnums::FEATURE_ORIENTATION:
|
||||
case DisplayServerEnums::FEATURE_TOUCHSCREEN:
|
||||
case DisplayServerEnums::FEATURE_VIRTUAL_KEYBOARD:
|
||||
case DisplayServerEnums::FEATURE_TEXT_TO_SPEECH:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
@ -222,7 +222,7 @@ void DisplayServerAndroid::emit_input_dialog_callback(String p_text) {
|
|||
}
|
||||
}
|
||||
|
||||
Error DisplayServerAndroid::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) {
|
||||
Error DisplayServerAndroid::file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, DisplayServerEnums::FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback, DisplayServerEnums::WindowID p_window_id) {
|
||||
GodotJavaWrapper *godot_java = OS_Android::get_singleton()->get_godot_java();
|
||||
ERR_FAIL_NULL_V(godot_java, FAILED);
|
||||
file_picker_callback = p_callback;
|
||||
|
|
@ -271,7 +271,7 @@ bool DisplayServerAndroid::screen_is_kept_on() const {
|
|||
return keep_screen_on;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) {
|
||||
void DisplayServerAndroid::screen_set_orientation(DisplayServerEnums::ScreenOrientation p_orientation, int p_screen) {
|
||||
p_screen = _get_screen_index(p_screen);
|
||||
int screen_count = get_screen_count();
|
||||
ERR_FAIL_INDEX(p_screen, screen_count);
|
||||
|
|
@ -282,17 +282,17 @@ void DisplayServerAndroid::screen_set_orientation(DisplayServer::ScreenOrientati
|
|||
godot_io_java->set_screen_orientation(p_orientation);
|
||||
}
|
||||
|
||||
DisplayServer::ScreenOrientation DisplayServerAndroid::screen_get_orientation(int p_screen) const {
|
||||
DisplayServerEnums::ScreenOrientation DisplayServerAndroid::screen_get_orientation(int p_screen) const {
|
||||
p_screen = _get_screen_index(p_screen);
|
||||
int screen_count = get_screen_count();
|
||||
ERR_FAIL_INDEX_V(p_screen, screen_count, SCREEN_LANDSCAPE);
|
||||
ERR_FAIL_INDEX_V(p_screen, screen_count, DisplayServerEnums::SCREEN_LANDSCAPE);
|
||||
|
||||
GodotIOJavaWrapper *godot_io_java = OS_Android::get_singleton()->get_godot_io_java();
|
||||
ERR_FAIL_NULL_V(godot_io_java, SCREEN_LANDSCAPE);
|
||||
ERR_FAIL_NULL_V(godot_io_java, DisplayServerEnums::SCREEN_LANDSCAPE);
|
||||
|
||||
const int orientation = godot_io_java->get_screen_orientation();
|
||||
ERR_FAIL_INDEX_V_MSG(orientation, 7, SCREEN_LANDSCAPE, "Unrecognized screen orientation");
|
||||
return (ScreenOrientation)orientation;
|
||||
ERR_FAIL_INDEX_V_MSG(orientation, 7, DisplayServerEnums::SCREEN_LANDSCAPE, "Unrecognized screen orientation");
|
||||
return (DisplayServerEnums::ScreenOrientation)orientation;
|
||||
}
|
||||
|
||||
int DisplayServerAndroid::get_display_rotation() const {
|
||||
|
|
@ -385,7 +385,7 @@ bool DisplayServerAndroid::is_touchscreen_available() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::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) {
|
||||
void DisplayServerAndroid::virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect, DisplayServerEnums::VirtualKeyboardType p_type, int p_max_length, int p_cursor_start, int p_cursor_end) {
|
||||
GodotIOJavaWrapper *godot_io_java = OS_Android::get_singleton()->get_godot_io_java();
|
||||
ERR_FAIL_NULL(godot_io_java);
|
||||
|
||||
|
|
@ -421,23 +421,23 @@ bool DisplayServerAndroid::has_hardware_keyboard() const {
|
|||
return godot_io_java->has_hardware_keyboard();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_window_event_callback(const Callable &p_callable, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_window_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
window_event_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_input_event_callback(const Callable &p_callable, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_input_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
input_event_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_input_text_callback(const Callable &p_callable, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_input_text_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
input_text_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_rect_changed_callback(const Callable &p_callable, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_rect_changed_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
rect_changed_callback = p_callable;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_drop_files_callback(const Callable &p_callable, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_drop_files_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
|
|
@ -452,7 +452,7 @@ void DisplayServerAndroid::_window_callback(const Callable &p_callable, bool p_d
|
|||
}
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::send_window_event(DisplayServer::WindowEvent p_event, bool p_deferred) const {
|
||||
void DisplayServerAndroid::send_window_event(DisplayServerEnums::WindowEvent p_event, bool p_deferred) const {
|
||||
_window_callback(window_event_callback, p_deferred, int(p_event));
|
||||
}
|
||||
|
||||
|
|
@ -468,43 +468,43 @@ void DisplayServerAndroid::_dispatch_input_events(const Ref<InputEvent> &p_event
|
|||
DisplayServerAndroid::get_singleton()->send_input_event(p_event);
|
||||
}
|
||||
|
||||
Vector<DisplayServer::WindowID> DisplayServerAndroid::get_window_list() const {
|
||||
Vector<WindowID> ret;
|
||||
ret.push_back(MAIN_WINDOW_ID);
|
||||
Vector<DisplayServerEnums::WindowID> DisplayServerAndroid::get_window_list() const {
|
||||
Vector<DisplayServerEnums::WindowID> ret;
|
||||
ret.push_back(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
return ret;
|
||||
}
|
||||
|
||||
DisplayServer::WindowID DisplayServerAndroid::get_window_at_screen_position(const Point2i &p_position) const {
|
||||
return MAIN_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID DisplayServerAndroid::get_window_at_screen_position(const Point2i &p_position) const {
|
||||
return DisplayServerEnums::MAIN_WINDOW_ID;
|
||||
}
|
||||
|
||||
int64_t DisplayServerAndroid::window_get_native_handle(HandleType p_handle_type, WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, 0);
|
||||
int64_t DisplayServerAndroid::window_get_native_handle(DisplayServerEnums::HandleType p_handle_type, DisplayServerEnums::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != DisplayServerEnums::MAIN_WINDOW_ID, 0);
|
||||
switch (p_handle_type) {
|
||||
case WINDOW_HANDLE: {
|
||||
case DisplayServerEnums::WINDOW_HANDLE: {
|
||||
return reinterpret_cast<int64_t>(static_cast<OS_Android *>(OS::get_singleton())->get_godot_java()->get_activity());
|
||||
}
|
||||
case WINDOW_VIEW: {
|
||||
case DisplayServerEnums::WINDOW_VIEW: {
|
||||
return 0; // Not supported.
|
||||
}
|
||||
#ifdef GLES3_ENABLED
|
||||
case DISPLAY_HANDLE: {
|
||||
case DisplayServerEnums::DISPLAY_HANDLE: {
|
||||
if (rendering_driver == "opengl3") {
|
||||
return reinterpret_cast<int64_t>(eglGetCurrentDisplay());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case OPENGL_CONTEXT: {
|
||||
case DisplayServerEnums::OPENGL_CONTEXT: {
|
||||
if (rendering_driver == "opengl3") {
|
||||
return reinterpret_cast<int64_t>(eglGetCurrentContext());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case EGL_DISPLAY: {
|
||||
case DisplayServerEnums::EGL_DISPLAY: {
|
||||
// @todo Find a way to get this from the Java side.
|
||||
return 0;
|
||||
}
|
||||
case EGL_CONFIG: {
|
||||
case DisplayServerEnums::EGL_CONFIG: {
|
||||
// @todo Find a way to get this from the Java side.
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -515,95 +515,95 @@ int64_t DisplayServerAndroid::window_get_native_handle(HandleType p_handle_type,
|
|||
}
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_attach_instance_id(ObjectID p_instance, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_attach_instance_id(ObjectID p_instance, DisplayServerEnums::WindowID p_window) {
|
||||
window_attached_instance_id = p_instance;
|
||||
}
|
||||
|
||||
ObjectID DisplayServerAndroid::window_get_attached_instance_id(DisplayServer::WindowID p_window) const {
|
||||
ObjectID DisplayServerAndroid::window_get_attached_instance_id(DisplayServerEnums::WindowID p_window) const {
|
||||
return window_attached_instance_id;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_title(const String &p_title, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_title(const String &p_title, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
int DisplayServerAndroid::window_get_current_screen(DisplayServer::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, INVALID_SCREEN);
|
||||
int DisplayServerAndroid::window_get_current_screen(DisplayServerEnums::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != DisplayServerEnums::MAIN_WINDOW_ID, DisplayServerEnums::INVALID_SCREEN);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_current_screen(int p_screen, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_current_screen(int p_screen, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
Point2i DisplayServerAndroid::window_get_position(DisplayServer::WindowID p_window) const {
|
||||
Point2i DisplayServerAndroid::window_get_position(DisplayServerEnums::WindowID p_window) const {
|
||||
return Point2i();
|
||||
}
|
||||
|
||||
Point2i DisplayServerAndroid::window_get_position_with_decorations(DisplayServer::WindowID p_window) const {
|
||||
Point2i DisplayServerAndroid::window_get_position_with_decorations(DisplayServerEnums::WindowID p_window) const {
|
||||
return Point2i();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_position(const Point2i &p_position, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_position(const Point2i &p_position, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_transient(DisplayServer::WindowID p_window, DisplayServer::WindowID p_parent) {
|
||||
void DisplayServerAndroid::window_set_transient(DisplayServerEnums::WindowID p_window, DisplayServerEnums::WindowID p_parent) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_max_size(const Size2i p_size, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_max_size(const Size2i p_size, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
Size2i DisplayServerAndroid::window_get_max_size(DisplayServer::WindowID p_window) const {
|
||||
Size2i DisplayServerAndroid::window_get_max_size(DisplayServerEnums::WindowID p_window) const {
|
||||
return Size2i();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_min_size(const Size2i p_size, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_min_size(const Size2i p_size, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
Size2i DisplayServerAndroid::window_get_min_size(DisplayServer::WindowID p_window) const {
|
||||
Size2i DisplayServerAndroid::window_get_min_size(DisplayServerEnums::WindowID p_window) const {
|
||||
return Size2i();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_size(const Size2i p_size, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_size(const Size2i p_size, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
Size2i DisplayServerAndroid::window_get_size(DisplayServer::WindowID p_window) const {
|
||||
Size2i DisplayServerAndroid::window_get_size(DisplayServerEnums::WindowID p_window) const {
|
||||
return OS_Android::get_singleton()->get_display_size();
|
||||
}
|
||||
|
||||
Size2i DisplayServerAndroid::window_get_size_with_decorations(DisplayServer::WindowID p_window) const {
|
||||
Size2i DisplayServerAndroid::window_get_size_with_decorations(DisplayServerEnums::WindowID p_window) const {
|
||||
return OS_Android::get_singleton()->get_display_size();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_mode(DisplayServer::WindowMode p_mode, DisplayServer::WindowID p_window) {
|
||||
OS_Android::get_singleton()->get_godot_java()->enable_immersive_mode(p_mode == WINDOW_MODE_FULLSCREEN || p_mode == WINDOW_MODE_EXCLUSIVE_FULLSCREEN);
|
||||
void DisplayServerAndroid::window_set_mode(DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::WindowID p_window) {
|
||||
OS_Android::get_singleton()->get_godot_java()->enable_immersive_mode(p_mode == DisplayServerEnums::WINDOW_MODE_FULLSCREEN || p_mode == DisplayServerEnums::WINDOW_MODE_EXCLUSIVE_FULLSCREEN);
|
||||
}
|
||||
|
||||
DisplayServer::WindowMode DisplayServerAndroid::window_get_mode(DisplayServer::WindowID p_window) const {
|
||||
DisplayServerEnums::WindowMode DisplayServerAndroid::window_get_mode(DisplayServerEnums::WindowID p_window) const {
|
||||
if (OS_Android::get_singleton()->get_godot_java()->is_in_immersive_mode()) {
|
||||
return WINDOW_MODE_FULLSCREEN;
|
||||
return DisplayServerEnums::WINDOW_MODE_FULLSCREEN;
|
||||
} else {
|
||||
return WINDOW_MODE_MAXIMIZED;
|
||||
return DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::window_is_maximize_allowed(DisplayServer::WindowID p_window) const {
|
||||
bool DisplayServerAndroid::window_is_maximize_allowed(DisplayServerEnums::WindowID p_window) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_flag(DisplayServer::WindowFlags p_flag, bool p_enabled, DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_flag(DisplayServerEnums::WindowFlags p_flag, bool p_enabled, DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::window_get_flag(DisplayServer::WindowFlags p_flag, DisplayServer::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, false);
|
||||
bool DisplayServerAndroid::window_get_flag(DisplayServerEnums::WindowFlags p_flag, DisplayServerEnums::WindowID p_window) const {
|
||||
ERR_FAIL_COND_V(p_window != DisplayServerEnums::MAIN_WINDOW_ID, false);
|
||||
switch (p_flag) {
|
||||
case WindowFlags::WINDOW_FLAG_TRANSPARENT:
|
||||
case DisplayServerEnums::WindowFlags::WINDOW_FLAG_TRANSPARENT:
|
||||
return is_window_transparency_available();
|
||||
|
||||
default:
|
||||
|
|
@ -611,19 +611,19 @@ bool DisplayServerAndroid::window_get_flag(DisplayServer::WindowFlags p_flag, Di
|
|||
}
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_request_attention(DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_request_attention(DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_move_to_foreground(DisplayServer::WindowID p_window) {
|
||||
void DisplayServerAndroid::window_move_to_foreground(DisplayServerEnums::WindowID p_window) {
|
||||
// Not supported on Android.
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::window_is_focused(WindowID p_window) const {
|
||||
bool DisplayServerAndroid::window_is_focused(DisplayServerEnums::WindowID p_window) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::window_can_draw(DisplayServer::WindowID p_window) const {
|
||||
bool DisplayServerAndroid::window_can_draw(DisplayServerEnums::WindowID p_window) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ Vector<String> DisplayServerAndroid::get_rendering_drivers_func() {
|
|||
return drivers;
|
||||
}
|
||||
|
||||
DisplayServer *DisplayServerAndroid::create_func(const String &p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::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) {
|
||||
DisplayServer *DisplayServerAndroid::create_func(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error) {
|
||||
DisplayServer *ds = memnew(DisplayServerAndroid(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_position, p_resolution, p_screen, p_context, p_parent_window, r_error));
|
||||
if (r_error != OK) {
|
||||
if (p_rendering_driver == "vulkan") {
|
||||
|
|
@ -722,11 +722,11 @@ void DisplayServerAndroid::reset_window() {
|
|||
#if defined(RD_ENABLED)
|
||||
if (rendering_context_global) {
|
||||
if (rendering_device) {
|
||||
rendering_device->screen_free(MAIN_WINDOW_ID);
|
||||
rendering_device->screen_free(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
}
|
||||
|
||||
VSyncMode last_vsync_mode = rendering_context_global->window_get_vsync_mode(MAIN_WINDOW_ID);
|
||||
rendering_context_global->window_destroy(MAIN_WINDOW_ID);
|
||||
DisplayServerEnums::VSyncMode last_vsync_mode = rendering_context_global->window_get_vsync_mode(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
rendering_context_global->window_destroy(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
|
||||
union {
|
||||
#ifdef VULKAN_ENABLED
|
||||
|
|
@ -741,17 +741,17 @@ void DisplayServerAndroid::reset_window() {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (rendering_context_global->window_create(MAIN_WINDOW_ID, &wpd) != OK) {
|
||||
if (rendering_context_global->window_create(DisplayServerEnums::MAIN_WINDOW_ID, &wpd) != OK) {
|
||||
ERR_PRINT(vformat("Failed to reset %s window.", rendering_driver));
|
||||
return;
|
||||
}
|
||||
|
||||
Size2i display_size = OS_Android::get_singleton()->get_display_size();
|
||||
rendering_context_global->window_set_size(MAIN_WINDOW_ID, display_size.width, display_size.height);
|
||||
rendering_context_global->window_set_vsync_mode(MAIN_WINDOW_ID, last_vsync_mode);
|
||||
rendering_context_global->window_set_size(DisplayServerEnums::MAIN_WINDOW_ID, display_size.width, display_size.height);
|
||||
rendering_context_global->window_set_vsync_mode(DisplayServerEnums::MAIN_WINDOW_ID, last_vsync_mode);
|
||||
|
||||
if (rendering_device) {
|
||||
rendering_device->screen_create(MAIN_WINDOW_ID);
|
||||
rendering_device->screen_create(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -771,7 +771,7 @@ void DisplayServerAndroid::notify_application_paused() {
|
|||
#endif // defined(RD_ENABLED)
|
||||
}
|
||||
|
||||
DisplayServerAndroid::DisplayServerAndroid(const String &p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::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) {
|
||||
DisplayServerAndroid::DisplayServerAndroid(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error) {
|
||||
rendering_driver = p_rendering_driver;
|
||||
|
||||
keep_screen_on = GLOBAL_GET("display/window/energy_saving/keep_screen_on");
|
||||
|
|
@ -793,24 +793,24 @@ DisplayServerAndroid::DisplayServerAndroid(const String &p_rendering_driver, Dis
|
|||
RenderingContextDriverVulkanAndroid::WindowPlatformData wpd;
|
||||
wpd.window = native_window;
|
||||
|
||||
if (rendering_context_global->window_create(MAIN_WINDOW_ID, &wpd) != OK) {
|
||||
if (rendering_context_global->window_create(DisplayServerEnums::MAIN_WINDOW_ID, &wpd) != OK) {
|
||||
ERR_PRINT(vformat("Failed to create %s window.", rendering_driver));
|
||||
r_error = ERR_UNAVAILABLE;
|
||||
return;
|
||||
}
|
||||
|
||||
Size2i display_size = OS_Android::get_singleton()->get_display_size();
|
||||
rendering_context_global->window_set_size(MAIN_WINDOW_ID, display_size.width, display_size.height);
|
||||
rendering_context_global->window_set_vsync_mode(MAIN_WINDOW_ID, p_vsync_mode);
|
||||
rendering_context_global->window_set_size(DisplayServerEnums::MAIN_WINDOW_ID, display_size.width, display_size.height);
|
||||
rendering_context_global->window_set_vsync_mode(DisplayServerEnums::MAIN_WINDOW_ID, p_vsync_mode);
|
||||
|
||||
rendering_device = memnew(RenderingDevice);
|
||||
if (rendering_device->initialize(rendering_context_global, MAIN_WINDOW_ID) != OK) {
|
||||
if (rendering_device->initialize(rendering_context_global, DisplayServerEnums::MAIN_WINDOW_ID) != OK) {
|
||||
rendering_device = nullptr;
|
||||
r_error = ERR_UNAVAILABLE;
|
||||
return;
|
||||
}
|
||||
|
||||
rendering_device->screen_create(MAIN_WINDOW_ID);
|
||||
rendering_device->screen_create(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
|
||||
RendererCompositorRD::make_current();
|
||||
}
|
||||
|
|
@ -859,7 +859,7 @@ void DisplayServerAndroid::process_gyroscope(const Vector3 &p_gyroscope) {
|
|||
}
|
||||
|
||||
void DisplayServerAndroid::_mouse_update_mode() {
|
||||
MouseMode wanted_mouse_mode = mouse_mode_override_enabled
|
||||
DisplayServerEnums::MouseMode wanted_mouse_mode = mouse_mode_override_enabled
|
||||
? mouse_mode_override
|
||||
: mouse_mode_base;
|
||||
|
||||
|
|
@ -870,13 +870,13 @@ void DisplayServerAndroid::_mouse_update_mode() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (wanted_mouse_mode == MouseMode::MOUSE_MODE_HIDDEN) {
|
||||
if (wanted_mouse_mode == DisplayServerEnums::MouseMode::MOUSE_MODE_HIDDEN) {
|
||||
OS_Android::get_singleton()->get_godot_java()->get_godot_view()->set_pointer_icon(CURSOR_TYPE_NULL);
|
||||
} else {
|
||||
cursor_set_shape(cursor_shape);
|
||||
}
|
||||
|
||||
if (wanted_mouse_mode == MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
if (wanted_mouse_mode == DisplayServerEnums::MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
OS_Android::get_singleton()->get_godot_java()->get_godot_view()->request_pointer_capture();
|
||||
} else {
|
||||
OS_Android::get_singleton()->get_godot_java()->get_godot_view()->release_pointer_capture();
|
||||
|
|
@ -885,8 +885,8 @@ void DisplayServerAndroid::_mouse_update_mode() {
|
|||
mouse_mode = wanted_mouse_mode;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::mouse_set_mode(MouseMode p_mode) {
|
||||
ERR_FAIL_INDEX(p_mode, MouseMode::MOUSE_MODE_MAX);
|
||||
void DisplayServerAndroid::mouse_set_mode(DisplayServerEnums::MouseMode p_mode) {
|
||||
ERR_FAIL_INDEX(p_mode, DisplayServerEnums::MouseMode::MOUSE_MODE_MAX);
|
||||
if (p_mode == mouse_mode_base) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -894,12 +894,12 @@ void DisplayServerAndroid::mouse_set_mode(MouseMode p_mode) {
|
|||
_mouse_update_mode();
|
||||
}
|
||||
|
||||
DisplayServer::MouseMode DisplayServerAndroid::mouse_get_mode() const {
|
||||
DisplayServerEnums::MouseMode DisplayServerAndroid::mouse_get_mode() const {
|
||||
return mouse_mode;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::mouse_set_mode_override(MouseMode p_mode) {
|
||||
ERR_FAIL_INDEX(p_mode, MouseMode::MOUSE_MODE_MAX);
|
||||
void DisplayServerAndroid::mouse_set_mode_override(DisplayServerEnums::MouseMode p_mode) {
|
||||
ERR_FAIL_INDEX(p_mode, DisplayServerEnums::MouseMode::MOUSE_MODE_MAX);
|
||||
if (p_mode == mouse_mode_override) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -907,7 +907,7 @@ void DisplayServerAndroid::mouse_set_mode_override(MouseMode p_mode) {
|
|||
_mouse_update_mode();
|
||||
}
|
||||
|
||||
DisplayServer::MouseMode DisplayServerAndroid::mouse_get_mode_override() const {
|
||||
DisplayServerEnums::MouseMode DisplayServerAndroid::mouse_get_mode_override() const {
|
||||
return mouse_mode_override;
|
||||
}
|
||||
|
||||
|
|
@ -928,7 +928,7 @@ BitField<MouseButtonMask> DisplayServerAndroid::mouse_get_button_state() const {
|
|||
return Input::get_singleton()->get_mouse_button_mask();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::_cursor_set_shape_helper(CursorShape p_shape, bool force) {
|
||||
void DisplayServerAndroid::_cursor_set_shape_helper(DisplayServerEnums::CursorShape p_shape, bool force) {
|
||||
if (!OS_Android::get_singleton()->get_godot_java()->get_godot_view()->can_update_pointer_icon()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -938,22 +938,22 @@ void DisplayServerAndroid::_cursor_set_shape_helper(CursorShape p_shape, bool fo
|
|||
|
||||
cursor_shape = p_shape;
|
||||
|
||||
if (mouse_mode == MouseMode::MOUSE_MODE_VISIBLE || mouse_mode == MouseMode::MOUSE_MODE_CONFINED) {
|
||||
if (mouse_mode == DisplayServerEnums::MouseMode::MOUSE_MODE_VISIBLE || mouse_mode == DisplayServerEnums::MouseMode::MOUSE_MODE_CONFINED) {
|
||||
OS_Android::get_singleton()->get_godot_java()->get_godot_view()->set_pointer_icon(android_cursors[cursor_shape]);
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::cursor_set_shape(DisplayServer::CursorShape p_shape) {
|
||||
ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
|
||||
void DisplayServerAndroid::cursor_set_shape(DisplayServerEnums::CursorShape p_shape) {
|
||||
ERR_FAIL_INDEX(p_shape, DisplayServerEnums::CURSOR_MAX);
|
||||
_cursor_set_shape_helper(p_shape);
|
||||
}
|
||||
|
||||
DisplayServer::CursorShape DisplayServerAndroid::cursor_get_shape() const {
|
||||
DisplayServerEnums::CursorShape DisplayServerAndroid::cursor_get_shape() const {
|
||||
return cursor_shape;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
|
||||
ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
|
||||
void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor, DisplayServerEnums::CursorShape p_shape, const Vector2 &p_hotspot) {
|
||||
ERR_FAIL_INDEX(p_shape, DisplayServerEnums::CURSOR_MAX);
|
||||
String cursor_path = p_cursor.is_valid() ? p_cursor->get_path() : "";
|
||||
if (!cursor_path.is_empty()) {
|
||||
cursor_path = ProjectSettings::get_singleton()->globalize_path(cursor_path);
|
||||
|
|
@ -962,7 +962,7 @@ void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor
|
|||
_cursor_set_shape_helper(p_shape, true);
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) {
|
||||
void DisplayServerAndroid::window_set_vsync_mode(DisplayServerEnums::VSyncMode p_vsync_mode, DisplayServerEnums::WindowID p_window) {
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context_global) {
|
||||
rendering_context_global->window_set_vsync_mode(p_window, p_vsync_mode);
|
||||
|
|
@ -970,13 +970,13 @@ void DisplayServerAndroid::window_set_vsync_mode(DisplayServer::VSyncMode p_vsyn
|
|||
#endif
|
||||
}
|
||||
|
||||
DisplayServer::VSyncMode DisplayServerAndroid::window_get_vsync_mode(WindowID p_window) const {
|
||||
DisplayServerEnums::VSyncMode DisplayServerAndroid::window_get_vsync_mode(DisplayServerEnums::WindowID p_window) const {
|
||||
#if defined(RD_ENABLED)
|
||||
if (rendering_context_global) {
|
||||
return rendering_context_global->window_get_vsync_mode(p_window);
|
||||
}
|
||||
#endif
|
||||
return DisplayServer::VSYNC_ENABLED;
|
||||
return DisplayServerEnums::VSYNC_ENABLED;
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::reset_swap_buffers_flag() {
|
||||
|
|
|
|||
|
|
@ -47,36 +47,36 @@ class DisplayServerAndroid : public DisplayServer {
|
|||
|
||||
// https://developer.android.com/reference/android/view/PointerIcon
|
||||
// mapping between Godot's cursor shape to Android's'
|
||||
int android_cursors[CURSOR_MAX] = {
|
||||
1000, //CURSOR_ARROW
|
||||
1008, //CURSOR_IBEAM
|
||||
1002, //CURSOR_POINTIN
|
||||
1007, //CURSOR_CROSS
|
||||
1004, //CURSOR_WAIT
|
||||
1004, //CURSOR_BUSY
|
||||
1021, //CURSOR_DRAG
|
||||
1021, //CURSOR_CAN_DRO
|
||||
1000, //CURSOR_FORBIDD (no corresponding icon in Android's icon so fallback to default)
|
||||
1015, //CURSOR_VSIZE
|
||||
1014, //CURSOR_HSIZE
|
||||
1017, //CURSOR_BDIAGSI
|
||||
1016, //CURSOR_FDIAGSI
|
||||
1020, //CURSOR_MOVE
|
||||
1015, //CURSOR_VSPLIT
|
||||
1014, //CURSOR_HSPLIT
|
||||
1003, //CURSOR_HELP
|
||||
int android_cursors[DisplayServerEnums::CURSOR_MAX] = {
|
||||
1000, //DisplayServerEnums::CURSOR_ARROW
|
||||
1008, //DisplayServerEnums::CURSOR_IBEAM
|
||||
1002, //DisplayServerEnums::CURSOR_POINTIN
|
||||
1007, //DisplayServerEnums::CURSOR_CROSS
|
||||
1004, //DisplayServerEnums::CURSOR_WAIT
|
||||
1004, //DisplayServerEnums::CURSOR_BUSY
|
||||
1021, //DisplayServerEnums::CURSOR_DRAG
|
||||
1021, //DisplayServerEnums::CURSOR_CAN_DRO
|
||||
1000, //DisplayServerEnums::CURSOR_FORBIDD (no corresponding icon in Android's icon so fallback to default)
|
||||
1015, //DisplayServerEnums::CURSOR_VSIZE
|
||||
1014, //DisplayServerEnums::CURSOR_HSIZE
|
||||
1017, //DisplayServerEnums::CURSOR_BDIAGSI
|
||||
1016, //DisplayServerEnums::CURSOR_FDIAGSI
|
||||
1020, //DisplayServerEnums::CURSOR_MOVE
|
||||
1015, //DisplayServerEnums::CURSOR_VSPLIT
|
||||
1014, //DisplayServerEnums::CURSOR_HSPLIT
|
||||
1003, //DisplayServerEnums::CURSOR_HELP
|
||||
};
|
||||
const int CURSOR_TYPE_NULL = 0;
|
||||
MouseMode mouse_mode = MouseMode::MOUSE_MODE_VISIBLE;
|
||||
MouseMode mouse_mode_base = MouseMode::MOUSE_MODE_VISIBLE;
|
||||
MouseMode mouse_mode_override = MouseMode::MOUSE_MODE_VISIBLE;
|
||||
DisplayServerEnums::MouseMode mouse_mode = DisplayServerEnums::MouseMode::MOUSE_MODE_VISIBLE;
|
||||
DisplayServerEnums::MouseMode mouse_mode_base = DisplayServerEnums::MouseMode::MOUSE_MODE_VISIBLE;
|
||||
DisplayServerEnums::MouseMode mouse_mode_override = DisplayServerEnums::MouseMode::MOUSE_MODE_VISIBLE;
|
||||
bool mouse_mode_override_enabled = false;
|
||||
void _mouse_update_mode();
|
||||
|
||||
bool keep_screen_on;
|
||||
bool swap_buffers_flag;
|
||||
|
||||
CursorShape cursor_shape = CursorShape::CURSOR_ARROW;
|
||||
DisplayServerEnums::CursorShape cursor_shape = DisplayServerEnums::CursorShape::CURSOR_ARROW;
|
||||
|
||||
#if defined(RD_ENABLED)
|
||||
RenderingDevice *rendering_device = nullptr;
|
||||
|
|
@ -106,7 +106,7 @@ class DisplayServerAndroid : public DisplayServer {
|
|||
public:
|
||||
static DisplayServerAndroid *get_singleton();
|
||||
|
||||
virtual bool has_feature(Feature p_feature) const override;
|
||||
virtual bool has_feature(DisplayServerEnums::Feature p_feature) const override;
|
||||
virtual String get_name() const override;
|
||||
|
||||
virtual bool tts_is_speaking() const override;
|
||||
|
|
@ -133,7 +133,7 @@ public:
|
|||
virtual Error dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) override;
|
||||
void emit_input_dialog_callback(String p_text);
|
||||
|
||||
virtual Error file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, const FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback, WindowID p_window_id) override;
|
||||
virtual Error file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, const DisplayServerEnums::FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback, DisplayServerEnums::WindowID p_window_id) override;
|
||||
void emit_file_picker_callback(bool p_ok, const Vector<String> &p_selected_paths);
|
||||
|
||||
virtual Color get_accent_color() const override;
|
||||
|
|
@ -145,83 +145,83 @@ public:
|
|||
virtual void screen_set_keep_on(bool p_enable) override;
|
||||
virtual bool screen_is_kept_on() const override;
|
||||
|
||||
virtual void screen_set_orientation(ScreenOrientation p_orientation, int p_screen = SCREEN_OF_MAIN_WINDOW) override;
|
||||
virtual ScreenOrientation screen_get_orientation(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual void screen_set_orientation(DisplayServerEnums::ScreenOrientation p_orientation, int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) override;
|
||||
virtual DisplayServerEnums::ScreenOrientation screen_get_orientation(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
int get_display_rotation() const;
|
||||
|
||||
virtual int get_screen_count() const override;
|
||||
virtual int get_primary_screen() const override;
|
||||
virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Point2i screen_get_position(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Size2i screen_get_size(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual int screen_get_dpi(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_scale(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual bool is_touchscreen_available() const override;
|
||||
|
||||
virtual void virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), VirtualKeyboardType p_type = KEYBOARD_TYPE_DEFAULT, int p_max_length = -1, int p_cursor_start = -1, int p_cursor_end = -1) override;
|
||||
virtual void virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), DisplayServerEnums::VirtualKeyboardType p_type = DisplayServerEnums::KEYBOARD_TYPE_DEFAULT, int p_max_length = -1, int p_cursor_start = -1, int p_cursor_end = -1) override;
|
||||
virtual void virtual_keyboard_hide() override;
|
||||
virtual int virtual_keyboard_get_height() const override;
|
||||
virtual bool has_hardware_keyboard() const override;
|
||||
virtual void set_hardware_keyboard_connection_change_callback(const Callable &p_callable) override;
|
||||
void emit_hardware_keyboard_connection_changed(bool p_connected);
|
||||
|
||||
virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_window_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_text_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_rect_changed_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_drop_files_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
void send_window_event(WindowEvent p_event, bool p_deferred = false) const;
|
||||
void send_window_event(DisplayServerEnums::WindowEvent p_event, bool p_deferred = false) const;
|
||||
void send_input_event(const Ref<InputEvent> &p_event) const;
|
||||
void send_input_text(const String &p_text) const;
|
||||
|
||||
virtual Vector<WindowID> get_window_list() const override;
|
||||
virtual WindowID get_window_at_screen_position(const Point2i &p_position) const override;
|
||||
virtual Vector<DisplayServerEnums::WindowID> get_window_list() const override;
|
||||
virtual DisplayServerEnums::WindowID get_window_at_screen_position(const Point2i &p_position) const override;
|
||||
|
||||
virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual int64_t window_get_native_handle(DisplayServerEnums::HandleType p_handle_type, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_title(const String &p_title, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_attach_instance_id(ObjectID p_instance, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual ObjectID window_get_attached_instance_id(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_title(const String &p_title, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual int window_get_current_screen(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_current_screen(int p_screen, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual Point2i window_get_position_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Point2i window_get_position(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual Point2i window_get_position_with_decorations(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_position(const Point2i &p_position, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual void window_set_transient(WindowID p_window, WindowID p_parent) override;
|
||||
virtual void window_set_transient(DisplayServerEnums::WindowID p_window, DisplayServerEnums::WindowID p_parent) override;
|
||||
|
||||
virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_max_size(const Size2i p_size, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_max_size(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_min_size(const Size2i p_size, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_min_size(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual Size2i window_get_size_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_size(const Size2i p_size, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_size(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual Size2i window_get_size_with_decorations(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_mode(DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServerEnums::WindowMode window_get_mode(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_is_maximize_allowed(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_flag(DisplayServerEnums::WindowFlags p_flag, bool p_enabled, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_get_flag(DisplayServerEnums::WindowFlags p_flag, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_request_attention(WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_request_attention(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_move_to_foreground(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_focused(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_can_draw(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool can_any_window_draw() const override;
|
||||
|
||||
virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_vsync_mode) const override;
|
||||
virtual void window_set_vsync_mode(DisplayServerEnums::VSyncMode p_vsync_mode, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServerEnums::VSyncMode window_get_vsync_mode(DisplayServerEnums::WindowID p_vsync_mode) const override;
|
||||
|
||||
virtual void window_set_color(const Color &p_color) override;
|
||||
|
||||
|
|
@ -232,19 +232,19 @@ public:
|
|||
void process_magnetometer(const Vector3 &p_magnetometer);
|
||||
void process_gyroscope(const Vector3 &p_gyroscope);
|
||||
|
||||
void _cursor_set_shape_helper(CursorShape p_shape, bool force = false);
|
||||
virtual void cursor_set_shape(CursorShape p_shape) override;
|
||||
virtual CursorShape cursor_get_shape() const override;
|
||||
virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape = CURSOR_ARROW, const Vector2 &p_hotspot = Vector2()) override;
|
||||
void _cursor_set_shape_helper(DisplayServerEnums::CursorShape p_shape, bool force = false);
|
||||
virtual void cursor_set_shape(DisplayServerEnums::CursorShape p_shape) override;
|
||||
virtual DisplayServerEnums::CursorShape cursor_get_shape() const override;
|
||||
virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, DisplayServerEnums::CursorShape p_shape = DisplayServerEnums::CURSOR_ARROW, const Vector2 &p_hotspot = Vector2()) override;
|
||||
|
||||
virtual void mouse_set_mode(MouseMode p_mode) override;
|
||||
virtual MouseMode mouse_get_mode() const override;
|
||||
virtual void mouse_set_mode_override(MouseMode p_mode) override;
|
||||
virtual MouseMode mouse_get_mode_override() const override;
|
||||
virtual void mouse_set_mode(DisplayServerEnums::MouseMode p_mode) override;
|
||||
virtual DisplayServerEnums::MouseMode mouse_get_mode() const override;
|
||||
virtual void mouse_set_mode_override(DisplayServerEnums::MouseMode p_mode) override;
|
||||
virtual DisplayServerEnums::MouseMode mouse_get_mode_override() const override;
|
||||
virtual void mouse_set_mode_override_enabled(bool p_override_enabled) override;
|
||||
virtual bool mouse_is_mode_override_enabled() const override;
|
||||
|
||||
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, DisplayServer::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);
|
||||
static DisplayServer *create_func(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
static Vector<String> get_rendering_drivers_func();
|
||||
static void register_android_driver();
|
||||
|
||||
|
|
@ -269,6 +269,6 @@ public:
|
|||
|
||||
virtual bool is_window_transparency_available() const override;
|
||||
|
||||
DisplayServerAndroid(const String &p_rendering_driver, WindowMode p_mode, DisplayServer::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);
|
||||
DisplayServerAndroid(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
~DisplayServerAndroid();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|||
String package_name = p_preset->get("package/unique_name");
|
||||
|
||||
const int screen_orientation =
|
||||
_get_android_orientation_value(DisplayServer::ScreenOrientation(int(get_project_setting(p_preset, "display/window/handheld/orientation"))));
|
||||
_get_android_orientation_value(DisplayServerEnums::ScreenOrientation(int(get_project_setting(p_preset, "display/window/handheld/orientation"))));
|
||||
|
||||
bool screen_support_small = p_preset->get("screen/support_small");
|
||||
bool screen_support_normal = p_preset->get("screen/support_normal");
|
||||
|
|
|
|||
|
|
@ -33,41 +33,41 @@
|
|||
#include "core/string/translation_server.h"
|
||||
#include "modules/regex/regex.h"
|
||||
|
||||
int _get_android_orientation_value(DisplayServer::ScreenOrientation screen_orientation) {
|
||||
int _get_android_orientation_value(DisplayServerEnums::ScreenOrientation screen_orientation) {
|
||||
switch (screen_orientation) {
|
||||
case DisplayServer::SCREEN_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_PORTRAIT:
|
||||
return 1;
|
||||
case DisplayServer::SCREEN_REVERSE_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_LANDSCAPE:
|
||||
return 8;
|
||||
case DisplayServer::SCREEN_REVERSE_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_PORTRAIT:
|
||||
return 9;
|
||||
case DisplayServer::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_LANDSCAPE:
|
||||
return 11;
|
||||
case DisplayServer::SCREEN_SENSOR_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_PORTRAIT:
|
||||
return 12;
|
||||
case DisplayServer::SCREEN_SENSOR:
|
||||
case DisplayServerEnums::SCREEN_SENSOR:
|
||||
return 13;
|
||||
case DisplayServer::SCREEN_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_LANDSCAPE:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
String _get_android_orientation_label(DisplayServer::ScreenOrientation screen_orientation) {
|
||||
String _get_android_orientation_label(DisplayServerEnums::ScreenOrientation screen_orientation) {
|
||||
switch (screen_orientation) {
|
||||
case DisplayServer::SCREEN_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_PORTRAIT:
|
||||
return "portrait";
|
||||
case DisplayServer::SCREEN_REVERSE_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_LANDSCAPE:
|
||||
return "reverseLandscape";
|
||||
case DisplayServer::SCREEN_REVERSE_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_REVERSE_PORTRAIT:
|
||||
return "reversePortrait";
|
||||
case DisplayServer::SCREEN_SENSOR_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_LANDSCAPE:
|
||||
return "userLandscape";
|
||||
case DisplayServer::SCREEN_SENSOR_PORTRAIT:
|
||||
case DisplayServerEnums::SCREEN_SENSOR_PORTRAIT:
|
||||
return "userPortrait";
|
||||
case DisplayServer::SCREEN_SENSOR:
|
||||
case DisplayServerEnums::SCREEN_SENSOR:
|
||||
return "fullUser";
|
||||
case DisplayServer::SCREEN_LANDSCAPE:
|
||||
case DisplayServerEnums::SCREEN_LANDSCAPE:
|
||||
default:
|
||||
return "landscape";
|
||||
}
|
||||
|
|
@ -306,7 +306,7 @@ String _get_activity_tag(const Ref<EditorExportPlatform> &p_export_platform, con
|
|||
}
|
||||
|
||||
// Update the GodotApp activity tag.
|
||||
String orientation = _get_android_orientation_label(DisplayServer::ScreenOrientation(int(p_export_platform->get_project_setting(p_preset, "display/window/handheld/orientation"))));
|
||||
String orientation = _get_android_orientation_label(DisplayServerEnums::ScreenOrientation(int(p_export_platform->get_project_setting(p_preset, "display/window/handheld/orientation"))));
|
||||
String manifest_activity_text = vformat(
|
||||
" <activity android:name=\".GodotApp\" "
|
||||
"tools:replace=\"android:screenOrientation,android:excludeFromRecents,android:resizeableActivity\" "
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#include "core/os/os.h"
|
||||
#include "editor/export/editor_export.h"
|
||||
#include "editor/export/editor_export_platform.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/display/display_server_enums.h"
|
||||
|
||||
const String GODOT_PROJECT_NAME_XML_STRING = R"(<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--WARNING: THIS FILE WILL BE OVERWRITTEN AT BUILD TIME-->
|
||||
|
|
@ -77,9 +77,9 @@ struct MetadataInfo {
|
|||
String value;
|
||||
};
|
||||
|
||||
int _get_android_orientation_value(DisplayServer::ScreenOrientation screen_orientation);
|
||||
int _get_android_orientation_value(DisplayServerEnums::ScreenOrientation screen_orientation);
|
||||
|
||||
String _get_android_orientation_label(DisplayServer::ScreenOrientation screen_orientation);
|
||||
String _get_android_orientation_label(DisplayServerEnums::ScreenOrientation screen_orientation);
|
||||
|
||||
int _get_app_category_value(int category_index);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class GodotEditText extends EditText {
|
|||
private final static int HANDLER_OPEN_IME_KEYBOARD = 2;
|
||||
private final static int HANDLER_CLOSE_IME_KEYBOARD = 3;
|
||||
|
||||
// Enum must be kept up-to-date with DisplayServer::VirtualKeyboardType
|
||||
// Enum must be kept up-to-date with DisplayServerEnums::VirtualKeyboardType
|
||||
public enum VirtualKeyboardType {
|
||||
KEYBOARD_TYPE_DEFAULT,
|
||||
KEYBOARD_TYPE_MULTILINE,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ import java.util.Set;
|
|||
*/
|
||||
@Keep
|
||||
public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.OnInitListener {
|
||||
// Note: These constants must be in sync with DisplayServer::TTSUtteranceEvent enum from "servers/display/display_server.h".
|
||||
// Note: These constants must be in sync with DisplayServerEnums::TTSUtteranceEvent enum from "servers/display/display_server.h".
|
||||
final private static int EVENT_START = 0;
|
||||
final private static int EVENT_END = 1;
|
||||
final private static int EVENT_CANCEL = 2;
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, jcl
|
|||
}
|
||||
|
||||
if (DisplayServerAndroid *dsa = Object::cast_to<DisplayServerAndroid>(DisplayServer::get_singleton())) {
|
||||
dsa->send_window_event(DisplayServer::WINDOW_EVENT_GO_BACK_REQUEST);
|
||||
dsa->send_window_event(DisplayServerEnums::WINDOW_EVENT_GO_BACK_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ void OS_Android::_on_main_screen_changed(const String &p_screen_name) {
|
|||
#endif
|
||||
|
||||
void OS_Android::main_loop_focusout() {
|
||||
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_OUT);
|
||||
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServerEnums::WINDOW_EVENT_FOCUS_OUT);
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT);
|
||||
}
|
||||
|
|
@ -423,7 +423,7 @@ void OS_Android::main_loop_focusout() {
|
|||
}
|
||||
|
||||
void OS_Android::main_loop_focusin() {
|
||||
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_IN);
|
||||
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServerEnums::WINDOW_EVENT_FOCUS_IN);
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_IN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@
|
|||
#include "os_android.h"
|
||||
#include "thread_jandroid.h"
|
||||
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
bool TTS_Android::initialized = false;
|
||||
jobject TTS_Android::tts = nullptr;
|
||||
jclass TTS_Android::cls = nullptr;
|
||||
|
|
@ -152,7 +154,7 @@ void TTS_Android::_java_utterance_callback(int p_event, int64_t p_id, int p_pos)
|
|||
ERR_FAIL_COND_MSG(!initialized || tts == nullptr, "Text to Speech not initialized.");
|
||||
if (ids.has(p_id)) {
|
||||
int pos = 0;
|
||||
if ((DisplayServer::TTSUtteranceEvent)p_event == DisplayServer::TTS_UTTERANCE_BOUNDARY) {
|
||||
if ((DisplayServerEnums::TTSUtteranceEvent)p_event == DisplayServerEnums::TTS_UTTERANCE_BOUNDARY) {
|
||||
// Convert position from UTF-16 to UTF-32.
|
||||
const Char16String &string = ids[p_id];
|
||||
for (int i = 0; i < MIN(p_pos, string.length()); i++) {
|
||||
|
|
@ -162,10 +164,10 @@ void TTS_Android::_java_utterance_callback(int p_event, int64_t p_id, int p_pos)
|
|||
}
|
||||
pos++;
|
||||
}
|
||||
} else if ((DisplayServer::TTSUtteranceEvent)p_event != DisplayServer::TTS_UTTERANCE_STARTED) {
|
||||
} else if ((DisplayServerEnums::TTSUtteranceEvent)p_event != DisplayServerEnums::TTS_UTTERANCE_STARTED) {
|
||||
ids.erase(p_id);
|
||||
}
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event((DisplayServer::TTSUtteranceEvent)p_event, p_id, pos);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event((DisplayServerEnums::TTSUtteranceEvent)p_event, p_id, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -240,7 +242,7 @@ void TTS_Android::speak(const String &p_text, const String &p_voice, int p_volum
|
|||
}
|
||||
|
||||
if (p_text.is_empty()) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, p_utterance_id);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, p_utterance_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -290,7 +292,7 @@ void TTS_Android::stop() {
|
|||
}
|
||||
ERR_FAIL_COND_MSG(!initialized || tts == nullptr, "Text to Speech not initialized.");
|
||||
for (const KeyValue<int64_t, Char16String> &E : ids) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, E.key);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, E.key);
|
||||
}
|
||||
ids.clear();
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include "core/string/ustring.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/variant/array.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -37,20 +37,20 @@ class DisplayServerIOS final : public DisplayServerAppleEmbedded {
|
|||
|
||||
_THREAD_SAFE_CLASS_
|
||||
|
||||
DisplayServerIOS(const String &p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::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);
|
||||
DisplayServerIOS(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
~DisplayServerIOS();
|
||||
|
||||
public:
|
||||
static DisplayServerIOS *get_singleton();
|
||||
|
||||
static void register_ios_driver();
|
||||
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, DisplayServer::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);
|
||||
static DisplayServer *create_func(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
|
||||
virtual String get_name() const override;
|
||||
|
||||
virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual int screen_get_dpi(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_scale(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
|
||||
protected:
|
||||
virtual bool _screen_hdr_is_supported() const override;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ DisplayServerIOS *DisplayServerIOS::get_singleton() {
|
|||
return (DisplayServerIOS *)DisplayServerAppleEmbedded::get_singleton();
|
||||
}
|
||||
|
||||
DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode p_mode, DisplayServer::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) :
|
||||
DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error) :
|
||||
DisplayServerAppleEmbedded(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_position, p_resolution, p_screen, p_context, p_parent_window, r_error) {
|
||||
// See: https://github.com/godotengine/godot/pull/106814#discussion_r2854262156 for why this was set to 203 nits.
|
||||
hardware_reference_luminance_nits = 203.0f;
|
||||
|
|
@ -48,7 +48,7 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode
|
|||
DisplayServerIOS::~DisplayServerIOS() {
|
||||
}
|
||||
|
||||
DisplayServer *DisplayServerIOS::create_func(const String &p_rendering_driver, WindowMode p_mode, DisplayServer::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) {
|
||||
DisplayServer *DisplayServerIOS::create_func(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error) {
|
||||
return memnew(DisplayServerIOS(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_position, p_resolution, p_screen, p_context, p_parent_window, r_error));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@
|
|||
#include "core/object/callable_method_pointer.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/string/ustring.h"
|
||||
#include "core/variant/typed_array.h"
|
||||
#include "core/variant/variant.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#ifdef SOWRAP_ENABLED
|
||||
#include "dbus-so_wrap.h"
|
||||
|
|
@ -680,12 +682,12 @@ bool FreeDesktopPortalDesktop::send_request(DBusMessage *p_message, const String
|
|||
return true;
|
||||
}
|
||||
|
||||
Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_window_id, const String &p_xid, const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, DisplayServer::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb) {
|
||||
Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServerEnums::WindowID p_window_id, const String &p_xid, const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, DisplayServerEnums::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb) {
|
||||
if (unsupported) {
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
ERR_FAIL_INDEX_V(int(p_mode), DisplayServer::FILE_DIALOG_MODE_SAVE_MAX, FAILED);
|
||||
ERR_FAIL_INDEX_V(int(p_mode), DisplayServerEnums::FILE_DIALOG_MODE_SAVE_MAX, FAILED);
|
||||
ERR_FAIL_NULL_V(monitor_connection, FAILED);
|
||||
|
||||
Vector<String> filter_names;
|
||||
|
|
@ -739,7 +741,7 @@ Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_windo
|
|||
|
||||
// Generate FileChooser message.
|
||||
const char *method = nullptr;
|
||||
if (p_mode == DisplayServer::FILE_DIALOG_MODE_SAVE_FILE) {
|
||||
if (p_mode == DisplayServerEnums::FILE_DIALOG_MODE_SAVE_FILE) {
|
||||
method = "SaveFile";
|
||||
} else {
|
||||
method = "OpenFile";
|
||||
|
|
@ -757,13 +759,13 @@ Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_windo
|
|||
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &arr_iter);
|
||||
|
||||
append_dbus_dict_string(&arr_iter, "handle_token", token);
|
||||
append_dbus_dict_bool(&arr_iter, "multiple", p_mode == DisplayServer::FILE_DIALOG_MODE_OPEN_FILES);
|
||||
append_dbus_dict_bool(&arr_iter, "directory", p_mode == DisplayServer::FILE_DIALOG_MODE_OPEN_DIR);
|
||||
append_dbus_dict_bool(&arr_iter, "multiple", p_mode == DisplayServerEnums::FILE_DIALOG_MODE_OPEN_FILES);
|
||||
append_dbus_dict_bool(&arr_iter, "directory", p_mode == DisplayServerEnums::FILE_DIALOG_MODE_OPEN_DIR);
|
||||
append_dbus_dict_filters(&arr_iter, filter_names, filter_exts, filter_mimes);
|
||||
|
||||
append_dbus_dict_options(&arr_iter, p_options, fd.option_ids);
|
||||
append_dbus_dict_string(&arr_iter, "current_folder", p_current_directory, true);
|
||||
if (p_mode == DisplayServer::FILE_DIALOG_MODE_SAVE_FILE) {
|
||||
if (p_mode == DisplayServerEnums::FILE_DIALOG_MODE_SAVE_FILE) {
|
||||
append_dbus_dict_string(&arr_iter, "current_name", p_filename);
|
||||
}
|
||||
|
||||
|
|
@ -948,7 +950,7 @@ void FreeDesktopPortalDesktop::_thread_monitor(void *p_ud) {
|
|||
cb.opt_in_cb = fd.opt_in_cb;
|
||||
portal->pending_file_cbs.push_back(cb);
|
||||
}
|
||||
if (fd.prev_focus != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (fd.prev_focus != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
callable_mp(DisplayServer::get_singleton(), &DisplayServer::window_move_to_foreground).call_deferred(fd.prev_focus);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,10 @@
|
|||
|
||||
#ifdef DBUS_ENABLED
|
||||
|
||||
#include "core/object/object.h"
|
||||
#include "core/os/thread.h"
|
||||
#include "core/os/thread_safe.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/display/display_server_enums.h"
|
||||
|
||||
struct DBusMessage;
|
||||
struct DBusConnection;
|
||||
|
|
@ -87,7 +88,7 @@ private:
|
|||
struct FileDialogData {
|
||||
Vector<String> filter_names;
|
||||
HashMap<String, String> option_ids;
|
||||
DisplayServer::WindowID prev_focus = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID prev_focus = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
Callable callback;
|
||||
String filter;
|
||||
String path;
|
||||
|
|
@ -132,7 +133,7 @@ public:
|
|||
bool is_inhibit_supported();
|
||||
|
||||
// org.freedesktop.portal.FileChooser methods.
|
||||
Error file_dialog_show(DisplayServer::WindowID p_window_id, const String &p_xid, const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, DisplayServer::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb);
|
||||
Error file_dialog_show(DisplayServerEnums::WindowID p_window_id, const String &p_xid, const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, DisplayServerEnums::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb);
|
||||
void process_callbacks();
|
||||
|
||||
// org.freedesktop.portal.Settings methods.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/object/callable_method_pointer.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/text/text_server.h"
|
||||
|
||||
TTS_Linux *TTS_Linux::singleton = nullptr;
|
||||
|
|
@ -91,7 +92,7 @@ void TTS_Linux::_speech_index_mark(int p_msg_id, int p_type, const String &p_ind
|
|||
_THREAD_SAFE_METHOD_
|
||||
|
||||
if (ids.has(p_msg_id)) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, ids[p_msg_id], p_index_mark.to_int());
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_BOUNDARY, ids[p_msg_id], p_index_mark.to_int());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -125,19 +126,19 @@ void TTS_Linux::_speech_event(int p_msg_id, int p_type) {
|
|||
|
||||
if (!paused && ids.has(p_msg_id)) {
|
||||
if ((SPDNotificationType)p_type == SPD_EVENT_END) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, ids[p_msg_id]);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_ENDED, ids[p_msg_id]);
|
||||
ids.erase(p_msg_id);
|
||||
last_msg_id = -1;
|
||||
speaking = false;
|
||||
} else if ((SPDNotificationType)p_type == SPD_EVENT_CANCEL) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[p_msg_id]);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, ids[p_msg_id]);
|
||||
ids.erase(p_msg_id);
|
||||
last_msg_id = -1;
|
||||
speaking = false;
|
||||
}
|
||||
}
|
||||
if (!speaking && queue.size() > 0) {
|
||||
DisplayServer::TTSUtterance &message = queue.front()->get();
|
||||
TTSUtterance &message = queue.front()->get();
|
||||
|
||||
// Inject index mark after each word.
|
||||
String text;
|
||||
|
|
@ -175,7 +176,7 @@ void TTS_Linux::_speech_event(int p_msg_id, int p_type) {
|
|||
spd_set_data_mode(synth, SPD_DATA_SSML);
|
||||
last_msg_id = spd_say(synth, SPD_TEXT, text.utf8().get_data());
|
||||
ids[last_msg_id] = message.id;
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, message.id);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_STARTED, message.id);
|
||||
|
||||
queue.pop_front();
|
||||
speaking = true;
|
||||
|
|
@ -217,11 +218,11 @@ void TTS_Linux::speak(const String &p_text, const String &p_voice, int p_volume,
|
|||
}
|
||||
|
||||
if (p_text.is_empty()) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, p_utterance_id);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, p_utterance_id);
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayServer::TTSUtterance message;
|
||||
TTSUtterance message;
|
||||
message.text = p_text;
|
||||
message.voice = p_voice;
|
||||
message.volume = CLAMP(p_volume, 0, 100);
|
||||
|
|
@ -258,11 +259,11 @@ void TTS_Linux::stop() {
|
|||
_THREAD_SAFE_METHOD_
|
||||
|
||||
ERR_FAIL_NULL(synth);
|
||||
for (DisplayServer::TTSUtterance &message : queue) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id);
|
||||
for (TTSUtterance &message : queue) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, message.id);
|
||||
}
|
||||
if ((last_msg_id != -1) && ids.has(last_msg_id)) {
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[last_msg_id]);
|
||||
DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServerEnums::TTS_UTTERANCE_CANCELED, ids[last_msg_id]);
|
||||
}
|
||||
queue.clear();
|
||||
ids.clear();
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/object/object.h"
|
||||
#include "core/os/thread.h"
|
||||
#include "core/os/thread_safe.h"
|
||||
#include "core/string/ustring.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/list.h"
|
||||
#include "core/variant/array.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#ifdef SOWRAP_ENABLED
|
||||
#include "speechd-so_wrap.h"
|
||||
|
|
@ -44,11 +44,13 @@
|
|||
#include <libspeechd.h>
|
||||
#endif
|
||||
|
||||
struct TTSUtterance;
|
||||
|
||||
class TTS_Linux : public Object {
|
||||
GDSOFTCLASS(TTS_Linux, Object);
|
||||
_THREAD_SAFE_CLASS_
|
||||
|
||||
List<DisplayServer::TTSUtterance> queue;
|
||||
List<TTSUtterance> queue;
|
||||
SPDConnection *synth = nullptr;
|
||||
bool speaking = false;
|
||||
bool paused = false;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -62,15 +62,15 @@ class DisplayServerWayland : public DisplayServer {
|
|||
GDSOFTCLASS(DisplayServerWayland, DisplayServer);
|
||||
|
||||
struct WindowData {
|
||||
WindowID id = INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
WindowID parent_id = INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID parent_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
// For popups.
|
||||
WindowID root_id = INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID root_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
// For toplevels.
|
||||
List<WindowID> popup_stack;
|
||||
List<DisplayServerEnums::WindowID> popup_stack;
|
||||
|
||||
Rect2i rect;
|
||||
Size2i max_size;
|
||||
|
|
@ -87,11 +87,11 @@ class DisplayServerWayland : public DisplayServer {
|
|||
// Flags whether we have allocated a buffer through the video drivers.
|
||||
bool visible = false;
|
||||
|
||||
DisplayServer::VSyncMode vsync_mode = VSYNC_ENABLED;
|
||||
DisplayServerEnums::VSyncMode vsync_mode = DisplayServerEnums::VSYNC_ENABLED;
|
||||
|
||||
uint32_t flags = 0;
|
||||
|
||||
DisplayServer::WindowMode mode = WINDOW_MODE_WINDOWED;
|
||||
DisplayServerEnums::WindowMode mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
|
||||
Callable rect_changed_callback;
|
||||
Callable window_event_callback;
|
||||
|
|
@ -114,28 +114,28 @@ class DisplayServerWayland : public DisplayServer {
|
|||
CAPABILITY, // New "suspended" wm_capability flag.
|
||||
};
|
||||
|
||||
CursorShape cursor_shape = CURSOR_ARROW;
|
||||
DisplayServer::MouseMode mouse_mode = DisplayServer::MOUSE_MODE_VISIBLE;
|
||||
DisplayServer::MouseMode mouse_mode_base = MOUSE_MODE_VISIBLE;
|
||||
DisplayServer::MouseMode mouse_mode_override = MOUSE_MODE_VISIBLE;
|
||||
DisplayServerEnums::CursorShape cursor_shape = DisplayServerEnums::CURSOR_ARROW;
|
||||
DisplayServerEnums::MouseMode mouse_mode = DisplayServerEnums::MOUSE_MODE_VISIBLE;
|
||||
DisplayServerEnums::MouseMode mouse_mode_base = DisplayServerEnums::MOUSE_MODE_VISIBLE;
|
||||
DisplayServerEnums::MouseMode mouse_mode_override = DisplayServerEnums::MOUSE_MODE_VISIBLE;
|
||||
bool mouse_mode_override_enabled = false;
|
||||
void _mouse_update_mode();
|
||||
|
||||
HashMap<CursorShape, CustomCursor> custom_cursors;
|
||||
HashMap<DisplayServerEnums::CursorShape, CustomCursor> custom_cursors;
|
||||
|
||||
HashMap<WindowID, WindowData> windows;
|
||||
WindowID window_id_counter = MAIN_WINDOW_ID;
|
||||
HashMap<DisplayServerEnums::WindowID, WindowData> windows;
|
||||
DisplayServerEnums::WindowID window_id_counter = DisplayServerEnums::MAIN_WINDOW_ID;
|
||||
|
||||
WaylandThread wayland_thread;
|
||||
|
||||
Context context;
|
||||
DisplayServerEnums::Context context;
|
||||
bool swap_cancel_ok = false;
|
||||
|
||||
// NOTE: These are the based on WINDOW_FLAG_POPUP, which does NOT imply what it
|
||||
// NOTE: These are the based on DisplayServerEnums::WINDOW_FLAG_POPUP, which does NOT imply what it
|
||||
// seems. It's particularly confusing for our usecase, but just know that these
|
||||
// are the "take all input thx" windows while the `popup_stack` variable keeps
|
||||
// track of all the generic floating window concept.
|
||||
List<WindowID> popup_menu_list;
|
||||
List<DisplayServerEnums::WindowID> popup_menu_list;
|
||||
BitField<MouseButtonMask> last_mouse_monitor_mask = MouseButtonMask::NONE;
|
||||
|
||||
String ime_text;
|
||||
|
|
@ -166,21 +166,21 @@ class DisplayServerWayland : public DisplayServer {
|
|||
FreeDesktopScreenSaver *screensaver = nullptr;
|
||||
bool screensaver_inhibited = false;
|
||||
#endif
|
||||
static String _get_app_id_from_context(Context p_context);
|
||||
static String _get_app_id_from_context(DisplayServerEnums::Context p_context);
|
||||
|
||||
void _send_window_event(WindowEvent p_event, WindowID p_window_id = MAIN_WINDOW_ID);
|
||||
void _send_window_event(DisplayServerEnums::WindowEvent p_event, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
|
||||
static void dispatch_input_events(const Ref<InputEvent> &p_event);
|
||||
void _dispatch_input_event(const Ref<InputEvent> &p_event);
|
||||
|
||||
void _update_window_rect(const Rect2i &p_rect, WindowID p_window_id = MAIN_WINDOW_ID);
|
||||
void _update_window_rect(const Rect2i &p_rect, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
|
||||
void try_suspend();
|
||||
|
||||
void initialize_tts() const;
|
||||
|
||||
public:
|
||||
virtual bool has_feature(Feature p_feature) const override;
|
||||
virtual bool has_feature(DisplayServerEnums::Feature p_feature) const override;
|
||||
|
||||
virtual String get_name() const override;
|
||||
|
||||
|
|
@ -201,16 +201,16 @@ public:
|
|||
virtual Color get_accent_color() const override;
|
||||
virtual void set_system_theme_change_callback(const Callable &p_callable) override;
|
||||
|
||||
virtual Error 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) override;
|
||||
virtual Error 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) override;
|
||||
virtual Error file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, DisplayServerEnums::FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback, DisplayServerEnums::WindowID p_window_id) override;
|
||||
virtual Error 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, DisplayServerEnums::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, DisplayServerEnums::WindowID p_window_id) override;
|
||||
#endif
|
||||
|
||||
virtual void beep() const override;
|
||||
|
||||
virtual void mouse_set_mode(MouseMode p_mode) override;
|
||||
virtual MouseMode mouse_get_mode() const override;
|
||||
virtual void mouse_set_mode_override(MouseMode p_mode) override;
|
||||
virtual MouseMode mouse_get_mode_override() const override;
|
||||
virtual void mouse_set_mode(DisplayServerEnums::MouseMode p_mode) override;
|
||||
virtual DisplayServerEnums::MouseMode mouse_get_mode() const override;
|
||||
virtual void mouse_set_mode_override(DisplayServerEnums::MouseMode p_mode) override;
|
||||
virtual DisplayServerEnums::MouseMode mouse_get_mode_override() const override;
|
||||
virtual void mouse_set_mode_override_enabled(bool p_override_enabled) override;
|
||||
virtual bool mouse_is_mode_override_enabled() const override;
|
||||
|
||||
|
|
@ -226,83 +226,83 @@ public:
|
|||
|
||||
virtual int get_screen_count() const override;
|
||||
virtual int get_primary_screen() const override;
|
||||
virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Point2i screen_get_position(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Size2i screen_get_size(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual int screen_get_dpi(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_scale(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = DisplayServerEnums::SCREEN_OF_MAIN_WINDOW) const override;
|
||||
|
||||
virtual void screen_set_keep_on(bool p_enable) override;
|
||||
virtual bool screen_is_kept_on() const override;
|
||||
|
||||
virtual Vector<DisplayServer::WindowID> get_window_list() const override;
|
||||
virtual Vector<DisplayServerEnums::WindowID> get_window_list() const override;
|
||||
|
||||
virtual WindowID create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i(), bool p_exclusive = false, WindowID p_transient_parent = INVALID_WINDOW_ID) override;
|
||||
virtual void show_window(WindowID p_id) override;
|
||||
virtual void delete_sub_window(WindowID p_id) override;
|
||||
virtual DisplayServerEnums::WindowID create_sub_window(DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i(), bool p_exclusive = false, DisplayServerEnums::WindowID p_transient_parent = DisplayServerEnums::INVALID_WINDOW_ID) override;
|
||||
virtual void show_window(DisplayServerEnums::WindowID p_id) override;
|
||||
virtual void delete_sub_window(DisplayServerEnums::WindowID p_id) override;
|
||||
|
||||
virtual WindowID window_get_active_popup() const override;
|
||||
virtual void window_set_popup_safe_rect(WindowID p_window, const Rect2i &p_rect) override;
|
||||
virtual Rect2i window_get_popup_safe_rect(WindowID p_window) const override;
|
||||
virtual DisplayServerEnums::WindowID window_get_active_popup() const override;
|
||||
virtual void window_set_popup_safe_rect(DisplayServerEnums::WindowID p_window, const Rect2i &p_rect) override;
|
||||
virtual Rect2i window_get_popup_safe_rect(DisplayServerEnums::WindowID p_window) const override;
|
||||
|
||||
virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual int64_t window_get_native_handle(DisplayServerEnums::HandleType p_handle_type, DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual WindowID get_window_at_screen_position(const Point2i &p_position) const override;
|
||||
virtual DisplayServerEnums::WindowID get_window_at_screen_position(const Point2i &p_position) const override;
|
||||
|
||||
virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual ObjectID window_get_attached_instance_id(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_attach_instance_id(ObjectID p_instance, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual ObjectID window_get_attached_instance_id(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_title(const String &p_title, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_title(const String &p_title, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_mouse_passthrough(const Vector<Vector2> &p_region, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_rect_changed_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_window_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_event_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_input_text_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_drop_files_callback(const Callable &p_callable, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual int window_get_current_screen(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_current_screen(int p_screen, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual int window_get_current_screen(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_current_screen(int p_screen, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual Point2i window_get_position(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual Point2i window_get_position_with_decorations(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_position(const Point2i &p_position, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual Point2i window_get_position(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual Point2i window_get_position_with_decorations(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_position(const Point2i &p_position, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual void window_set_max_size(const Size2i p_size, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_max_size(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void gl_window_make_current(DisplayServer::WindowID p_window_id) override;
|
||||
virtual void window_set_max_size(const Size2i p_size, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_max_size(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual void gl_window_make_current(DisplayServerEnums::WindowID p_window_id) override;
|
||||
|
||||
virtual void window_set_transient(WindowID p_window_id, WindowID p_parent) override;
|
||||
virtual void window_set_transient(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowID p_parent) override;
|
||||
|
||||
virtual void window_set_min_size(const Size2i p_size, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_min_size(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_min_size(const Size2i p_size, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_min_size(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_size(const Size2i p_size, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_size(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual Size2i window_get_size_with_decorations(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_size(const Size2i p_size, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual Size2i window_get_size(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
virtual Size2i window_get_size_with_decorations(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual float window_get_scale(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual float window_get_scale(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_mode(WindowMode p_mode, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual WindowMode window_get_mode(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_mode(DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServerEnums::WindowMode window_get_mode(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool window_is_maximize_allowed(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_is_maximize_allowed(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_set_flag(DisplayServerEnums::WindowFlags p_flag, bool p_enabled, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_get_flag(DisplayServerEnums::WindowFlags p_flag, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual void window_request_attention(WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_request_attention(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual void window_move_to_foreground(WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override;
|
||||
virtual void window_move_to_foreground(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual bool window_is_focused(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool window_can_draw(WindowID p_window_id = MAIN_WINDOW_ID) const override;
|
||||
virtual bool window_can_draw(DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) const override;
|
||||
|
||||
virtual bool can_any_window_draw() const override;
|
||||
|
||||
virtual void window_set_ime_active(const bool p_active, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_ime_position(const Point2i &p_pos, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_ime_active(const bool p_active, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_set_ime_position(const Point2i &p_pos, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
|
||||
virtual int accessibility_should_increase_contrast() const override;
|
||||
virtual int accessibility_screen_reader_active() const override;
|
||||
|
|
@ -310,19 +310,19 @@ public:
|
|||
virtual Point2i ime_get_selection() const override;
|
||||
virtual String ime_get_text() const override;
|
||||
|
||||
virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window_id = MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_window_id) const override;
|
||||
virtual void window_set_vsync_mode(DisplayServerEnums::VSyncMode p_vsync_mode, DisplayServerEnums::WindowID p_window_id = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual DisplayServerEnums::VSyncMode window_get_vsync_mode(DisplayServerEnums::WindowID p_window_id) const override;
|
||||
|
||||
virtual void window_start_drag(WindowID p_window = MAIN_WINDOW_ID) override;
|
||||
virtual void window_start_resize(WindowResizeEdge p_edge, WindowID p_window) override;
|
||||
virtual void window_start_drag(DisplayServerEnums::WindowID p_window = DisplayServerEnums::MAIN_WINDOW_ID) override;
|
||||
virtual void window_start_resize(DisplayServerEnums::WindowResizeEdge p_edge, DisplayServerEnums::WindowID p_window) override;
|
||||
|
||||
virtual void cursor_set_shape(CursorShape p_shape) override;
|
||||
virtual CursorShape cursor_get_shape() const override;
|
||||
virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
|
||||
virtual void cursor_set_shape(DisplayServerEnums::CursorShape p_shape) override;
|
||||
virtual DisplayServerEnums::CursorShape cursor_get_shape() const override;
|
||||
virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, DisplayServerEnums::CursorShape p_shape, const Vector2 &p_hotspot) override;
|
||||
|
||||
virtual bool get_swap_cancel_ok() override;
|
||||
|
||||
virtual Error embed_process(WindowID p_window, OS::ProcessID p_pid, const Rect2i &p_rect, bool p_visible, bool p_grab_focus) override;
|
||||
virtual Error embed_process(DisplayServerEnums::WindowID p_window, OS::ProcessID p_pid, const Rect2i &p_rect, bool p_visible, bool p_grab_focus) override;
|
||||
virtual Error request_close_embedded_process(OS::ProcessID p_pid) override;
|
||||
virtual Error remove_embedded_process(OS::ProcessID p_pid) override;
|
||||
virtual OS::ProcessID get_focused_process_id() override;
|
||||
|
|
@ -344,16 +344,16 @@ public:
|
|||
|
||||
virtual void set_icon(const Ref<Image> &p_icon) override;
|
||||
|
||||
virtual void set_context(Context p_context) override;
|
||||
virtual void set_context(DisplayServerEnums::Context p_context) override;
|
||||
|
||||
virtual bool is_window_transparency_available() const override;
|
||||
|
||||
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
static DisplayServer *create_func(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
static Vector<String> get_rendering_drivers_func();
|
||||
|
||||
static void register_wayland_driver();
|
||||
|
||||
DisplayServerWayland(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i &p_resolution, Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
DisplayServerWayland(const String &p_rendering_driver, DisplayServerEnums::WindowMode p_mode, DisplayServerEnums::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i &p_resolution, DisplayServerEnums::Context p_context, int64_t p_parent_window, Error &r_error);
|
||||
~DisplayServerWayland();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "wayland_thread.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/io/image.h"
|
||||
|
||||
#ifdef WAYLAND_ENABLED
|
||||
|
||||
|
|
@ -444,7 +445,7 @@ bool WaylandThread::_load_cursor_theme(int p_cursor_size) {
|
|||
"help"
|
||||
};
|
||||
|
||||
for (int i = 0; i < DisplayServer::CURSOR_MAX; i++) {
|
||||
for (int i = 0; i < DisplayServerEnums::CURSOR_MAX; i++) {
|
||||
struct wl_cursor *cursor = wl_cursor_theme_get_cursor(wl_cursor_theme, cursor_names[i]);
|
||||
|
||||
if (!cursor && cursor_names_fallback[i]) {
|
||||
|
|
@ -829,7 +830,7 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
|
|||
}
|
||||
|
||||
if (name == registry->wp_viewporter_name) {
|
||||
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : registry->wayland_thread->windows) {
|
||||
for (KeyValue<DisplayServerEnums::WindowID, WindowState> &pair : registry->wayland_thread->windows) {
|
||||
WindowState &ws = pair.value;
|
||||
if (registry->wp_viewporter) {
|
||||
wp_viewporter_destroy(registry->wp_viewporter);
|
||||
|
|
@ -867,7 +868,7 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
|
|||
}
|
||||
|
||||
if (name == registry->wp_fractional_scale_manager_name) {
|
||||
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : registry->wayland_thread->windows) {
|
||||
for (KeyValue<DisplayServerEnums::WindowID, WindowState> &pair : registry->wayland_thread->windows) {
|
||||
WindowState &ws = pair.value;
|
||||
|
||||
if (registry->wp_fractional_scale_manager) {
|
||||
|
|
@ -1368,7 +1369,7 @@ void WaylandThread::_xdg_toplevel_on_configure(void *data, struct xdg_toplevel *
|
|||
|
||||
// Expect the window to be in a plain state. It will get properly set if the
|
||||
// compositor reports otherwise below.
|
||||
ws->mode = DisplayServer::WINDOW_MODE_WINDOWED;
|
||||
ws->mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
ws->maximized = false;
|
||||
ws->fullscreen = false;
|
||||
ws->resizing = false;
|
||||
|
|
@ -1382,12 +1383,12 @@ void WaylandThread::_xdg_toplevel_on_configure(void *data, struct xdg_toplevel *
|
|||
wl_array_for_each(state, states) {
|
||||
switch (*state) {
|
||||
case XDG_TOPLEVEL_STATE_MAXIMIZED: {
|
||||
ws->mode = DisplayServer::WINDOW_MODE_MAXIMIZED;
|
||||
ws->mode = DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
ws->maximized = true;
|
||||
} break;
|
||||
|
||||
case XDG_TOPLEVEL_STATE_FULLSCREEN: {
|
||||
ws->mode = DisplayServer::WINDOW_MODE_FULLSCREEN;
|
||||
ws->mode = DisplayServerEnums::WINDOW_MODE_FULLSCREEN;
|
||||
ws->fullscreen = true;
|
||||
} break;
|
||||
|
||||
|
|
@ -1435,7 +1436,7 @@ void WaylandThread::_xdg_toplevel_on_close(void *data, struct xdg_toplevel *xdg_
|
|||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = ws->id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_CLOSE_REQUEST;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_CLOSE_REQUEST;
|
||||
ws->wayland_thread->push_message(msg);
|
||||
}
|
||||
|
||||
|
|
@ -1523,7 +1524,7 @@ void WaylandThread::_xdg_popup_on_popup_done(void *data, struct xdg_popup *xdg_p
|
|||
Ref<WindowEventMessage> ev_msg;
|
||||
ev_msg.instantiate();
|
||||
ev_msg->id = ws->id;
|
||||
ev_msg->event = DisplayServer::WINDOW_EVENT_FORCE_CLOSE;
|
||||
ev_msg->event = DisplayServerEnums::WINDOW_EVENT_FORCE_CLOSE;
|
||||
|
||||
ws->wayland_thread->push_message(ev_msg);
|
||||
}
|
||||
|
|
@ -1586,7 +1587,7 @@ void WaylandThread::libdecor_frame_on_configure(struct libdecor_frame *frame, st
|
|||
|
||||
// Expect the window to be in a plain state. It will get properly set if the
|
||||
// compositor reports otherwise below.
|
||||
ws->mode = DisplayServer::WINDOW_MODE_WINDOWED;
|
||||
ws->mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
ws->maximized = false;
|
||||
ws->fullscreen = false;
|
||||
ws->resizing = false;
|
||||
|
|
@ -1598,12 +1599,12 @@ void WaylandThread::libdecor_frame_on_configure(struct libdecor_frame *frame, st
|
|||
|
||||
if (libdecor_configuration_get_window_state(configuration, &window_state)) {
|
||||
if (window_state & LIBDECOR_WINDOW_STATE_MAXIMIZED) {
|
||||
ws->mode = DisplayServer::WINDOW_MODE_MAXIMIZED;
|
||||
ws->mode = DisplayServerEnums::WINDOW_MODE_MAXIMIZED;
|
||||
ws->maximized = true;
|
||||
}
|
||||
|
||||
if (window_state & LIBDECOR_WINDOW_STATE_FULLSCREEN) {
|
||||
ws->mode = DisplayServer::WINDOW_MODE_FULLSCREEN;
|
||||
ws->mode = DisplayServerEnums::WINDOW_MODE_FULLSCREEN;
|
||||
ws->fullscreen = true;
|
||||
}
|
||||
|
||||
|
|
@ -1642,7 +1643,7 @@ void WaylandThread::libdecor_frame_on_close(struct libdecor_frame *frame, void *
|
|||
Ref<WindowEventMessage> winevent_msg;
|
||||
winevent_msg.instantiate();
|
||||
winevent_msg->id = ws->id;
|
||||
winevent_msg->event = DisplayServer::WINDOW_EVENT_CLOSE_REQUEST;
|
||||
winevent_msg->event = DisplayServerEnums::WINDOW_EVENT_CLOSE_REQUEST;
|
||||
|
||||
ws->wayland_thread->push_message(winevent_msg);
|
||||
|
||||
|
|
@ -1828,14 +1829,14 @@ void WaylandThread::_wl_pointer_on_leave(void *data, struct wl_pointer *wl_point
|
|||
|
||||
PointerData &pd = ss->pointer_data_buffer;
|
||||
|
||||
if (pd.pointed_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (pd.pointed_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
// We're probably on a decoration or some other third-party thing.
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayServer::WindowID id = pd.pointed_id;
|
||||
DisplayServerEnums::WindowID id = pd.pointed_id;
|
||||
|
||||
pd.pointed_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
pd.pointed_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
pd.pressed_button_mask.clear();
|
||||
|
||||
DEBUG_LOG_WAYLAND_THREAD(vformat("Pointer left window %d.", id));
|
||||
|
|
@ -1946,20 +1947,20 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
|
|||
PointerData &pd = ss->pointer_data_buffer;
|
||||
|
||||
if (pd.pointed_id != old_pd.pointed_id) {
|
||||
if (old_pd.pointed_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (old_pd.pointed_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = old_pd.pointed_id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_MOUSE_EXIT;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_MOUSE_EXIT;
|
||||
|
||||
wayland_thread->push_message(msg);
|
||||
}
|
||||
|
||||
if (pd.pointed_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (pd.pointed_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = pd.pointed_id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_MOUSE_ENTER;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_MOUSE_ENTER;
|
||||
|
||||
wayland_thread->push_message(msg);
|
||||
}
|
||||
|
|
@ -1972,10 +1973,10 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
|
|||
// wl_pointer::button) within the same wl_pointer::frame. Because of this, we
|
||||
// need to account for when the currently pointed window might be invalid
|
||||
// (third-party or even none) and fall back to the old one.
|
||||
if (pd.pointed_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (pd.pointed_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
ws = ss->wayland_thread->window_get_state(pd.pointed_id);
|
||||
ERR_FAIL_NULL(ws);
|
||||
} else if (old_pd.pointed_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
} else if (old_pd.pointed_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
ws = ss->wayland_thread->window_get_state(old_pd.pointed_id);
|
||||
ERR_FAIL_NULL(ws);
|
||||
}
|
||||
|
|
@ -2293,7 +2294,7 @@ void WaylandThread::_wl_keyboard_on_enter(void *data, struct wl_keyboard *wl_key
|
|||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = ws->id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_FOCUS_IN;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_FOCUS_IN;
|
||||
wayland_thread->push_message(msg);
|
||||
|
||||
DEBUG_LOG_WAYLAND_THREAD(vformat("Keyboard focused window %d.", ws->id));
|
||||
|
|
@ -2316,7 +2317,7 @@ void WaylandThread::_wl_keyboard_on_leave(void *data, struct wl_keyboard *wl_key
|
|||
|
||||
ss->repeating_keycode = XKB_KEYCODE_INVALID;
|
||||
|
||||
if (ss->focused_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ss->focused_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
// We're probably on a decoration or some other third-party thing.
|
||||
return;
|
||||
}
|
||||
|
|
@ -2324,12 +2325,12 @@ void WaylandThread::_wl_keyboard_on_leave(void *data, struct wl_keyboard *wl_key
|
|||
WindowState *ws = wayland_thread->window_get_state(ss->focused_id);
|
||||
ERR_FAIL_NULL(ws);
|
||||
|
||||
ss->focused_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
ss->focused_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = ws->id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_FOCUS_OUT;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_FOCUS_OUT;
|
||||
wayland_thread->push_message(msg);
|
||||
|
||||
ss->shift_pressed = false;
|
||||
|
|
@ -2348,7 +2349,7 @@ void WaylandThread::_wl_keyboard_on_key(void *data, struct wl_keyboard *wl_keybo
|
|||
SeatState *ss = (SeatState *)data;
|
||||
ERR_FAIL_NULL(ss);
|
||||
|
||||
if (ss->focused_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ss->focused_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2433,7 +2434,7 @@ void WaylandThread::_wl_data_device_on_leave(void *data, struct wl_data_device *
|
|||
memdelete(wl_data_offer_get_offer_state(ss->wl_data_offer_dnd));
|
||||
wl_data_offer_destroy(ss->wl_data_offer_dnd);
|
||||
ss->wl_data_offer_dnd = nullptr;
|
||||
ss->dnd_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
ss->dnd_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2470,7 +2471,7 @@ void WaylandThread::_wl_data_device_on_drop(void *data, struct wl_data_device *w
|
|||
memdelete(wl_data_offer_get_offer_state(ss->wl_data_offer_dnd));
|
||||
wl_data_offer_destroy(ss->wl_data_offer_dnd);
|
||||
ss->wl_data_offer_dnd = nullptr;
|
||||
ss->dnd_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
ss->dnd_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
}
|
||||
|
||||
void WaylandThread::_wl_data_device_on_selection(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id) {
|
||||
|
|
@ -2831,14 +2832,14 @@ void WaylandThread::_wp_tablet_tool_on_proximity_out(void *data, struct zwp_tabl
|
|||
TabletToolState *ts = wp_tablet_tool_get_state(wp_tablet_tool_v2);
|
||||
ERR_FAIL_NULL(ts);
|
||||
|
||||
if (ts->data_pending.proximal_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ts->data_pending.proximal_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
// We're probably on a decoration or some other third-party thing.
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayServer::WindowID id = ts->data_pending.proximal_id;
|
||||
DisplayServerEnums::WindowID id = ts->data_pending.proximal_id;
|
||||
|
||||
ts->data_pending.proximal_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
ts->data_pending.proximal_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
ts->data_pending.pressed_button_mask.clear();
|
||||
|
||||
DEBUG_LOG_WAYLAND_THREAD(vformat("Tablet tool left window %d.", id));
|
||||
|
|
@ -2974,26 +2975,26 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_
|
|||
TabletToolData &td = ts->data_pending;
|
||||
|
||||
if (td.proximal_id != old_td.proximal_id) {
|
||||
if (old_td.proximal_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (old_td.proximal_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = old_td.proximal_id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_MOUSE_EXIT;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_MOUSE_EXIT;
|
||||
|
||||
wayland_thread->push_message(msg);
|
||||
}
|
||||
|
||||
if (td.proximal_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (td.proximal_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
Ref<WindowEventMessage> msg;
|
||||
msg.instantiate();
|
||||
msg->id = td.proximal_id;
|
||||
msg->event = DisplayServer::WINDOW_EVENT_MOUSE_ENTER;
|
||||
msg->event = DisplayServerEnums::WINDOW_EVENT_MOUSE_ENTER;
|
||||
|
||||
wayland_thread->push_message(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (td.proximal_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (td.proximal_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
// We're probably on a decoration or some other third-party thing. Let's
|
||||
// "commit" the data and call it a day.
|
||||
old_td = td;
|
||||
|
|
@ -3128,7 +3129,7 @@ void WaylandThread::_wp_text_input_on_leave(void *data, struct zwp_text_input_v3
|
|||
return;
|
||||
}
|
||||
|
||||
if (ss->ime_window_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ss->ime_window_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3139,7 +3140,7 @@ void WaylandThread::_wp_text_input_on_leave(void *data, struct zwp_text_input_v3
|
|||
msg->selection = Vector2i();
|
||||
ss->wayland_thread->push_message(msg);
|
||||
|
||||
ss->ime_window_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
ss->ime_window_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
ss->ime_enabled = false;
|
||||
ss->ime_active = false;
|
||||
ss->ime_text = String();
|
||||
|
|
@ -3153,7 +3154,7 @@ void WaylandThread::_wp_text_input_on_preedit_string(void *data, struct zwp_text
|
|||
return;
|
||||
}
|
||||
|
||||
if (ss->ime_window_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ss->ime_window_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3205,7 +3206,7 @@ void WaylandThread::_wp_text_input_on_commit_string(void *data, struct zwp_text_
|
|||
return;
|
||||
}
|
||||
|
||||
if (ss->ime_window_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ss->ime_window_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3222,7 +3223,7 @@ void WaylandThread::_wp_text_input_on_done(void *data, struct zwp_text_input_v3
|
|||
return;
|
||||
}
|
||||
|
||||
if (ss->ime_window_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (ss->ime_window_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3617,7 +3618,7 @@ void WaylandThread::window_state_update_size(WindowState *p_ws, int p_width, int
|
|||
Ref<WindowEventMessage> dpi_msg;
|
||||
dpi_msg.instantiate();
|
||||
dpi_msg->id = p_ws->id;
|
||||
dpi_msg->event = DisplayServer::WINDOW_EVENT_DPI_CHANGE;
|
||||
dpi_msg->event = DisplayServerEnums::WINDOW_EVENT_DPI_CHANGE;
|
||||
p_ws->wayland_thread->push_message(dpi_msg);
|
||||
}
|
||||
}
|
||||
|
|
@ -3666,7 +3667,7 @@ void WaylandThread::seat_state_lock_pointer(SeatState *p_ss) {
|
|||
if (p_ss->wp_locked_pointer == nullptr) {
|
||||
struct wl_surface *locked_surface = window_get_wl_surface(p_ss->pointer_data.last_pointed_id);
|
||||
if (locked_surface == nullptr) {
|
||||
locked_surface = window_get_wl_surface(DisplayServer::MAIN_WINDOW_ID);
|
||||
locked_surface = window_get_wl_surface(DisplayServerEnums::MAIN_WINDOW_ID);
|
||||
}
|
||||
ERR_FAIL_NULL(locked_surface);
|
||||
|
||||
|
|
@ -3687,7 +3688,7 @@ void WaylandThread::seat_state_warp_pointer(SeatState *p_ss, int p_x, int p_y) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (p_ss->pointer_data.pointed_id == DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (p_ss->pointer_data.pointed_id == DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3734,7 +3735,7 @@ void WaylandThread::seat_state_update_cursor(SeatState *p_ss) {
|
|||
int scale = 1;
|
||||
|
||||
if (thread->cursor_visible) {
|
||||
DisplayServer::CursorShape shape = thread->cursor_shape;
|
||||
DisplayServerEnums::CursorShape shape = thread->cursor_shape;
|
||||
|
||||
struct CustomCursor *custom_cursor = thread->custom_cursors.getptr(shape);
|
||||
|
||||
|
|
@ -3847,7 +3848,7 @@ Ref<WaylandThread::Message> WaylandThread::pop_message() {
|
|||
return Ref<Message>();
|
||||
}
|
||||
|
||||
void WaylandThread::window_create(DisplayServer::WindowID p_window_id, const Size2i &p_size, DisplayServer::WindowID p_parent_id) {
|
||||
void WaylandThread::window_create(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size, DisplayServerEnums::WindowID p_parent_id) {
|
||||
ERR_FAIL_COND(windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -3911,7 +3912,7 @@ void WaylandThread::window_create(DisplayServer::WindowID p_window_id, const Siz
|
|||
}
|
||||
}
|
||||
|
||||
if (p_parent_id != DisplayServer::INVALID_WINDOW_ID) {
|
||||
if (p_parent_id != DisplayServerEnums::INVALID_WINDOW_ID) {
|
||||
// NOTE: It's important to set the parent ASAP to avoid misunderstandings with
|
||||
// the compositor. For example, niri immediately resizes the window to full
|
||||
// size as soon as it's configured if it's not parented to another toplevel.
|
||||
|
|
@ -3937,7 +3938,7 @@ void WaylandThread::window_create(DisplayServer::WindowID p_window_id, const Siz
|
|||
window_state_update_size(&ws, ws.rect.size.width, ws.rect.size.height);
|
||||
}
|
||||
|
||||
void WaylandThread::window_create_popup(DisplayServer::WindowID p_window_id, DisplayServer::WindowID p_parent_id, Rect2i p_rect) {
|
||||
void WaylandThread::window_create_popup(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowID p_parent_id, Rect2i p_rect) {
|
||||
ERR_FAIL_COND(windows.has(p_window_id));
|
||||
ERR_FAIL_COND(!windows.has(p_parent_id));
|
||||
|
||||
|
|
@ -4024,7 +4025,7 @@ void WaylandThread::window_create_popup(DisplayServer::WindowID p_window_id, Dis
|
|||
wl_display_roundtrip(wl_display);
|
||||
}
|
||||
|
||||
void WaylandThread::window_destroy(DisplayServer::WindowID p_window_id) {
|
||||
void WaylandThread::window_destroy(DisplayServerEnums::WindowID p_window_id) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4074,7 +4075,7 @@ void WaylandThread::window_destroy(DisplayServer::WindowID p_window_id) {
|
|||
windows.erase(p_window_id);
|
||||
}
|
||||
|
||||
struct wl_surface *WaylandThread::window_get_wl_surface(DisplayServer::WindowID p_window_id) const {
|
||||
struct wl_surface *WaylandThread::window_get_wl_surface(DisplayServerEnums::WindowID p_window_id) const {
|
||||
const WindowState *ws = windows.getptr(p_window_id);
|
||||
if (ws) {
|
||||
return ws->wl_surface;
|
||||
|
|
@ -4083,15 +4084,15 @@ struct wl_surface *WaylandThread::window_get_wl_surface(DisplayServer::WindowID
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
WaylandThread::WindowState *WaylandThread::window_get_state(DisplayServer::WindowID p_window_id) {
|
||||
WaylandThread::WindowState *WaylandThread::window_get_state(DisplayServerEnums::WindowID p_window_id) {
|
||||
return windows.getptr(p_window_id);
|
||||
}
|
||||
|
||||
const WaylandThread::WindowState *WaylandThread::window_get_state(DisplayServer::WindowID p_window_id) const {
|
||||
const WaylandThread::WindowState *WaylandThread::window_get_state(DisplayServerEnums::WindowID p_window_id) const {
|
||||
return windows.getptr(p_window_id);
|
||||
}
|
||||
|
||||
Size2i WaylandThread::window_set_size(DisplayServer::WindowID p_window_id, const Size2i &p_size) {
|
||||
Size2i WaylandThread::window_set_size(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size) {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), p_size);
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4149,7 +4150,7 @@ void WaylandThread::beep() const {
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_start_drag(DisplayServer::WindowID p_window_id) {
|
||||
void WaylandThread::window_start_drag(DisplayServerEnums::WindowID p_window_id) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
|
||||
|
|
@ -4165,7 +4166,7 @@ void WaylandThread::window_start_drag(DisplayServer::WindowID p_window_id) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void WaylandThread::window_start_resize(DisplayServer::WindowResizeEdge p_edge, DisplayServer::WindowID p_window) {
|
||||
void WaylandThread::window_start_resize(DisplayServerEnums::WindowResizeEdge p_edge, DisplayServerEnums::WindowID p_window) {
|
||||
ERR_FAIL_COND(!windows.has(p_window));
|
||||
WindowState &ws = windows[p_window];
|
||||
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
|
||||
|
|
@ -4173,28 +4174,28 @@ void WaylandThread::window_start_resize(DisplayServer::WindowResizeEdge p_edge,
|
|||
if (ss && ws.xdg_toplevel) {
|
||||
xdg_toplevel_resize_edge edge = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
|
||||
switch (p_edge) {
|
||||
case DisplayServer::WINDOW_EDGE_TOP_LEFT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_TOP_LEFT: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_TOP: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_TOP: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_TOP_RIGHT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_TOP_RIGHT: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_LEFT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_LEFT: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_LEFT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_RIGHT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_RIGHT: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_BOTTOM_LEFT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_BOTTOM_LEFT: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_BOTTOM: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_BOTTOM: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_BOTTOM_RIGHT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_BOTTOM_RIGHT: {
|
||||
edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT;
|
||||
} break;
|
||||
default:
|
||||
|
|
@ -4207,28 +4208,28 @@ void WaylandThread::window_start_resize(DisplayServer::WindowResizeEdge p_edge,
|
|||
if (ws.libdecor_frame) {
|
||||
libdecor_resize_edge edge = LIBDECOR_RESIZE_EDGE_NONE;
|
||||
switch (p_edge) {
|
||||
case DisplayServer::WINDOW_EDGE_TOP_LEFT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_TOP_LEFT: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_TOP_LEFT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_TOP: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_TOP: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_TOP;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_TOP_RIGHT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_TOP_RIGHT: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_TOP_RIGHT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_LEFT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_LEFT: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_LEFT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_RIGHT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_RIGHT: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_RIGHT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_BOTTOM_LEFT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_BOTTOM_LEFT: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_BOTTOM_LEFT;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_BOTTOM: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_BOTTOM: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_BOTTOM;
|
||||
} break;
|
||||
case DisplayServer::WINDOW_EDGE_BOTTOM_RIGHT: {
|
||||
case DisplayServerEnums::WINDOW_EDGE_BOTTOM_RIGHT: {
|
||||
edge = LIBDECOR_RESIZE_EDGE_BOTTOM_RIGHT;
|
||||
} break;
|
||||
default:
|
||||
|
|
@ -4239,7 +4240,7 @@ void WaylandThread::window_start_resize(DisplayServer::WindowResizeEdge p_edge,
|
|||
#endif
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_parent(DisplayServer::WindowID p_window_id, DisplayServer::WindowID p_parent_id) {
|
||||
void WaylandThread::window_set_parent(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowID p_parent_id) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
ERR_FAIL_COND(!windows.has(p_parent_id));
|
||||
|
||||
|
|
@ -4264,7 +4265,7 @@ void WaylandThread::window_set_parent(DisplayServer::WindowID p_window_id, Displ
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_max_size(DisplayServer::WindowID p_window_id, const Size2i &p_size) {
|
||||
void WaylandThread::window_set_max_size(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4283,7 +4284,7 @@ void WaylandThread::window_set_max_size(DisplayServer::WindowID p_window_id, con
|
|||
#endif
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_min_size(DisplayServer::WindowID p_window_id, const Size2i &p_size) {
|
||||
void WaylandThread::window_set_min_size(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4302,17 +4303,17 @@ void WaylandThread::window_set_min_size(DisplayServer::WindowID p_window_id, con
|
|||
#endif
|
||||
}
|
||||
|
||||
bool WaylandThread::window_can_set_mode(DisplayServer::WindowID p_window_id, DisplayServer::WindowMode p_window_mode) const {
|
||||
bool WaylandThread::window_can_set_mode(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowMode p_window_mode) const {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), false);
|
||||
const WindowState &ws = windows[p_window_id];
|
||||
|
||||
switch (p_window_mode) {
|
||||
case DisplayServer::WINDOW_MODE_WINDOWED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_WINDOWED: {
|
||||
// Looks like it's guaranteed.
|
||||
return true;
|
||||
};
|
||||
|
||||
case DisplayServer::WINDOW_MODE_MINIMIZED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_MINIMIZED: {
|
||||
#ifdef LIBDECOR_ENABLED
|
||||
if (ws.libdecor_frame) {
|
||||
return libdecor_frame_has_capability(ws.libdecor_frame, LIBDECOR_ACTION_MINIMIZE);
|
||||
|
|
@ -4322,7 +4323,7 @@ bool WaylandThread::window_can_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
return ws.can_minimize;
|
||||
};
|
||||
|
||||
case DisplayServer::WINDOW_MODE_MAXIMIZED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_MAXIMIZED: {
|
||||
if (ws.libdecor_frame) {
|
||||
// NOTE: libdecor doesn't seem to have a maximize capability query?
|
||||
// The fact that there's a fullscreen one makes me suspicious. Anyways,
|
||||
|
|
@ -4332,8 +4333,8 @@ bool WaylandThread::window_can_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
return ws.can_maximize;
|
||||
};
|
||||
|
||||
case DisplayServer::WINDOW_MODE_FULLSCREEN:
|
||||
case DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
|
||||
case DisplayServerEnums::WINDOW_MODE_FULLSCREEN:
|
||||
case DisplayServerEnums::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
|
||||
#ifdef LIBDECOR_ENABLED
|
||||
if (ws.libdecor_frame) {
|
||||
return libdecor_frame_has_capability(ws.libdecor_frame, LIBDECOR_ACTION_FULLSCREEN);
|
||||
|
|
@ -4347,7 +4348,7 @@ bool WaylandThread::window_can_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
return false;
|
||||
}
|
||||
|
||||
void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, DisplayServer::WindowMode p_window_mode) {
|
||||
void WaylandThread::window_try_set_mode(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowMode p_window_mode) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4367,18 +4368,18 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
|
||||
// Return back to a windowed state so that we can apply what the user asked.
|
||||
switch (ws.mode) {
|
||||
case DisplayServer::WINDOW_MODE_WINDOWED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_WINDOWED: {
|
||||
// Do nothing.
|
||||
} break;
|
||||
|
||||
case DisplayServer::WINDOW_MODE_MINIMIZED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_MINIMIZED: {
|
||||
// We can't do much according to the xdg_shell protocol. I have no idea
|
||||
// whether this implies that we should return or who knows what. For now
|
||||
// we'll do nothing.
|
||||
// TODO: Test this properly.
|
||||
} break;
|
||||
|
||||
case DisplayServer::WINDOW_MODE_MAXIMIZED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_MAXIMIZED: {
|
||||
// Try to unmaximize. This isn't garaunteed to work actually, so we'll have
|
||||
// to check whether something changed.
|
||||
if (ws.xdg_toplevel) {
|
||||
|
|
@ -4392,8 +4393,8 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
#endif // LIBDECOR_ENABLED
|
||||
} break;
|
||||
|
||||
case DisplayServer::WINDOW_MODE_FULLSCREEN:
|
||||
case DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
|
||||
case DisplayServerEnums::WINDOW_MODE_FULLSCREEN:
|
||||
case DisplayServerEnums::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
|
||||
// Same thing as above, unset fullscreen and check later if it worked.
|
||||
if (ws.xdg_toplevel) {
|
||||
xdg_toplevel_unset_fullscreen(ws.xdg_toplevel);
|
||||
|
|
@ -4410,7 +4411,7 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
// Wait for a configure event and hope that something changed.
|
||||
wl_display_roundtrip(wl_display);
|
||||
|
||||
if (ws.mode != DisplayServer::WINDOW_MODE_WINDOWED) {
|
||||
if (ws.mode != DisplayServerEnums::WINDOW_MODE_WINDOWED) {
|
||||
// The compositor refused our "normalization" request. It'd be useless or
|
||||
// unpredictable to attempt setting a new state. We're done.
|
||||
return;
|
||||
|
|
@ -4418,11 +4419,11 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
|
||||
// Ask the compositor to set the state indicated by the new mode.
|
||||
switch (p_window_mode) {
|
||||
case DisplayServer::WINDOW_MODE_WINDOWED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_WINDOWED: {
|
||||
// Do nothing. We're already windowed.
|
||||
} break;
|
||||
|
||||
case DisplayServer::WINDOW_MODE_MINIMIZED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_MINIMIZED: {
|
||||
if (!window_can_set_mode(p_window_id, p_window_mode)) {
|
||||
// Minimization is special (read below). Better not mess with it if the
|
||||
// compositor explicitly announces that it doesn't support it.
|
||||
|
|
@ -4441,10 +4442,10 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
// We have no way to actually detect this state, so we'll have to report it
|
||||
// manually to the engine (hoping that it worked). In the worst case it'll
|
||||
// get reset by the next configure event.
|
||||
ws.mode = DisplayServer::WINDOW_MODE_MINIMIZED;
|
||||
ws.mode = DisplayServerEnums::WINDOW_MODE_MINIMIZED;
|
||||
} break;
|
||||
|
||||
case DisplayServer::WINDOW_MODE_MAXIMIZED: {
|
||||
case DisplayServerEnums::WINDOW_MODE_MAXIMIZED: {
|
||||
if (ws.xdg_toplevel) {
|
||||
xdg_toplevel_set_maximized(ws.xdg_toplevel);
|
||||
}
|
||||
|
|
@ -4456,8 +4457,8 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
#endif // LIBDECOR_ENABLED
|
||||
} break;
|
||||
|
||||
case DisplayServer::WINDOW_MODE_FULLSCREEN:
|
||||
case DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
|
||||
case DisplayServerEnums::WINDOW_MODE_FULLSCREEN:
|
||||
case DisplayServerEnums::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
|
||||
if (ws.xdg_toplevel) {
|
||||
xdg_toplevel_set_fullscreen(ws.xdg_toplevel, nullptr);
|
||||
}
|
||||
|
|
@ -4474,7 +4475,7 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_borderless(DisplayServer::WindowID p_window_id, bool p_borderless) {
|
||||
void WaylandThread::window_set_borderless(DisplayServerEnums::WindowID p_window_id, bool p_borderless) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4504,7 +4505,7 @@ void WaylandThread::window_set_borderless(DisplayServer::WindowID p_window_id, b
|
|||
#endif // LIBDECOR_ENABLED
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_title(DisplayServer::WindowID p_window_id, const String &p_title) {
|
||||
void WaylandThread::window_set_title(DisplayServerEnums::WindowID p_window_id, const String &p_title) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4519,7 +4520,7 @@ void WaylandThread::window_set_title(DisplayServer::WindowID p_window_id, const
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_app_id(DisplayServer::WindowID p_window_id, const String &p_app_id) {
|
||||
void WaylandThread::window_set_app_id(DisplayServerEnums::WindowID p_window_id, const String &p_app_id) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4596,7 +4597,7 @@ void WaylandThread::set_icon(const Ref<Image> &p_icon) {
|
|||
xdg_toplevel_icon_v1_set_name(xdg_icon, "godot");
|
||||
}
|
||||
|
||||
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : windows) {
|
||||
for (KeyValue<DisplayServerEnums::WindowID, WindowState> &pair : windows) {
|
||||
WindowState &ws = pair.value;
|
||||
#ifdef LIBDECOR_ENABLED
|
||||
if (ws.libdecor_frame) {
|
||||
|
|
@ -4611,14 +4612,14 @@ void WaylandThread::set_icon(const Ref<Image> &p_icon) {
|
|||
}
|
||||
}
|
||||
|
||||
DisplayServer::WindowMode WaylandThread::window_get_mode(DisplayServer::WindowID p_window_id) const {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), DisplayServer::WINDOW_MODE_WINDOWED);
|
||||
DisplayServerEnums::WindowMode WaylandThread::window_get_mode(DisplayServerEnums::WindowID p_window_id) const {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), DisplayServerEnums::WINDOW_MODE_WINDOWED);
|
||||
const WindowState &ws = windows[p_window_id];
|
||||
|
||||
return ws.mode;
|
||||
}
|
||||
|
||||
void WaylandThread::window_request_attention(DisplayServer::WindowID p_window_id) {
|
||||
void WaylandThread::window_request_attention(DisplayServerEnums::WindowID p_window_id) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4630,7 +4631,7 @@ void WaylandThread::window_request_attention(DisplayServer::WindowID p_window_id
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_idle_inhibition(DisplayServer::WindowID p_window_id, bool p_enable) {
|
||||
void WaylandThread::window_set_idle_inhibition(DisplayServerEnums::WindowID p_window_id, bool p_enable) {
|
||||
ERR_FAIL_COND(!windows.has(p_window_id));
|
||||
WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4647,7 +4648,7 @@ void WaylandThread::window_set_idle_inhibition(DisplayServer::WindowID p_window_
|
|||
}
|
||||
}
|
||||
|
||||
bool WaylandThread::window_get_idle_inhibition(DisplayServer::WindowID p_window_id) const {
|
||||
bool WaylandThread::window_get_idle_inhibition(DisplayServerEnums::WindowID p_window_id) const {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), false);
|
||||
const WindowState &ws = windows[p_window_id];
|
||||
|
||||
|
|
@ -4664,7 +4665,7 @@ int WaylandThread::get_screen_count() const {
|
|||
return registry.wl_outputs.size();
|
||||
}
|
||||
|
||||
DisplayServer::WindowID WaylandThread::pointer_get_pointed_window_id() const {
|
||||
DisplayServerEnums::WindowID WaylandThread::pointer_get_pointed_window_id() const {
|
||||
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
|
||||
|
||||
if (ss) {
|
||||
|
|
@ -4698,9 +4699,9 @@ DisplayServer::WindowID WaylandThread::pointer_get_pointed_window_id() const {
|
|||
return ss->pointer_data.pointed_id;
|
||||
}
|
||||
|
||||
return DisplayServer::INVALID_WINDOW_ID;
|
||||
return DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
}
|
||||
DisplayServer::WindowID WaylandThread::pointer_get_last_pointed_window_id() const {
|
||||
DisplayServerEnums::WindowID WaylandThread::pointer_get_last_pointed_window_id() const {
|
||||
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
|
||||
|
||||
if (ss) {
|
||||
|
|
@ -4734,7 +4735,7 @@ DisplayServer::WindowID WaylandThread::pointer_get_last_pointed_window_id() cons
|
|||
return ss->pointer_data.last_pointed_id;
|
||||
}
|
||||
|
||||
return DisplayServer::INVALID_WINDOW_ID;
|
||||
return DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
}
|
||||
|
||||
void WaylandThread::pointer_set_constraint(PointerConstraint p_constraint) {
|
||||
|
|
@ -4984,7 +4985,7 @@ Error WaylandThread::init() {
|
|||
}
|
||||
|
||||
// Update the cursor.
|
||||
cursor_set_shape(DisplayServer::CURSOR_ARROW);
|
||||
cursor_set_shape(DisplayServerEnums::CURSOR_ARROW);
|
||||
|
||||
events_thread.start(_poll_events_thread, &thread_data);
|
||||
|
||||
|
|
@ -5003,7 +5004,7 @@ void WaylandThread::cursor_set_visible(bool p_visible) {
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::cursor_set_shape(DisplayServer::CursorShape p_cursor_shape) {
|
||||
void WaylandThread::cursor_set_shape(DisplayServerEnums::CursorShape p_cursor_shape) {
|
||||
cursor_shape = p_cursor_shape;
|
||||
|
||||
for (struct wl_seat *wl_seat : registry.wl_seats) {
|
||||
|
|
@ -5014,7 +5015,7 @@ void WaylandThread::cursor_set_shape(DisplayServer::CursorShape p_cursor_shape)
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::cursor_shape_set_custom_image(DisplayServer::CursorShape p_cursor_shape, Ref<Image> p_image, const Point2i &p_hotspot) {
|
||||
void WaylandThread::cursor_shape_set_custom_image(DisplayServerEnums::CursorShape p_cursor_shape, Ref<Image> p_image, const Point2i &p_hotspot) {
|
||||
ERR_FAIL_COND(p_image.is_null());
|
||||
|
||||
Size2i image_size = p_image->get_size();
|
||||
|
|
@ -5068,7 +5069,7 @@ void WaylandThread::cursor_shape_set_custom_image(DisplayServer::CursorShape p_c
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::cursor_shape_clear_custom_image(DisplayServer::CursorShape p_cursor_shape) {
|
||||
void WaylandThread::cursor_shape_clear_custom_image(DisplayServerEnums::CursorShape p_cursor_shape) {
|
||||
if (custom_cursors.has(p_cursor_shape)) {
|
||||
CustomCursor cursor = custom_cursors[p_cursor_shape];
|
||||
custom_cursors.erase(p_cursor_shape);
|
||||
|
|
@ -5083,7 +5084,7 @@ void WaylandThread::cursor_shape_clear_custom_image(DisplayServer::CursorShape p
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_ime_active(const bool p_active, DisplayServer::WindowID p_window_id) {
|
||||
void WaylandThread::window_set_ime_active(const bool p_active, DisplayServerEnums::WindowID p_window_id) {
|
||||
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
|
||||
|
||||
if (ss && ss->wp_text_input && ss->ime_enabled) {
|
||||
|
|
@ -5102,7 +5103,7 @@ void WaylandThread::window_set_ime_active(const bool p_active, DisplayServer::Wi
|
|||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_ime_position(const Point2i &p_pos, DisplayServer::WindowID p_window_id) {
|
||||
void WaylandThread::window_set_ime_position(const Point2i &p_pos, DisplayServerEnums::WindowID p_window_id) {
|
||||
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
|
||||
|
||||
if (ss && ss->wp_text_input && ss->ime_enabled) {
|
||||
|
|
@ -5350,7 +5351,7 @@ void WaylandThread::primary_set_text(const String &p_text) {
|
|||
}
|
||||
|
||||
void WaylandThread::commit_surfaces() {
|
||||
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : windows) {
|
||||
for (KeyValue<DisplayServerEnums::WindowID, WindowState> &pair : windows) {
|
||||
wl_surface_commit(pair.value.wl_surface);
|
||||
}
|
||||
}
|
||||
|
|
@ -5468,12 +5469,12 @@ bool WaylandThread::wait_frame_suspend_ms(int p_timeout) {
|
|||
return false;
|
||||
}
|
||||
|
||||
uint64_t WaylandThread::window_get_last_frame_time(DisplayServer::WindowID p_window_id) const {
|
||||
uint64_t WaylandThread::window_get_last_frame_time(DisplayServerEnums::WindowID p_window_id) const {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), false);
|
||||
return windows[p_window_id].last_frame_time;
|
||||
}
|
||||
|
||||
bool WaylandThread::window_is_suspended(DisplayServer::WindowID p_window_id) const {
|
||||
bool WaylandThread::window_is_suspended(DisplayServerEnums::WindowID p_window_id) const {
|
||||
ERR_FAIL_COND_V(!windows.has(p_window_id), false);
|
||||
return windows[p_window_id].suspended;
|
||||
}
|
||||
|
|
@ -5483,7 +5484,7 @@ bool WaylandThread::is_fifo_available() const {
|
|||
}
|
||||
|
||||
bool WaylandThread::is_suspended() const {
|
||||
for (const KeyValue<DisplayServer::WindowID, WindowState> &E : windows) {
|
||||
for (const KeyValue<DisplayServerEnums::WindowID, WindowState> &E : windows) {
|
||||
if (!E.value.suspended) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -5518,7 +5519,7 @@ void WaylandThread::destroy() {
|
|||
events_thread.wait_to_finish();
|
||||
}
|
||||
|
||||
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : windows) {
|
||||
for (KeyValue<DisplayServerEnums::WindowID, WindowState> &pair : windows) {
|
||||
WindowState &ws = pair.value;
|
||||
if (ws.wp_fractional_scale) {
|
||||
wp_fractional_scale_v1_destroy(ws.wp_fractional_scale);
|
||||
|
|
|
|||
|
|
@ -88,11 +88,14 @@
|
|||
#endif // LIBDECOR_ENABLED
|
||||
|
||||
#include "core/input/input_event.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/os/thread.h"
|
||||
#include "servers/display/display_server.h"
|
||||
#include "servers/display/display_server_enums.h"
|
||||
|
||||
#include "wayland_embedder.h"
|
||||
|
||||
class Image;
|
||||
|
||||
class WaylandThread {
|
||||
public:
|
||||
// Messages used for exchanging information between Godot's and Wayland's thread.
|
||||
|
|
@ -108,7 +111,7 @@ public:
|
|||
GDSOFTCLASS(WindowMessage, Message);
|
||||
|
||||
public:
|
||||
DisplayServer::WindowID id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
};
|
||||
|
||||
// Message data for window rect changes.
|
||||
|
|
@ -125,7 +128,7 @@ public:
|
|||
GDSOFTCLASS(WindowEventMessage, WindowMessage);
|
||||
|
||||
public:
|
||||
DisplayServer::WindowEvent event;
|
||||
DisplayServerEnums::WindowEvent event;
|
||||
};
|
||||
|
||||
class InputEventMessage : public Message {
|
||||
|
|
@ -247,11 +250,11 @@ public:
|
|||
// TODO: Make private?
|
||||
|
||||
struct WindowState {
|
||||
DisplayServer::WindowID id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServer::WindowID parent_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID parent_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
Rect2i rect;
|
||||
DisplayServer::WindowMode mode = DisplayServer::WINDOW_MODE_WINDOWED;
|
||||
DisplayServerEnums::WindowMode mode = DisplayServerEnums::WINDOW_MODE_WINDOWED;
|
||||
|
||||
// Toplevel states.
|
||||
bool maximized = false; // MUST obey configure size.
|
||||
|
|
@ -384,8 +387,8 @@ public:
|
|||
MouseButton last_button_pressed = MouseButton::NONE;
|
||||
Point2 last_pressed_position;
|
||||
|
||||
DisplayServer::WindowID pointed_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServer::WindowID last_pointed_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID pointed_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID last_pointed_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
// This is needed to check for a new double click every time.
|
||||
bool double_click_begun = false;
|
||||
|
|
@ -419,8 +422,8 @@ public:
|
|||
uint64_t button_time = 0;
|
||||
uint64_t motion_time = 0;
|
||||
|
||||
DisplayServer::WindowID proximal_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServer::WindowID last_proximal_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID proximal_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID last_proximal_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
uint32_t proximity_serial = 0;
|
||||
};
|
||||
|
||||
|
|
@ -483,7 +486,7 @@ public:
|
|||
struct wl_keyboard *wl_keyboard = nullptr;
|
||||
|
||||
// For key events.
|
||||
DisplayServer::WindowID focused_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID focused_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
|
||||
struct xkb_context *xkb_context = nullptr;
|
||||
struct xkb_keymap *xkb_keymap = nullptr;
|
||||
|
|
@ -522,7 +525,7 @@ public:
|
|||
struct wl_data_device *wl_data_device = nullptr;
|
||||
|
||||
// Drag and drop.
|
||||
DisplayServer::WindowID dnd_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID dnd_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
struct wl_data_offer *wl_data_offer_dnd = nullptr;
|
||||
uint32_t dnd_enter_serial = 0;
|
||||
|
||||
|
|
@ -547,7 +550,7 @@ public:
|
|||
|
||||
// IME.
|
||||
struct zwp_text_input_v3 *wp_text_input = nullptr;
|
||||
DisplayServer::WindowID ime_window_id = DisplayServer::INVALID_WINDOW_ID;
|
||||
DisplayServerEnums::WindowID ime_window_id = DisplayServerEnums::INVALID_WINDOW_ID;
|
||||
bool ime_enabled = false;
|
||||
bool ime_active = false;
|
||||
String ime_text;
|
||||
|
|
@ -594,7 +597,7 @@ private:
|
|||
Thread events_thread;
|
||||
ThreadData thread_data;
|
||||
|
||||
HashMap<DisplayServer::WindowID, WindowState> windows;
|
||||
HashMap<DisplayServerEnums::WindowID, WindowState> windows;
|
||||
|
||||
List<Ref<Message>> messages;
|
||||
|
||||
|
|
@ -612,34 +615,34 @@ private:
|
|||
int cursor_scale = 1;
|
||||
|
||||
// Use cursor-shape-v1 protocol if the compositor supports it.
|
||||
wp_cursor_shape_device_v1_shape standard_cursors[DisplayServer::CURSOR_MAX] = {
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT, //CURSOR_ARROW
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT, //CURSOR_IBEAM
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER, //CURSOR_POINTING_HAND
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR, //CURSOR_CROSS
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT, //CURSOR_WAIT
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS, //CURSOR_BUSY
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB, //CURSOR_DRAG
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING, //CURSOR_CAN_DROP
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP, //CURSOR_FORBIDDEN
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE, //CURSOR_VSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE, //CURSOR_HSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE, //CURSOR_BDIAGSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE, //CURSOR_FDIAGSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_MOVE, //CURSOR_MOVE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE, //CURSOR_VSPLIT
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE, //CURSOR_HSPLIT
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP, //CURSOR_HELP
|
||||
wp_cursor_shape_device_v1_shape standard_cursors[DisplayServerEnums::CURSOR_MAX] = {
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT, //DisplayServerEnums::CURSOR_ARROW
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT, //DisplayServerEnums::CURSOR_IBEAM
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER, //DisplayServerEnums::CURSOR_POINTING_HAND
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR, //DisplayServerEnums::CURSOR_CROSS
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT, //DisplayServerEnums::CURSOR_WAIT
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS, //DisplayServerEnums::CURSOR_BUSY
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB, //DisplayServerEnums::CURSOR_DRAG
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING, //DisplayServerEnums::CURSOR_CAN_DROP
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP, //DisplayServerEnums::CURSOR_FORBIDDEN
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE, //DisplayServerEnums::CURSOR_VSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE, //DisplayServerEnums::CURSOR_HSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE, //DisplayServerEnums::CURSOR_BDIAGSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE, //DisplayServerEnums::CURSOR_FDIAGSIZE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_MOVE, //DisplayServerEnums::CURSOR_MOVE
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE, //DisplayServerEnums::CURSOR_VSPLIT
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE, //DisplayServerEnums::CURSOR_HSPLIT
|
||||
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP, //DisplayServerEnums::CURSOR_HELP
|
||||
};
|
||||
|
||||
// Fallback to reading $XCURSOR and system themes if the compositor does not.
|
||||
struct wl_cursor_theme *wl_cursor_theme = nullptr;
|
||||
struct wl_cursor *wl_cursors[DisplayServer::CURSOR_MAX] = {};
|
||||
struct wl_cursor *wl_cursors[DisplayServerEnums::CURSOR_MAX] = {};
|
||||
|
||||
// User-defined cursor overrides. Take precedence over standard and wl cursors.
|
||||
HashMap<DisplayServer::CursorShape, CustomCursor> custom_cursors;
|
||||
HashMap<DisplayServerEnums::CursorShape, CustomCursor> custom_cursors;
|
||||
|
||||
DisplayServer::CursorShape cursor_shape = DisplayServer::CURSOR_ARROW;
|
||||
DisplayServerEnums::CursorShape cursor_shape = DisplayServerEnums::CURSOR_ARROW;
|
||||
bool cursor_visible = true;
|
||||
|
||||
PointerConstraint pointer_constraint = PointerConstraint::NONE;
|
||||
|
|
@ -1111,40 +1114,40 @@ public:
|
|||
|
||||
void set_icon(const Ref<Image> &p_icon);
|
||||
|
||||
void window_create(DisplayServer::WindowID p_window_id, const Size2i &p_size, DisplayServer::WindowID p_parent_id = DisplayServer::INVALID_WINDOW_ID);
|
||||
void window_create_popup(DisplayServer::WindowID p_window_id, DisplayServer::WindowID p_parent_id, Rect2i p_rect);
|
||||
void window_destroy(DisplayServer::WindowID p_window_Id);
|
||||
void window_create(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size, DisplayServerEnums::WindowID p_parent_id = DisplayServerEnums::INVALID_WINDOW_ID);
|
||||
void window_create_popup(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowID p_parent_id, Rect2i p_rect);
|
||||
void window_destroy(DisplayServerEnums::WindowID p_window_Id);
|
||||
|
||||
void window_set_parent(DisplayServer::WindowID p_window_id, DisplayServer::WindowID p_parent_id);
|
||||
void window_set_parent(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowID p_parent_id);
|
||||
|
||||
struct wl_surface *window_get_wl_surface(DisplayServer::WindowID p_window_id) const;
|
||||
WindowState *window_get_state(DisplayServer::WindowID p_window_id);
|
||||
const WindowState *window_get_state(DisplayServer::WindowID p_window_id) const;
|
||||
Size2i window_set_size(DisplayServer::WindowID p_window_id, const Size2i &p_size);
|
||||
struct wl_surface *window_get_wl_surface(DisplayServerEnums::WindowID p_window_id) const;
|
||||
WindowState *window_get_state(DisplayServerEnums::WindowID p_window_id);
|
||||
const WindowState *window_get_state(DisplayServerEnums::WindowID p_window_id) const;
|
||||
Size2i window_set_size(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size);
|
||||
|
||||
void window_start_resize(DisplayServer::WindowResizeEdge p_edge, DisplayServer::WindowID p_window);
|
||||
void window_start_resize(DisplayServerEnums::WindowResizeEdge p_edge, DisplayServerEnums::WindowID p_window);
|
||||
|
||||
void window_set_max_size(DisplayServer::WindowID p_window_id, const Size2i &p_size);
|
||||
void window_set_min_size(DisplayServer::WindowID p_window_id, const Size2i &p_size);
|
||||
void window_set_max_size(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size);
|
||||
void window_set_min_size(DisplayServerEnums::WindowID p_window_id, const Size2i &p_size);
|
||||
|
||||
bool window_can_set_mode(DisplayServer::WindowID p_window_id, DisplayServer::WindowMode p_window_mode) const;
|
||||
void window_try_set_mode(DisplayServer::WindowID p_window_id, DisplayServer::WindowMode p_window_mode);
|
||||
DisplayServer::WindowMode window_get_mode(DisplayServer::WindowID p_window_id) const;
|
||||
bool window_can_set_mode(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowMode p_window_mode) const;
|
||||
void window_try_set_mode(DisplayServerEnums::WindowID p_window_id, DisplayServerEnums::WindowMode p_window_mode);
|
||||
DisplayServerEnums::WindowMode window_get_mode(DisplayServerEnums::WindowID p_window_id) const;
|
||||
|
||||
void window_set_borderless(DisplayServer::WindowID p_window_id, bool p_borderless);
|
||||
void window_set_title(DisplayServer::WindowID p_window_id, const String &p_title);
|
||||
void window_set_app_id(DisplayServer::WindowID p_window_id, const String &p_app_id);
|
||||
void window_set_borderless(DisplayServerEnums::WindowID p_window_id, bool p_borderless);
|
||||
void window_set_title(DisplayServerEnums::WindowID p_window_id, const String &p_title);
|
||||
void window_set_app_id(DisplayServerEnums::WindowID p_window_id, const String &p_app_id);
|
||||
|
||||
bool window_is_focused(DisplayServer::WindowID p_window_id);
|
||||
bool window_is_focused(DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
// Optional - requires xdg_activation_v1
|
||||
void window_request_attention(DisplayServer::WindowID p_window_id);
|
||||
void window_request_attention(DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
void window_start_drag(DisplayServer::WindowID p_window_id);
|
||||
void window_start_drag(DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
// Optional - require idle_inhibit_unstable_v1
|
||||
void window_set_idle_inhibition(DisplayServer::WindowID p_window_id, bool p_enable);
|
||||
bool window_get_idle_inhibition(DisplayServer::WindowID p_window_id) const;
|
||||
void window_set_idle_inhibition(DisplayServerEnums::WindowID p_window_id, bool p_enable);
|
||||
bool window_get_idle_inhibition(DisplayServerEnums::WindowID p_window_id) const;
|
||||
|
||||
ScreenData screen_get_data(int p_screen) const;
|
||||
int get_screen_count() const;
|
||||
|
|
@ -1153,19 +1156,19 @@ public:
|
|||
void pointer_set_hint(const Point2i &p_hint);
|
||||
void pointer_warp(const Point2i &p_to);
|
||||
PointerConstraint pointer_get_constraint() const;
|
||||
DisplayServer::WindowID pointer_get_pointed_window_id() const;
|
||||
DisplayServer::WindowID pointer_get_last_pointed_window_id() const;
|
||||
DisplayServerEnums::WindowID pointer_get_pointed_window_id() const;
|
||||
DisplayServerEnums::WindowID pointer_get_last_pointed_window_id() const;
|
||||
BitField<MouseButtonMask> pointer_get_button_mask() const;
|
||||
|
||||
void cursor_set_visible(bool p_visible);
|
||||
void cursor_set_shape(DisplayServer::CursorShape p_cursor_shape);
|
||||
void cursor_set_shape(DisplayServerEnums::CursorShape p_cursor_shape);
|
||||
|
||||
void cursor_set_custom_shape(DisplayServer::CursorShape p_cursor_shape);
|
||||
void cursor_shape_set_custom_image(DisplayServer::CursorShape p_cursor_shape, Ref<Image> p_image, const Point2i &p_hotspot);
|
||||
void cursor_shape_clear_custom_image(DisplayServer::CursorShape p_cursor_shape);
|
||||
void cursor_set_custom_shape(DisplayServerEnums::CursorShape p_cursor_shape);
|
||||
void cursor_shape_set_custom_image(DisplayServerEnums::CursorShape p_cursor_shape, Ref<Image> p_image, const Point2i &p_hotspot);
|
||||
void cursor_shape_clear_custom_image(DisplayServerEnums::CursorShape p_cursor_shape);
|
||||
|
||||
void window_set_ime_active(const bool p_active, DisplayServer::WindowID p_window_id);
|
||||
void window_set_ime_position(const Point2i &p_pos, DisplayServer::WindowID p_window_id);
|
||||
void window_set_ime_active(const bool p_active, DisplayServerEnums::WindowID p_window_id);
|
||||
void window_set_ime_position(const Point2i &p_pos, DisplayServerEnums::WindowID p_window_id);
|
||||
|
||||
int keyboard_get_layout_count() const;
|
||||
int keyboard_get_current_layout_index() const;
|
||||
|
|
@ -1195,8 +1198,8 @@ public:
|
|||
bool wait_frame_suspend_ms(int p_timeout);
|
||||
bool is_fifo_available() const;
|
||||
|
||||
uint64_t window_get_last_frame_time(DisplayServer::WindowID p_window_id) const;
|
||||
bool window_is_suspended(DisplayServer::WindowID p_window_id) const;
|
||||
uint64_t window_get_last_frame_time(DisplayServerEnums::WindowID p_window_id) const;
|
||||
bool window_is_suspended(DisplayServerEnums::WindowID p_window_id) const;
|
||||
bool is_suspended() const;
|
||||
|
||||
struct godot_embedding_compositor *get_embedding_compositor();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue