// Copyright (c) 2026 Storm Dragon // Authors: Storm Dragon, Angus Kola // SPDX-License-Identifier: GPL-3.0-or-later #ifndef CTHULHU_ATSPI_NATIVE_H #define CTHULHU_ATSPI_NATIVE_H #include #include typedef struct { const gchar *busName; gchar *applicationName; gchar *name; gchar *role; gchar *description; const gchar *path; gchar *text; gint textStartOffset; gchar *textBeforeCaret; gchar *caretCharacter; gboolean autocomplete; gint headingLevel; gint positionInSet, setSize; gboolean visible; gboolean showing; gboolean statesKnown; gboolean active; gboolean focusable; gboolean focused; gboolean hasPopup; gboolean checked; gboolean defunct; gboolean editable; gboolean expandable; gboolean expanded; gboolean indeterminate; gboolean invalid; gboolean multiselectable; gboolean readOnly; gboolean required; gboolean selected; gboolean sensitive; gboolean sensitiveKnown; gboolean valueKnown; gboolean visited; gboolean explicitName; gdouble currentValue; gdouble maximumValue; gdouble minimumValue; gdouble minimumIncrement; gchar *valueText; gchar *xmlRoles; gchar *htmlTag; gchar *elementID; gboolean supportsClick; gboolean liveRegion; gboolean layoutTable; gint childCount; gboolean childCountKnown; gint tableRowCount; gint tableColumnCount, tableRowIndex, tableColumnIndex, tableRowSpan, tableColumnSpan; gboolean tablePositionKnown; gchar *tableRowHeaders, *tableColumnHeaders; gint characterCount; gint embeddedObjectCount; gint objectX; gint objectY; gint objectWidth; gint objectHeight; gint referenceX; gint referenceY; gint referenceWidth; gint referenceHeight; gboolean objectGeometryKnown; gboolean referenceGeometryKnown; } cthulhu_snapshot; typedef struct { uintptr_t callback; } cthulhu_callback_data; gchar *cthulhu_table_context(AtspiAccessible *source, gint *rows, gint *columns, gchar **tableName, gchar **tablePath, gint *rowIndex, gint *columnIndex, gboolean *guiTable); cthulhu_snapshot cthulhu_capture_snapshot(AtspiAccessible *source, gboolean captureText, gboolean captureCaretCharacter, gboolean captureDocumentMetadata, gboolean captureSoundGeometry, gboolean captureApplicationName); void cthulhu_capture_sound_geometry(AtspiAccessible *source, cthulhu_snapshot *snapshot); gchar *cthulhu_collect_notification_text(AtspiAccessible *source); gchar *cthulhu_collect_simple_prompt_text(AtspiAccessible *source); gchar *cthulhu_radio_group_name(AtspiAccessible *source); void cthulhu_capture_set_position(AtspiAccessible *source, GHashTable *attributes, cthulhu_snapshot *snapshot); gboolean cthulhu_has_set_position(const gchar *role); gchar *cthulhu_live_content(AtspiAccessible *source); gchar *cthulhu_capture_caret_unit(AtspiAccessible *source, AtspiTextGranularity unit); guint start_foreground_timer(gpointer data); const gchar *cthulhu_event_type(AtspiEvent *event); gint cthulhu_event_detail1(AtspiEvent *event); gchar *cthulhu_document_uri(AtspiAccessible *source); gchar *cthulhu_event_payload(AtspiEvent *event); gchar *cthulhu_live_attribute(AtspiAccessible *source, const gchar *key); AtspiAccessible *cthulhu_event_active_descendant(AtspiEvent *event); AtspiAccessible *cthulhu_selected_child(AtspiAccessible *source); AtspiAccessible *cthulhu_table_selected_child(AtspiAccessible *source); void cthulhu_refresh_frame_children(AtspiAccessible *window); AtspiAccessible *cthulhu_focused_descendant(AtspiAccessible *window); AtspiAccessible *cthulhu_showing_web_document(AtspiAccessible *window); AtspiAccessible *cthulhu_autocomplete_popup_target(AtspiAccessible *source); AtspiAccessible *cthulhu_combo_ancestor(AtspiAccessible *source); gboolean cthulhu_active_document(AtspiAccessible *source); gboolean cthulhu_in_active_document(AtspiAccessible *source); gboolean cthulhu_in_inactive_window(AtspiAccessible *source); gboolean cthulhu_active_menu_window(AtspiAccessible *window); AtspiAccessible *cthulhu_popup_menu_target(AtspiAccessible *window); const gchar *cthulhu_accessible_path(AtspiAccessible *source); const gchar *cthulhu_accessible_bus_name(AtspiAccessible *source); AtspiAccessible *cthulhu_window_ancestor(AtspiAccessible *source); AtspiAccessible *cthulhu_document_ancestor(AtspiAccessible *source); AtspiEventListenerCB cthulhu_event_callback_pointer(void); gboolean cthulhu_request_event_loop_quit(void); gboolean cthulhu_request_tree_capture(gpointer userData); cthulhu_callback_data *cthulhu_callback_data_new(uintptr_t callback); uintptr_t cthulhu_callback_value(const cthulhu_callback_data *data); void cthulhu_callback_data_free(cthulhu_callback_data *data); #endif