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

@@ -268,12 +268,24 @@ void TextServerExtension::_bind_methods() {
GDVIRTUAL_BIND(_shaped_text_add_string, "shaped", "text", "fonts", "size", "opentype_features", "language", "meta");
GDVIRTUAL_BIND(_shaped_text_add_object, "shaped", "key", "size", "inline_align", "length", "baseline");
GDVIRTUAL_BIND(_shaped_text_resize_object, "shaped", "key", "size", "inline_align", "baseline");
GDVIRTUAL_BIND(_shaped_get_text, "shaped");
GDVIRTUAL_BIND(_shaped_get_span_count, "shaped");
GDVIRTUAL_BIND(_shaped_get_span_meta, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_span_embedded_object, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_span_text, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_span_object, "shaped", "index");
GDVIRTUAL_BIND(_shaped_set_span_update_font, "shaped", "index", "fonts", "size", "opentype_features");
GDVIRTUAL_BIND(_shaped_get_run_count, "shaped");
GDVIRTUAL_BIND(_shaped_get_run_text, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_run_range, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_run_font_rid, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_run_font_size, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_run_language, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_run_direction, "shaped", "index");
GDVIRTUAL_BIND(_shaped_get_run_object, "shaped", "index");
GDVIRTUAL_BIND(_shaped_text_substr, "shaped", "start", "length");
GDVIRTUAL_BIND(_shaped_text_get_parent, "shaped");
@@ -1194,6 +1206,12 @@ bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const V
return ret;
}
String TextServerExtension::shaped_get_text(const RID &p_shaped) const {
String ret;
GDVIRTUAL_CALL(_shaped_get_text, p_shaped, ret);
return ret;
}
int64_t TextServerExtension::shaped_get_span_count(const RID &p_shaped) const {
int64_t ret = 0;
GDVIRTUAL_CALL(_shaped_get_span_count, p_shaped, ret);
@@ -1212,10 +1230,70 @@ Variant TextServerExtension::shaped_get_span_embedded_object(const RID &p_shaped
return ret;
}
String TextServerExtension::shaped_get_span_text(const RID &p_shaped, int64_t p_index) const {
String ret;
GDVIRTUAL_CALL(_shaped_get_span_text, p_shaped, p_index, ret);
return ret;
}
Variant TextServerExtension::shaped_get_span_object(const RID &p_shaped, int64_t p_index) const {
Variant ret = false;
GDVIRTUAL_CALL(_shaped_get_span_object, p_shaped, p_index, ret);
return ret;
}
void TextServerExtension::shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features) {
GDVIRTUAL_CALL(_shaped_set_span_update_font, p_shaped, p_index, p_fonts, p_size, p_opentype_features);
}
int64_t TextServerExtension::shaped_get_run_count(const RID &p_shaped) const {
int64_t ret = 0;
GDVIRTUAL_CALL(_shaped_get_run_count, p_shaped, ret);
return ret;
}
String TextServerExtension::shaped_get_run_text(const RID &p_shaped, int64_t p_index) const {
String ret;
GDVIRTUAL_CALL(_shaped_get_run_text, p_shaped, p_index, ret);
return ret;
}
Vector2i TextServerExtension::shaped_get_run_range(const RID &p_shaped, int64_t p_index) const {
Vector2i ret;
GDVIRTUAL_CALL(_shaped_get_run_range, p_shaped, p_index, ret);
return ret;
}
RID TextServerExtension::shaped_get_run_font_rid(const RID &p_shaped, int64_t p_index) const {
RID ret;
GDVIRTUAL_CALL(_shaped_get_run_font_rid, p_shaped, p_index, ret);
return ret;
}
int TextServerExtension::shaped_get_run_font_size(const RID &p_shaped, int64_t p_index) const {
int ret = 0;
GDVIRTUAL_CALL(_shaped_get_run_font_size, p_shaped, p_index, ret);
return ret;
}
String TextServerExtension::shaped_get_run_language(const RID &p_shaped, int64_t p_index) const {
String ret;
GDVIRTUAL_CALL(_shaped_get_run_language, p_shaped, p_index, ret);
return ret;
}
TextServer::Direction TextServerExtension::shaped_get_run_direction(const RID &p_shaped, int64_t p_index) const {
TextServer::Direction ret = TextServer::DIRECTION_LTR;
GDVIRTUAL_CALL(_shaped_get_run_direction, p_shaped, p_index, ret);
return ret;
}
Variant TextServerExtension::shaped_get_run_object(const RID &p_shaped, int64_t p_index) const {
Variant ret;
GDVIRTUAL_CALL(_shaped_get_run_object, p_shaped, p_index, ret);
return ret;
}
RID TextServerExtension::shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const {
RID ret;
GDVIRTUAL_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret);