1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Update access-kit to 0.18.0

This commit is contained in:
Pāvels Nadtočajevs
2025-12-13 17:25:16 +02:00
parent 08e6cd181f
commit f7a10145ae
12 changed files with 2505 additions and 69 deletions

View File

@@ -573,6 +573,8 @@ enum accesskit_vertical_offset
typedef uint8_t accesskit_vertical_offset;
#endif // __cplusplus
typedef struct accesskit_custom_action accesskit_custom_action;
#if defined(__APPLE__)
typedef struct accesskit_macos_adapter accesskit_macos_adapter;
#endif
@@ -868,20 +870,9 @@ typedef struct accesskit_opt_text_selection {
struct accesskit_text_selection value;
} accesskit_opt_text_selection;
/**
* Use `accesskit_custom_action_new` to create this struct. Do not reallocate
* `description`.
*
* When you get this struct, you are responsible for freeing `description`.
*/
typedef struct accesskit_custom_action {
int32_t id;
char *description;
} accesskit_custom_action;
typedef struct accesskit_custom_actions {
size_t length;
struct accesskit_custom_action *values;
struct accesskit_custom_action **values;
} accesskit_custom_actions;
/**
@@ -1368,6 +1359,12 @@ char *accesskit_node_label(const struct accesskit_node *node);
*/
void accesskit_node_set_label(struct accesskit_node *node, const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_label_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_label(struct accesskit_node *node);
/**
@@ -1381,6 +1378,13 @@ char *accesskit_node_description(const struct accesskit_node *node);
void accesskit_node_set_description(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_description_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_description(struct accesskit_node *node);
/**
@@ -1393,6 +1397,12 @@ char *accesskit_node_value(const struct accesskit_node *node);
*/
void accesskit_node_set_value(struct accesskit_node *node, const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_value_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_value(struct accesskit_node *node);
/**
@@ -1406,6 +1416,13 @@ char *accesskit_node_access_key(const struct accesskit_node *node);
void accesskit_node_set_access_key(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_access_key_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_access_key(struct accesskit_node *node);
/**
@@ -1419,6 +1436,12 @@ char *accesskit_node_author_id(const struct accesskit_node *node);
void accesskit_node_set_author_id(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_author_id_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_author_id(struct accesskit_node *node);
/**
@@ -1432,6 +1455,13 @@ char *accesskit_node_class_name(const struct accesskit_node *node);
void accesskit_node_set_class_name(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_class_name_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_class_name(struct accesskit_node *node);
/**
@@ -1445,6 +1475,13 @@ char *accesskit_node_font_family(const struct accesskit_node *node);
void accesskit_node_set_font_family(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_font_family_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_font_family(struct accesskit_node *node);
/**
@@ -1458,6 +1495,12 @@ char *accesskit_node_html_tag(const struct accesskit_node *node);
void accesskit_node_set_html_tag(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_html_tag_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_html_tag(struct accesskit_node *node);
/**
@@ -1471,6 +1514,13 @@ char *accesskit_node_inner_html(const struct accesskit_node *node);
void accesskit_node_set_inner_html(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_inner_html_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_inner_html(struct accesskit_node *node);
/**
@@ -1484,6 +1534,12 @@ char *accesskit_node_keyboard_shortcut(const struct accesskit_node *node);
void accesskit_node_set_keyboard_shortcut(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_keyboard_shortcut_with_length(
struct accesskit_node *node, const char *value, size_t length);
void accesskit_node_clear_keyboard_shortcut(struct accesskit_node *node);
/**
@@ -1497,6 +1553,12 @@ char *accesskit_node_language(const struct accesskit_node *node);
void accesskit_node_set_language(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_language_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_language(struct accesskit_node *node);
/**
@@ -1510,6 +1572,13 @@ char *accesskit_node_placeholder(const struct accesskit_node *node);
void accesskit_node_set_placeholder(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_placeholder_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_placeholder(struct accesskit_node *node);
/**
@@ -1523,6 +1592,12 @@ char *accesskit_node_role_description(const struct accesskit_node *node);
void accesskit_node_set_role_description(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_role_description_with_length(
struct accesskit_node *node, const char *value, size_t length);
void accesskit_node_clear_role_description(struct accesskit_node *node);
/**
@@ -1536,6 +1611,12 @@ char *accesskit_node_state_description(const struct accesskit_node *node);
void accesskit_node_set_state_description(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_state_description_with_length(
struct accesskit_node *node, const char *value, size_t length);
void accesskit_node_clear_state_description(struct accesskit_node *node);
/**
@@ -1548,6 +1629,12 @@ char *accesskit_node_tooltip(const struct accesskit_node *node);
*/
void accesskit_node_set_tooltip(struct accesskit_node *node, const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_tooltip_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_tooltip(struct accesskit_node *node);
/**
@@ -1560,6 +1647,12 @@ char *accesskit_node_url(const struct accesskit_node *node);
*/
void accesskit_node_set_url(struct accesskit_node *node, const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_url_with_length(struct accesskit_node *node,
const char *value, size_t length);
void accesskit_node_clear_url(struct accesskit_node *node);
/**
@@ -1573,6 +1666,13 @@ char *accesskit_node_row_index_text(const struct accesskit_node *node);
void accesskit_node_set_row_index_text(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_row_index_text_with_length(struct accesskit_node *node,
const char *value,
size_t length);
void accesskit_node_clear_row_index_text(struct accesskit_node *node);
/**
@@ -1586,6 +1686,12 @@ char *accesskit_node_column_index_text(const struct accesskit_node *node);
void accesskit_node_set_column_index_text(struct accesskit_node *node,
const char *value);
/**
* Caller is responsible for freeing the memory pointed by `value`.
*/
void accesskit_node_set_column_index_text_with_length(
struct accesskit_node *node, const char *value, size_t length);
void accesskit_node_clear_column_index_text(struct accesskit_node *node);
struct accesskit_opt_double accesskit_node_scroll_x(
@@ -1973,26 +2079,55 @@ void accesskit_node_set_text_selection(struct accesskit_node *node,
void accesskit_node_clear_text_selection(struct accesskit_node *node);
struct accesskit_custom_action accesskit_custom_action_new(
int32_t id, const char *description);
struct accesskit_custom_action *accesskit_custom_action_new(int32_t id);
void accesskit_custom_action_free(struct accesskit_custom_action *action);
int32_t accesskit_custom_action_id(
const struct accesskit_custom_action *action);
void accesskit_custom_action_set_id(struct accesskit_custom_action *action,
int32_t id);
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_custom_action_description(
const struct accesskit_custom_action *action);
/**
* Caller is responsible for freeing the memory pointed by `description`.
*/
void accesskit_custom_action_set_description(
struct accesskit_custom_action *action, const char *description);
/**
* Caller is responsible for freeing the memory pointed by `description`.
*/
void accesskit_custom_action_set_description_with_length(
struct accesskit_custom_action *action, const char *description,
size_t length);
void accesskit_custom_actions_free(struct accesskit_custom_actions *value);
/**
* Caller is responsible for freeing the returned value.
* Caller must call `accesskit_custom_actions_free` with the return value.
*/
const struct accesskit_custom_actions *accesskit_node_custom_actions(
struct accesskit_custom_actions *accesskit_node_custom_actions(
const struct accesskit_node *node);
/**
* Caller is responsible for freeing `values`.
* Caller is responsible for freeing each `custom_action` in the array.
*/
void accesskit_node_set_custom_actions(
struct accesskit_node *node, size_t length,
const struct accesskit_custom_action *values);
struct accesskit_custom_action *const *values);
/**
* Takes ownership of `action`.
*/
void accesskit_node_push_custom_action(struct accesskit_node *node,
struct accesskit_custom_action item);
struct accesskit_custom_action *action);
void accesskit_node_clear_custom_actions(struct accesskit_node *node);
@@ -2000,6 +2135,11 @@ struct accesskit_node *accesskit_node_new(accesskit_role role);
void accesskit_node_free(struct accesskit_node *node);
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_node_debug(const struct accesskit_node *node);
struct accesskit_tree *accesskit_tree_new(accesskit_node_id root);
void accesskit_tree_free(struct accesskit_tree *tree);
@@ -2009,9 +2149,19 @@ void accesskit_tree_free(struct accesskit_tree *tree);
*/
char *accesskit_tree_get_toolkit_name(const struct accesskit_tree *tree);
/**
* Caller is responsible for freeing the memory pointed by `toolkit_name`
*/
void accesskit_tree_set_toolkit_name(struct accesskit_tree *tree,
const char *toolkit_name);
/**
* Caller is responsible for freeing the memory pointed by `toolkit_name`
*/
void accesskit_tree_set_toolkit_name_with_length(struct accesskit_tree *tree,
const char *toolkit_name,
size_t length);
void accesskit_tree_clear_toolkit_name(struct accesskit_tree *tree);
/**
@@ -2019,11 +2169,26 @@ void accesskit_tree_clear_toolkit_name(struct accesskit_tree *tree);
*/
char *accesskit_tree_get_toolkit_version(const struct accesskit_tree *tree);
/**
* Caller is responsible for freeing the memory pointed by `toolkit_version`
*/
void accesskit_tree_set_toolkit_version(struct accesskit_tree *tree,
const char *toolkit_version);
/**
* Caller is responsible for freeing the memory pointed by `toolkit_version`
*/
void accesskit_tree_set_toolkit_version_with_length(struct accesskit_tree *tree,
const char *toolkit_version,
size_t length);
void accesskit_tree_clear_toolkit_version(struct accesskit_tree *tree);
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_tree_debug(const struct accesskit_tree *tree);
struct accesskit_tree_update *accesskit_tree_update_with_focus(
accesskit_node_id focus);
@@ -2048,6 +2213,12 @@ void accesskit_tree_update_clear_tree(struct accesskit_tree_update *update);
void accesskit_tree_update_set_focus(struct accesskit_tree_update *update,
accesskit_node_id focus);
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_tree_update_debug(
const struct accesskit_tree_update *tree_update);
void accesskit_action_request_free(struct accesskit_action_request *request);
struct accesskit_affine accesskit_affine_identity(void);
@@ -2078,8 +2249,26 @@ bool accesskit_affine_is_finite(const struct accesskit_affine *affine);
bool accesskit_affine_is_nan(const struct accesskit_affine *affine);
struct accesskit_affine accesskit_affine_mul(struct accesskit_affine a,
struct accesskit_affine b);
struct accesskit_point accesskit_affine_transform_point(
struct accesskit_affine affine, struct accesskit_point point);
struct accesskit_vec2 accesskit_point_to_vec2(struct accesskit_point point);
struct accesskit_point accesskit_point_add_vec2(struct accesskit_point point,
struct accesskit_vec2 vec);
struct accesskit_point accesskit_point_sub_vec2(struct accesskit_point point,
struct accesskit_vec2 vec);
struct accesskit_vec2 accesskit_point_sub_point(struct accesskit_point a,
struct accesskit_point b);
struct accesskit_rect accesskit_rect_new(double x0, double y0, double x1,
double y1);
struct accesskit_rect accesskit_rect_from_points(struct accesskit_point p0,
struct accesskit_point p1);
@@ -2126,12 +2315,35 @@ struct accesskit_rect accesskit_rect_union_pt(const struct accesskit_rect *rect,
struct accesskit_rect accesskit_rect_intersect(
const struct accesskit_rect *rect, struct accesskit_rect other);
struct accesskit_rect accesskit_rect_translate(
struct accesskit_rect rect, struct accesskit_vec2 translation);
struct accesskit_vec2 accesskit_size_to_vec2(struct accesskit_size size);
struct accesskit_size accesskit_size_scale(struct accesskit_size size,
double scalar);
struct accesskit_size accesskit_size_add(struct accesskit_size a,
struct accesskit_size b);
struct accesskit_size accesskit_size_sub(struct accesskit_size a,
struct accesskit_size b);
struct accesskit_point accesskit_vec2_to_point(struct accesskit_vec2 vec2);
struct accesskit_size accesskit_vec2_to_size(struct accesskit_vec2 vec2);
struct accesskit_vec2 accesskit_vec2_add(struct accesskit_vec2 a,
struct accesskit_vec2 b);
struct accesskit_vec2 accesskit_vec2_sub(struct accesskit_vec2 a,
struct accesskit_vec2 b);
struct accesskit_vec2 accesskit_vec2_scale(struct accesskit_vec2 vec,
double scalar);
struct accesskit_vec2 accesskit_vec2_neg(struct accesskit_vec2 vec);
#if defined(__APPLE__)
/**
* Memory is also freed when calling this function.
@@ -2212,6 +2424,14 @@ void *accesskit_macos_adapter_hit_test(
void *activation_handler_userdata);
#endif
#if defined(__APPLE__)
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_macos_adapter_debug(
const struct accesskit_macos_adapter *adapter);
#endif
#if defined(__APPLE__)
/**
* # Safety
@@ -2295,6 +2515,28 @@ void accesskit_macos_add_focus_forwarder_to_window_class(
const char *class_name);
#endif
#if defined(__APPLE__)
/**
* Modifies the specified class, which must be a subclass of `NSWindow`,
* to include an `accessibilityFocusedUIElement` method that calls
* the corresponding method on the window's content view. This is needed
* for windowing libraries such as SDL that place the keyboard focus
* directly on the window rather than the content view.
* Caller is responsible for freeing `class_name`.
*
* # Safety
*
* This function is declared unsafe because the caller must ensure that the
* code for this library is never unloaded from the application process,
* since it's not possible to reverse this operation. It's safest
* if this library is statically linked into the application's main executable.
* Also, this function assumes that the specified class is a subclass
* of `NSWindow`.
*/
void accesskit_macos_add_focus_forwarder_to_window_class_with_length(
const char *class_name, size_t length);
#endif
#if (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
defined(__NetBSD__) || defined(__OpenBSD__))
/**
@@ -2347,6 +2589,15 @@ void accesskit_unix_adapter_update_window_focus_state(
struct accesskit_unix_adapter *adapter, bool is_focused);
#endif
#if (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
defined(__NetBSD__) || defined(__OpenBSD__))
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_unix_adapter_debug(
const struct accesskit_unix_adapter *adapter);
#endif
#if defined(_WIN32)
/**
* Memory is also freed when calling this function.
@@ -2397,6 +2648,14 @@ struct accesskit_opt_lresult accesskit_windows_adapter_handle_wm_getobject(
void *activation_handler_userdata);
#endif
#if defined(_WIN32)
/**
* Caller must call `accesskit_string_free` with the return value.
*/
char *accesskit_windows_adapter_debug(
const struct accesskit_windows_adapter *adapter);
#endif
#if defined(_WIN32)
/**
* Creates a new Windows platform adapter using window subclassing.