Base accessibility API.

This commit is contained in:
Pāvels Nadtočajevs 2025-03-21 16:42:23 +02:00
parent af2c713971
commit b106dfd4f9
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
124 changed files with 7631 additions and 181 deletions

View file

@ -154,9 +154,15 @@ private:
ContentScaleStretch content_scale_stretch = CONTENT_SCALE_STRETCH_FRACTIONAL;
real_t content_scale_factor = 1.0;
RID accessibility_title_element;
RID accessibility_announcement_element;
String announcement;
void _make_window();
void _clear_window();
void _update_from_window();
void _accessibility_notify_enter(Node *p_node);
void _accessibility_notify_exit(Node *p_node);
bool _try_parent_dialog(Node *p_from_node);
@ -180,6 +186,8 @@ private:
void _make_transient();
void _set_transient_exclusive_child(bool p_clear_invalid = false);
static Window *focused_window;
ThemeOwner *theme_owner = nullptr;
Ref<Theme> theme;
StringName theme_type_variation;
@ -260,6 +268,10 @@ protected:
void _get_property_list(List<PropertyInfo> *p_list) const;
void _validate_property(PropertyInfo &p_property) const;
void _accessibility_action_grab_focus(const Variant &p_data) {
grab_focus();
}
virtual void add_child_notify(Node *p_child) override;
virtual void remove_child_notify(Node *p_child) override;
@ -275,6 +287,9 @@ public:
static void set_root_layout_direction(int p_root_dir);
static Window *get_from_id(DisplayServer::WindowID p_window_id);
RID get_accessibility_element() const override;
virtual RID get_focused_accessibility_element() const override;
void set_title(const String &p_title);
String get_title() const;
String get_translated_title() const;
@ -379,6 +394,7 @@ public:
void child_controls_changed();
Window *get_exclusive_child() const { return exclusive_child; }
HashSet<Window *> get_transient_children() const { return transient_children; }
Window *get_parent_visible_window() const;
Viewport *get_parent_viewport() const;
@ -406,6 +422,8 @@ public:
Rect2i get_usable_parent_rect() const;
void accessibility_announcement(const String &p_announcement);
// Internationalization.
void set_layout_direction(LayoutDirection p_direction);
@ -478,8 +496,6 @@ public:
Ref<Font> get_theme_default_font() const;
int get_theme_default_font_size() const;
//
virtual Transform2D get_final_transform() const override;
virtual Transform2D get_screen_transform_internal(bool p_absolute_position = false) const override;
virtual Transform2D get_popup_base_transform() const override;
@ -488,6 +504,7 @@ public:
Rect2i get_parent_rect() const;
virtual DisplayServer::WindowID get_window_id() const override;
static Window *get_focused_window() { return focused_window; }
virtual Size2 _get_contents_minimum_size() const;