chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "ui/accessibility/platform/ax_platform_node_auralinux.h"

#include <dlfcn.h>
#include <stdint.h>

#include <algorithm>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/compiler_specific.h"
#include "base/debug/leak_annotations.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_role_properties.h"
#include "ui/accessibility/ax_selection.h"
#include "ui/accessibility/platform/atk_util_auralinux.h"
#include "ui/accessibility/platform/ax_platform.h"
#include "ui/accessibility/platform/ax_platform_atk_hyperlink.h"
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
#include "ui/accessibility/platform/ax_platform_text_boundary.h"
#include "ui/accessibility/platform/child_iterator.h"
#include "ui/gfx/geometry/rect_conversions.h"

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 10, 0)
#define ATK_210
#endif

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 12, 0)
#define ATK_212
#endif

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 16, 0)
#define ATK_216
#endif

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 26, 0)
#define ATK_226
#endif

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 30, 0)
#define ATK_230
#endif

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 32, 0)
#define ATK_232
#endif

#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 34, 0)
#define ATK_234
#endif

namespace ui {

namespace {

// IMPORTANT!
// These values are written to logs.  Do not renumber or delete
// existing items; add new entries to the end of the list.
//
// LINT.IfChange(UmaAtkApi)
enum class UmaAtkApi {};
// LINT.ThenChange(/tools/metrics/histograms/metadata/accessibility/enums.xml:AccessibilityATKAPIEnum)

void RecordAccessibilityAtkApi(UmaAtkApi enum_value) {}

// When accepting input from clients calling the API, an ATK character offset
// of -1 can often represent the length of the string.
static const int kStringLengthOffset =;

// We must forward declare this because it is used by the traditional GObject
// type manipulation macros.
namespace atk_object {
GType GetType();
}  // namespace atk_object

//
// ax_platform_node_auralinux AtkObject definition and implementation.
//
#define AX_PLATFORM_NODE_AURALINUX_TYPE
#define AX_PLATFORM_NODE_AURALINUX(obj)
#define AX_PLATFORM_NODE_AURALINUX_CLASS(klass)
#define IS_AX_PLATFORM_NODE_AURALINUX(obj)
#define IS_AX_PLATFORM_NODE_AURALINUX_CLASS(klass)
#define AX_PLATFORM_NODE_AURALINUX_GET_CLASS(obj)

AXPlatformNodeAuraLinuxObject;
AXPlatformNodeAuraLinuxClass;

struct _AXPlatformNodeAuraLinuxObject {};

struct _AXPlatformNodeAuraLinuxClass {};

// The root-level Application object that's the parent of all top-level windows.
AXPlatformNode* g_root_application =;

// The last AtkObject with keyboard focus. Tracking this is required to emit the
// ATK_STATE_FOCUSED change to false.
AtkObject* g_current_focused =;

// The last object which was selected. Tracking this is required because
// widgets in the browser UI only emit notifications upon becoming selected,
// but clients also expect notifications when items become unselected.
AXPlatformNodeAuraLinux* g_current_selected =;

// The AtkObject with role=ATK_ROLE_FRAME that represents the toplevel desktop
// window with focus. If this window is not one of our windows, this value
// should be null. This is a weak pointer as well, so its value will also be
// null if if the AtkObject is destroyed.
AtkObject* g_active_top_level_frame =;

AtkObject* g_active_views_dialog =;

#if defined(ATK_216)
constexpr AtkRole kStaticRole =;
constexpr AtkRole kSubscriptRole =;
constexpr AtkRole kSuperscriptRole =;
#else
constexpr AtkRole kStaticRole = ATK_ROLE_TEXT;
constexpr AtkRole kSubscriptRole = ATK_ROLE_TEXT;
constexpr AtkRole kSuperscriptRole = ATK_ROLE_TEXT;
#endif

#if defined(ATK_226)
constexpr AtkRole kAtkFootnoteRole =;
#else
constexpr AtkRole kAtkFootnoteRole = ATK_ROLE_LIST_ITEM;
#endif

#if defined(ATK_234)
constexpr AtkRole kAtkRoleContentDeletion =;
constexpr AtkRole kAtkRoleContentInsertion =;
#else
constexpr AtkRole kAtkRoleContentDeletion = ATK_ROLE_SECTION;
constexpr AtkRole kAtkRoleContentInsertion = ATK_ROLE_SECTION;
#endif

GetTypeFunc;
GetColumnHeaderCellsFunc;
GetRowHeaderCellsFunc;
GetRowColumnSpanFunc;

static GetTypeFunc g_atk_table_cell_get_type;
static GetColumnHeaderCellsFunc g_atk_table_cell_get_column_header_cells;
static GetRowHeaderCellsFunc g_atk_table_cell_get_row_header_cells;
static GetRowColumnSpanFunc g_atk_table_cell_get_row_column_span;

// The ATK API often requires pointers to be used as out arguments, while
// allowing for those pointers to be null if the caller is not interested in
// the value. This function is a simpler helper to avoid continually checking
// for null and to help prevent forgetting to check for null.
void SetIntPointerValueIfNotNull(int* pointer, int value) {}

#if defined(ATK_230)
bool SupportsAtkComponentScrollingInterface() {}
#endif

#if defined(ATK_232)
bool SupportsAtkTextScrollingInterface() {}
#endif

AtkObject* FindAtkObjectParentFrame(AtkObject* atk_object) {}

AtkObject* FindAtkObjectToplevelParentDocument(AtkObject* atk_object) {}

bool IsFrameAncestorOfAtkObject(AtkObject* frame, AtkObject* atk_object) {}

// Returns a stack of AtkObjects of activated popup menus. Since each popup
// menu and submenu has its own native window, we want to properly manage the
// activated state for their containing frames.
std::vector<AtkObject*>& GetActiveMenus() {}

std::map<AtkObject*, FindInPageResultInfo>& GetActiveFindInPageResults() {}

// The currently active frame is g_active_top_level_frame, unless there is an
// active menu. If there is an active menu the parent frame of the
// most-recently opened active menu should be the currently active frame.
AtkObject* ComputeActiveTopLevelFrame() {}

const char* GetUniqueAccessibilityGTypeName(
    ImplementedAtkInterfaces interface_mask) {}

void SetWeakGPtrToAtkObject(AtkObject** weak_pointer, AtkObject* new_value) {}

void SetActiveTopLevelFrame(AtkObject* new_top_level_frame) {}

AXCoordinateSystem AtkCoordTypeToAXCoordinateSystem(
    AtkCoordType coordinate_type) {}

const char* BuildDescriptionFromHeaders(AXPlatformNodeDelegate* delegate,
                                        const std::vector<int32_t>& ids) {}

AtkAttributeSet* PrependAtkAttributeToAtkAttributeSet(
    const char* name,
    const char* value,
    AtkAttributeSet* attribute_set) {}

void PrependTextAttributeToSet(const std::string& attribute,
                               const std::string& value,
                               AtkAttributeSet** attributes) {}

void PrependAtkTextAttributeToSet(const AtkTextAttribute attribute,
                                  const std::string& value,
                                  AtkAttributeSet** attributes) {}

std::string ToAtkTextAttributeColor(const std::string color) {}

AtkAttributeSet* ToAtkAttributeSet(const TextAttributeList& attributes) {}

namespace atk_component {

void GetExtents(AtkComponent* atk_component,
                gint* x,
                gint* y,
                gint* width,
                gint* height,
                AtkCoordType coord_type) {}

void GetPosition(AtkComponent* atk_component,
                 gint* x,
                 gint* y,
                 AtkCoordType coord_type) {}

void GetSize(AtkComponent* atk_component, gint* width, gint* height) {}

AtkObject* RefAccesibleAtPoint(AtkComponent* atk_component,
                               gint x,
                               gint y,
                               AtkCoordType coord_type) {}

gboolean GrabFocus(AtkComponent* atk_component) {}

#if defined(ATK_230)
gboolean ScrollTo(AtkComponent* atk_component, AtkScrollType scroll_type) {}

gboolean ScrollToPoint(AtkComponent* atk_component,
                       AtkCoordType atk_coord_type,
                       gint x,
                       gint y) {}
#endif

void Init(AtkComponentIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_component

namespace atk_action {

gboolean DoAction(AtkAction* atk_action, gint index) {}

gint GetNActions(AtkAction* atk_action) {}

const gchar* GetDescription(AtkAction*, gint) {}

const gchar* GetName(AtkAction* atk_action, gint index) {}

const gchar* GetKeybinding(AtkAction* atk_action, gint index) {}

void Init(AtkActionIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_action

namespace atk_document {

const gchar* GetDocumentAttributeValue(AtkDocument* atk_doc,
                                       const gchar* attribute) {}

AtkAttributeSet* GetDocumentAttributes(AtkDocument* atk_doc) {}

void Init(AtkDocumentIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_document

namespace atk_image {

void GetImagePosition(AtkImage* atk_img,
                      gint* x,
                      gint* y,
                      AtkCoordType coord_type) {}

const gchar* GetImageDescription(AtkImage* atk_img) {}

void GetImageSize(AtkImage* atk_img, gint* width, gint* height) {}

void Init(AtkImageIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_image

namespace atk_value {

void GetCurrentValue(AtkValue* atk_value, GValue* value) {}

void GetMinimumValue(AtkValue* atk_value, GValue* value) {}

void GetMaximumValue(AtkValue* atk_value, GValue* value) {}

void GetMinimumIncrement(AtkValue* atk_value, GValue* value) {}

gboolean SetCurrentValue(AtkValue* atk_value, const GValue* value) {}

void Init(AtkValueIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_value

namespace atk_hyperlink {

AtkHyperlink* GetHyperlink(AtkHyperlinkImpl* atk_hyperlink_impl) {}

void Init(AtkHyperlinkImplIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_hyperlink

namespace atk_hypertext {

AtkHyperlink* GetLink(AtkHypertext* hypertext, int index) {}

int GetNLinks(AtkHypertext* hypertext) {}

int GetLinkIndex(AtkHypertext* hypertext, int char_index) {}

void Init(AtkHypertextIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_hypertext

namespace atk_text {

gchar* GetText(AtkText* atk_text, gint start_offset, gint end_offset) {}

gint GetCharacterCount(AtkText* atk_text) {}

gunichar GetCharacterAtOffset(AtkText* atk_text, int offset) {}

gint GetOffsetAtPoint(AtkText* text, gint x, gint y, AtkCoordType coords) {}

// This function returns a single character as a UTF-8 encoded C string because
// the character may be encoded into more than one byte.
char* GetCharacter(AtkText* atk_text,
                   int offset,
                   int* start_offset,
                   int* end_offset) {}

char* GetTextWithBoundaryType(AtkText* atk_text,
                              int offset,
                              ax::mojom::TextBoundary boundary,
                              int* start_offset_ptr,
                              int* end_offset_ptr) {}

char* GetTextAtOffset(AtkText* atk_text,
                      int offset,
                      AtkTextBoundary atk_boundary,
                      int* start_offset,
                      int* end_offset) {}

char* GetTextAfterOffset(AtkText* atk_text,
                         int offset,
                         AtkTextBoundary boundary,
                         int* start_offset,
                         int* end_offset) {}

char* GetTextBeforeOffset(AtkText* atk_text,
                          int offset,
                          AtkTextBoundary boundary,
                          int* start_offset,
                          int* end_offset) {}

gint GetCaretOffset(AtkText* atk_text) {}

gboolean SetCaretOffset(AtkText* atk_text, gint offset) {}

int GetNSelections(AtkText* atk_text) {}

gchar* GetSelection(AtkText* atk_text,
                    int selection_num,
                    int* start_offset,
                    int* end_offset) {}

gboolean RemoveSelection(AtkText* atk_text, int selection_num) {}

gboolean SetSelection(AtkText* atk_text,
                      int selection_num,
                      int start_offset,
                      int end_offset) {}

gboolean AddSelection(AtkText* atk_text, int start_offset, int end_offset) {}

#if defined(ATK_210)
char* GetStringAtOffset(AtkText* atk_text,
                        int offset,
                        AtkTextGranularity atk_granularity,
                        int* start_offset,
                        int* end_offset) {}
#endif

#if defined(ATK_230)
gfx::Rect GetUnclippedParentHypertextRangeBoundsRect(
    AXPlatformNodeDelegate* ax_platform_node_delegate,
    const int start_offset,
    const int end_offset) {}
#endif

void GetCharacterExtents(AtkText* atk_text,
                         int offset,
                         int* x,
                         int* y,
                         int* width,
                         int* height,
                         AtkCoordType coordinate_type) {}

void GetRangeExtents(AtkText* atk_text,
                     int start_offset,
                     int end_offset,
                     AtkCoordType coordinate_type,
                     AtkTextRectangle* out_rectangle) {}

AtkAttributeSet* GetRunAttributes(AtkText* atk_text,
                                  gint offset,
                                  gint* start_offset,
                                  gint* end_offset) {}

AtkAttributeSet* GetDefaultAttributes(AtkText* atk_text) {}

#if defined(ATK_232)
gboolean ScrollSubstringTo(AtkText* atk_text,
                           gint start_offset,
                           gint end_offset,
                           AtkScrollType scroll_type) {}

gboolean ScrollSubstringToPoint(AtkText* atk_text,
                                gint start_offset,
                                gint end_offset,
                                AtkCoordType atk_coord_type,
                                gint x,
                                gint y) {}
#endif  // ATK_232

void Init(AtkTextIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_text

namespace atk_window {
void Init(AtkWindowIface* iface) {}
const GInterfaceInfo Info =;
}  // namespace atk_window

namespace atk_selection {

gboolean AddSelection(AtkSelection* selection, gint index) {}

gboolean ClearSelection(AtkSelection* selection) {}

AtkObject* RefSelection(AtkSelection* selection, gint requested_child_index) {}

gint GetSelectionCount(AtkSelection* selection) {}

gboolean IsChildSelected(AtkSelection* selection, gint index) {}

gboolean RemoveSelection(AtkSelection* selection,
                         gint index_into_selected_children) {}

gboolean SelectAllSelection(AtkSelection* selection) {}

void Init(AtkSelectionIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_selection

namespace atk_table {

AtkObject* RefAt(AtkTable* table, gint row, gint column) {}

gint GetIndexAt(AtkTable* table, gint row, gint column) {}

gint GetColumnAtIndex(AtkTable* table, gint index) {}

gint GetRowAtIndex(AtkTable* table, gint index) {}

gint GetNColumns(AtkTable* table) {}

gint GetNRows(AtkTable* table) {}

gint GetColumnExtentAt(AtkTable* table, gint row, gint column) {}

gint GetRowExtentAt(AtkTable* table, gint row, gint column) {}

AtkObject* GetColumnHeader(AtkTable* table, gint column) {}

AtkObject* GetRowHeader(AtkTable* table, gint row) {}

AtkObject* GetCaption(AtkTable* table) {}

const gchar* GetColumnDescription(AtkTable* table, gint column) {}

const gchar* GetRowDescription(AtkTable* table, gint row) {}

void Init(AtkTableIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_table

// The ATK table cell interface was added in ATK 2.12.
#if defined(ATK_212)

namespace atk_table_cell {

gint GetColumnSpan(AtkTableCell* cell) {}

GPtrArray* GetColumnHeaderCells(AtkTableCell* cell) {}

gboolean GetCellPosition(AtkTableCell* cell, gint* row, gint* column) {}

gint GetRowSpan(AtkTableCell* cell) {}

GPtrArray* GetRowHeaderCells(AtkTableCell* cell) {}

AtkObject* GetTable(AtkTableCell* cell) {}

AtkTableCellIface;

void Init(AtkTableCellIface* iface) {}

const GInterfaceInfo Info =;

}  // namespace atk_table_cell

#endif  // ATK_212

namespace atk_object {

gpointer kAXPlatformNodeAuraLinuxParentClass =;

const gchar* GetName(AtkObject* atk_object) {}

const gchar* AtkGetName(AtkObject* atk_object) {}

const gchar* GetDescription(AtkObject* atk_object) {}

const gchar* AtkGetDescription(AtkObject* atk_object) {}

gint GetNChildren(AtkObject* atk_object) {}

gint AtkGetNChildren(AtkObject* atk_object) {}

AtkObject* RefChild(AtkObject* atk_object, gint index) {}

AtkObject* AtkRefChild(AtkObject* atk_object, gint index) {}

gint GetIndexInParent(AtkObject* atk_object) {}

gint AtkGetIndexInParent(AtkObject* atk_object) {}

AtkObject* GetParent(AtkObject* atk_object) {}

AtkObject* AtkGetParent(AtkObject* atk_object) {}

AtkRelationSet* RefRelationSet(AtkObject* atk_object) {}

AtkRelationSet* AtkRefRelationSet(AtkObject* atk_object) {}

AtkAttributeSet* GetAttributes(AtkObject* atk_object) {}

AtkAttributeSet* AtkGetAttributes(AtkObject* atk_object) {}

AtkRole GetRole(AtkObject* atk_object) {}

AtkRole AtkGetRole(AtkObject* atk_object) {}

AtkStateSet* RefStateSet(AtkObject* atk_object) {}

AtkStateSet* AtkRefStateSet(AtkObject* atk_object) {}

void Initialize(AtkObject* atk_object, gpointer data) {}

void Finalize(GObject* atk_object) {}

void ClassInit(gpointer class_pointer, gpointer /* class_data */) {}

GType GetType() {}

void Detach(AXPlatformNodeAuraLinuxObject* atk_object) {}

}  //  namespace atk_object

}  // namespace

// static
NO_SANITIZE("cfi-icall")
GType AtkTableCellInterface::GetType() {}

// static
NO_SANITIZE("cfi-icall")
GPtrArray* AtkTableCellInterface::GetColumnHeaderCells(AtkTableCell* cell) {}

// static
NO_SANITIZE("cfi-icall")
GPtrArray* AtkTableCellInterface::GetRowHeaderCells(AtkTableCell* cell) {}

// static
NO_SANITIZE("cfi-icall")
bool AtkTableCellInterface::GetRowColumnSpan(AtkTableCell* cell,
                                             gint* row,
                                             gint* column,
                                             gint* row_span,
                                             gint* col_span) {}

// static
bool AtkTableCellInterface::Exists() {}

void AXPlatformNodeAuraLinux::EnsureGTypeInit() {}

// static
ImplementedAtkInterfaces AXPlatformNodeAuraLinux::GetGTypeInterfaceMask(
    const AXNodeData& data) {}

GType AXPlatformNodeAuraLinux::GetAccessibilityGType() {}

void AXPlatformNodeAuraLinux::SetDocumentParentOnFrameIfNecessary() {}

AtkObject* AXPlatformNodeAuraLinux::FindPrimaryWebContentDocument() {}

bool AXPlatformNodeAuraLinux::IsWebDocumentForRelations() {}

AtkObject* AXPlatformNodeAuraLinux::CreateAtkObject() {}

void AXPlatformNodeAuraLinux::DestroyAtkObjects() {}

// static
AXPlatformNode* AXPlatformNode::Create(AXPlatformNodeDelegate* delegate) {}

// static
AXPlatformNode* AXPlatformNode::FromNativeViewAccessible(
    gfx::NativeViewAccessible accessible) {}

//
// AXPlatformNodeAuraLinux implementation.
//

// static
AXPlatformNodeAuraLinux* AXPlatformNodeAuraLinux::FromAtkObject(
    const AtkObject* atk_object) {}

// static
void AXPlatformNodeAuraLinux::SetApplication(AXPlatformNode* application) {}

// static
AXPlatformNode* AXPlatformNodeAuraLinux::application() {}

// static
void AXPlatformNodeAuraLinux::StaticInitialize() {}

// static
void AXPlatformNodeAuraLinux::EnableAXMode() {}

AtkRole AXPlatformNodeAuraLinux::GetAtkRole() const {}

// If we were compiled with a newer version of ATK than the runtime version,
// it's possible that the state we want to expose and/or emit an event for
// is not present. This will generate a runtime error.
bool PlatformSupportsState(AtkStateType atk_state_type) {}

void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* atk_state_set) {}

// Some relations only exist in a high enough ATK version.
// If a relation has a version requirement, it will be documented in
// the link below.
// https://docs.gtk.org/atk/enum.RelationType.html
struct AtkIntRelation {};

static AtkIntRelation kIntRelations[] =;

struct AtkIntListRelation {};

static AtkIntListRelation kIntListRelations[] =;

void AXPlatformNodeAuraLinux::AddRelationToSet(AtkRelationSet* relation_set,
                                               AtkRelationType relation,
                                               AXPlatformNode* target) {}

AtkRelationSet* AXPlatformNodeAuraLinux::GetAtkRelations() {}

AXPlatformNodeAuraLinux::AXPlatformNodeAuraLinux() = default;

AXPlatformNodeAuraLinux::~AXPlatformNodeAuraLinux() {}

void AXPlatformNodeAuraLinux::Destroy() {}

void AXPlatformNodeAuraLinux::Init(AXPlatformNodeDelegate* delegate) {}

bool AXPlatformNodeAuraLinux::IsPlatformCheckable() const {}

std::optional<size_t> AXPlatformNodeAuraLinux::GetIndexInParent() {}

void AXPlatformNodeAuraLinux::EnsureAtkObjectIsValid() {}

gfx::NativeViewAccessible AXPlatformNodeAuraLinux::GetNativeViewAccessible() {}

gfx::NativeViewAccessible AXPlatformNodeAuraLinux::GetOrCreateAtkObject() {}

void AXPlatformNodeAuraLinux::OnCheckedStateChanged() {}

void AXPlatformNodeAuraLinux::OnEnabledChanged() {}

void AXPlatformNodeAuraLinux::OnBusyStateChanged(bool is_busy) {}

void AXPlatformNodeAuraLinux::OnExpandedStateChanged(bool is_expanded) {}

void AXPlatformNodeAuraLinux::OnShowingStateChanged(bool is_showing) {}

void AXPlatformNodeAuraLinux::OnMenuPopupStart() {}

void AXPlatformNodeAuraLinux::OnMenuPopupEnd() {}

void AXPlatformNodeAuraLinux::ResendFocusSignalsForCurrentlyFocusedNode() {}

void AXPlatformNodeAuraLinux::SetAsCurrentlyFocusedNode() {}

// All menus have closed.
void AXPlatformNodeAuraLinux::OnAllMenusEnded() {}

void AXPlatformNodeAuraLinux::OnWindowActivated() {}

void AXPlatformNodeAuraLinux::OnWindowDeactivated() {}

void AXPlatformNodeAuraLinux::OnWindowVisibilityChanged() {}

void AXPlatformNodeAuraLinux::OnScrolledToAnchor() {}

void AXPlatformNodeAuraLinux::SetActiveViewsDialog() {}

void AXPlatformNodeAuraLinux::OnFocused() {}

void AXPlatformNodeAuraLinux::OnSelected() {}

void AXPlatformNodeAuraLinux::OnSelectedChildrenChanged() {}

bool AXPlatformNodeAuraLinux::EmitsAtkTextEvents() const {}

void AXPlatformNodeAuraLinux::GetFullSelection(int32_t* anchor_node_id,
                                               int* anchor_offset,
                                               int32_t* focus_node_id,
                                               int* focus_offset) {}

AXPlatformNodeAuraLinux& AXPlatformNodeAuraLinux::FindEditableRootOrDocument() {}

AXPlatformNodeAuraLinux* AXPlatformNodeAuraLinux::FindCommonAncestor(
    AXPlatformNodeAuraLinux* other) {}

void AXPlatformNodeAuraLinux::UpdateSelectionInformation(int32_t anchor_node_id,
                                                         int anchor_offset,
                                                         int32_t focus_node_id,
                                                         int focus_offset) {}

void AXPlatformNodeAuraLinux::EmitSelectionChangedSignal(bool had_selection) {}

void AXPlatformNodeAuraLinux::EmitCaretChangedSignal() {}

void AXPlatformNodeAuraLinux::OnTextAttributesChanged() {}

void AXPlatformNodeAuraLinux::OnTextSelectionChanged() {}

bool AXPlatformNodeAuraLinux::SupportsSelectionWithAtkSelection() {}

void AXPlatformNodeAuraLinux::OnDescriptionChanged() {}

void AXPlatformNodeAuraLinux::OnSortDirectionChanged() {}

void AXPlatformNodeAuraLinux::OnValueChanged() {}

void AXPlatformNodeAuraLinux::OnNameChanged() {}

void AXPlatformNodeAuraLinux::OnDocumentTitleChanged() {}

void AXPlatformNodeAuraLinux::OnSubtreeCreated() {}

void AXPlatformNodeAuraLinux::OnSubtreeWillBeDeleted() {}

void AXPlatformNodeAuraLinux::OnParentChanged() {}

void AXPlatformNodeAuraLinux::OnReadonlyChanged() {}

void AXPlatformNodeAuraLinux::OnInvalidStatusChanged() {}

void AXPlatformNodeAuraLinux::OnAriaCurrentChanged() {}

void AXPlatformNodeAuraLinux::OnAlertShown() {}

void AXPlatformNodeAuraLinux::RunPostponedEvents() {}

void AXPlatformNodeAuraLinux::NotifyAccessibilityEvent(
    ax::mojom::Event event_type) {}

std::optional<std::pair<int, int>>
AXPlatformNodeAuraLinux::GetEmbeddedObjectIndicesForId(int id) {}

std::optional<std::pair<int, int>>
AXPlatformNodeAuraLinux::GetEmbeddedObjectIndices() {}

void AXPlatformNodeAuraLinux::UpdateHypertext() {}

const AXLegacyHypertext& AXPlatformNodeAuraLinux::GetAXHypertext() {}

const base::OffsetAdjuster::Adjustments&
AXPlatformNodeAuraLinux::GetHypertextAdjustments() {}

size_t AXPlatformNodeAuraLinux::UTF16ToUnicodeOffsetInText(
    size_t utf16_offset) {}

size_t AXPlatformNodeAuraLinux::UnicodeToUTF16OffsetInText(int unicode_offset) {}

int AXPlatformNodeAuraLinux::GetTextOffsetAtPoint(int x,
                                                  int y,
                                                  AtkCoordType atk_coord_type) {}

gfx::Vector2d AXPlatformNodeAuraLinux::GetParentOriginInScreenCoordinates()
    const {}

gfx::Vector2d AXPlatformNodeAuraLinux::GetParentFrameOriginInScreenCoordinates()
    const {}

gfx::Rect AXPlatformNodeAuraLinux::GetExtentsRelativeToAtkCoordinateType(
    AtkCoordType coord_type) const {}

void AXPlatformNodeAuraLinux::GetExtents(gint* x,
                                         gint* y,
                                         gint* width,
                                         gint* height,
                                         AtkCoordType coord_type) {}

void AXPlatformNodeAuraLinux::GetPosition(gint* x,
                                          gint* y,
                                          AtkCoordType coord_type) {}

void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) {}

gfx::NativeViewAccessible
AXPlatformNodeAuraLinux::HitTestSync(gint x, gint y, AtkCoordType coord_type) {}

bool AXPlatformNodeAuraLinux::GrabFocus() {}

bool AXPlatformNodeAuraLinux::FocusFirstFocusableAncestorInWebContent() {}

bool AXPlatformNodeAuraLinux::SetSequentialFocusNavigationStartingPoint() {}

bool AXPlatformNodeAuraLinux::
    GrabFocusOrSetSequentialFocusNavigationStartingPoint() {}

bool AXPlatformNodeAuraLinux::
    GrabFocusOrSetSequentialFocusNavigationStartingPointAtOffset(int offset) {}

const gchar* AXPlatformNodeAuraLinux::GetDefaultActionName() {}

AtkAttributeSet* AXPlatformNodeAuraLinux::GetAtkAttributes() {}

AtkStateType AXPlatformNodeAuraLinux::GetAtkStateTypeForCheckableNode() {}

// AtkDocumentHelpers

const gchar* AXPlatformNodeAuraLinux::GetDocumentAttributeValue(
    const gchar* attribute) const {}

AtkAttributeSet* AXPlatformNodeAuraLinux::GetDocumentAttributes() const {}

//
// AtkHyperlink helpers
//

AtkHyperlink* AXPlatformNodeAuraLinux::GetAtkHyperlink() {}

//
// Misc helpers
//

void AXPlatformNodeAuraLinux::GetFloatAttributeInGValue(
    ax::mojom::FloatAttribute attr,
    GValue* value) {}

void AXPlatformNodeAuraLinux::AddAttributeToList(const char* name,
                                                 const char* value,
                                                 AtkAttributeSet** attributes) {}

void AXPlatformNodeAuraLinux::SetDocumentParent(
    AtkObject* new_document_parent) {}

bool AXPlatformNodeAuraLinux::IsNameExposed() {}

int AXPlatformNodeAuraLinux::GetCaretOffset() {}

bool AXPlatformNodeAuraLinux::SetCaretOffset(int offset) {}

bool AXPlatformNodeAuraLinux::SetTextSelectionForAtkText(int start_offset,
                                                         int end_offset) {}

bool AXPlatformNodeAuraLinux::HasSelection() {}

void AXPlatformNodeAuraLinux::GetSelectionExtents(int* start_offset,
                                                  int* end_offset) {}

// Since this method doesn't return a static gchar*, we expect the caller of
// atk_text_get_selection to free the return value.
gchar* AXPlatformNodeAuraLinux::GetSelectionWithText(int* start_offset,
                                                     int* end_offset) {}

bool AXPlatformNodeAuraLinux::IsInLiveRegion() {}

#if defined(ATK_230)
void AXPlatformNodeAuraLinux::ScrollToPoint(AtkCoordType atk_coord_type,
                                            int x,
                                            int y) {}

void AXPlatformNodeAuraLinux::ScrollNodeRectIntoView(
    gfx::Rect rect,
    AtkScrollType atk_scroll_type) {}

void AXPlatformNodeAuraLinux::ScrollNodeIntoView(
    AtkScrollType atk_scroll_type) {}
#endif  // defined(ATK_230)

#if defined(ATK_232)
std::optional<gfx::Rect>
AXPlatformNodeAuraLinux::GetUnclippedHypertextRangeBoundsRect(int start_offset,
                                                              int end_offset) {}

bool AXPlatformNodeAuraLinux::ScrollSubstringIntoView(
    AtkScrollType atk_scroll_type,
    int start_offset,
    int end_offset) {}

bool AXPlatformNodeAuraLinux::ScrollSubstringToPoint(
    int start_offset,
    int end_offset,
    AtkCoordType atk_coord_type,
    int x,
    int y) {}
#endif  // defined(ATK_232)

void AXPlatformNodeAuraLinux::ComputeStylesIfNeeded() {}

int AXPlatformNodeAuraLinux::FindStartOfStyle(
    int start_offset,
    ax::mojom::MoveDirection direction) {}

const TextAttributeList& AXPlatformNodeAuraLinux::GetTextAttributes(
    int offset,
    int* start_offset,
    int* end_offset) {}

const TextAttributeList& AXPlatformNodeAuraLinux::GetDefaultTextAttributes() {}

void AXPlatformNodeAuraLinux::TerminateFindInPage() {}

void AXPlatformNodeAuraLinux::ActivateFindInPageResult(int start_offset,
                                                       int end_offset) {}

std::optional<std::pair<int, int>>
AXPlatformNodeAuraLinux::GetHypertextExtentsOfChild(
    AXPlatformNodeAuraLinux* child_to_find) {}

void AXPlatformNodeAuraLinux::ActivateFindInPageInParent(int start_offset,
                                                         int end_offset) {}

void AXPlatformNodeAuraLinux::ForgetCurrentFindInPageResult() {}

std::optional<FindInPageResultInfo>
AXPlatformNodeAuraLinux::GetSelectionOffsetsFromFindInPage() {}

gfx::Point AXPlatformNodeAuraLinux::ConvertPointToScreenCoordinates(
    const gfx::Point& point,
    AtkCoordType atk_coord_type) {}

std::pair<int, int> AXPlatformNodeAuraLinux::GetSelectionOffsetsForAtk() {}

}  // namespace ui