Base accessibility API.

This commit is contained in:
Pāvels Nadtočajevs
2025-03-21 16:42:23 +02:00
parent af2c713971
commit b106dfd4f9
124 changed files with 7631 additions and 181 deletions

View File

@ -35,6 +35,7 @@ void TextParagraph::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_direction", "direction"), &TextParagraph::set_direction);
ClassDB::bind_method(D_METHOD("get_direction"), &TextParagraph::get_direction);
ClassDB::bind_method(D_METHOD("get_inferred_direction"), &TextParagraph::get_inferred_direction);
ADD_PROPERTY(PropertyInfo(Variant::INT, "direction", PROPERTY_HINT_ENUM, "Auto,Light-to-right,Right-to-left"), "set_direction", "get_direction");
@ -105,6 +106,8 @@ void TextParagraph::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_line_rid", "line"), &TextParagraph::get_line_rid);
ClassDB::bind_method(D_METHOD("get_dropcap_rid"), &TextParagraph::get_dropcap_rid);
ClassDB::bind_method(D_METHOD("get_range"), &TextParagraph::get_range);
ClassDB::bind_method(D_METHOD("get_line_count"), &TextParagraph::get_line_count);
ClassDB::bind_method(D_METHOD("set_max_lines_visible", "max_lines_visible"), &TextParagraph::set_max_lines_visible);
@ -390,6 +393,13 @@ TextServer::Direction TextParagraph::get_direction() const {
return TS->shaped_text_get_direction(rid);
}
TextServer::Direction TextParagraph::get_inferred_direction() const {
_THREAD_SAFE_METHOD_
const_cast<TextParagraph *>(this)->_shape_lines();
return TS->shaped_text_get_inferred_direction(rid);
}
void TextParagraph::set_custom_punctuation(const String &p_punct) {
_THREAD_SAFE_METHOD_
@ -615,6 +625,12 @@ Size2 TextParagraph::get_size() const {
return size;
}
Vector2i TextParagraph::get_range() const {
_THREAD_SAFE_METHOD_
return TS->shaped_text_get_range(rid);
}
int TextParagraph::get_line_count() const {
_THREAD_SAFE_METHOD_