From 58980e0b4a351abd6e4df454e0ccae5944af239d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Mon, 12 Sep 2022 14:40:11 +0200 Subject: [PATCH] Make GtkAccessible public Out of tree classes need to be able to implement the GtkAccessible interface, in order to implement custom accessible objects. Fixes: #4240 --- gtk/gtkaccessible.h | 51 ++++++++++++++++++++++++++++++++++++++ gtk/gtkaccessibleprivate.h | 31 ----------------------- gtk/gtkatcontextprivate.h | 12 --------- gtk/gtktypes.h | 1 + 4 files changed, 52 insertions(+), 43 deletions(-) diff --git a/gtk/gtkaccessible.h b/gtk/gtkaccessible.h index 17a31ba4a4..4cbd9c34ee 100644 --- a/gtk/gtkaccessible.h +++ b/gtk/gtkaccessible.h @@ -35,6 +35,57 @@ G_BEGIN_DECLS GDK_AVAILABLE_IN_ALL G_DECLARE_INTERFACE (GtkAccessible, gtk_accessible, GTK, ACCESSIBLE, GObject) +typedef enum { + GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE, + GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED, + GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE +} GtkAccessiblePlatformState; + +typedef enum { + GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE, + GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED, + GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE, +} GtkAccessiblePlatformChange; + +struct _GtkAccessibleInterface +{ + GTypeInterface g_iface; + + GtkATContext * (* get_at_context) (GtkAccessible *self); + + gboolean (* get_platform_state) (GtkAccessible *self, + GtkAccessiblePlatformState state); + + GtkAccessible * (* get_parent) (GtkAccessible *self); + GtkAccessible * (* get_child_at_index) (GtkAccessible *self, guint index); + + gboolean (* get_bounds) (GtkAccessible *self, int *x, int *y, + int *width, int *height); +}; + +GDK_AVAILABLE_IN_ALL +GtkATContext * gtk_accessible_get_at_context (GtkAccessible *self); + +GDK_AVAILABLE_IN_ALL +void gtk_accessible_platform_changed (GtkAccessible *self, + GtkAccessiblePlatformChange change); + +GDK_AVAILABLE_IN_ALL +gboolean gtk_accessible_get_platform_state (GtkAccessible *self, + GtkAccessiblePlatformState state); + +GDK_AVAILABLE_IN_ALL +GtkAccessible * gtk_accessible_get_parent(GtkAccessible *self); + +GDK_AVAILABLE_IN_ALL +GtkAccessible * gtk_accessible_get_child_at_index(GtkAccessible *self, guint index); + +GDK_AVAILABLE_IN_ALL +gboolean gtk_accessible_get_bounds (GtkAccessible *self, int *x, int *y, int *width, int *height); + +GDK_AVAILABLE_IN_ALL +void gtk_accessible_bounds_changed (GtkAccessible *self); + GDK_AVAILABLE_IN_ALL GtkAccessibleRole gtk_accessible_get_accessible_role (GtkAccessible *self); diff --git a/gtk/gtkaccessibleprivate.h b/gtk/gtkaccessibleprivate.h index dda06c67dd..7744d7afe2 100644 --- a/gtk/gtkaccessibleprivate.h +++ b/gtk/gtkaccessibleprivate.h @@ -25,24 +25,6 @@ G_BEGIN_DECLS -struct _GtkAccessibleInterface -{ - GTypeInterface g_iface; - - GtkATContext * (* get_at_context) (GtkAccessible *self); - - gboolean (* get_platform_state) (GtkAccessible *self, - GtkAccessiblePlatformState state); - - GtkAccessible * (* get_parent) (GtkAccessible *self); - GtkAccessible * (* get_child_at_index) (GtkAccessible *self, guint index); - - gboolean (* get_bounds) (GtkAccessible *self, int *x, int *y, - int *width, int *height); -}; - -GtkATContext * gtk_accessible_get_at_context (GtkAccessible *self); - const char * gtk_accessible_role_to_name (GtkAccessibleRole role, const char *domain); @@ -50,19 +32,6 @@ gboolean gtk_accessible_role_is_range_subclass (GtkAccessibleRole role); gboolean gtk_accessible_should_present (GtkAccessible *self); -void gtk_accessible_platform_changed (GtkAccessible *self, - GtkAccessiblePlatformChange change); -gboolean gtk_accessible_get_platform_state (GtkAccessible *self, - GtkAccessiblePlatformState state); - -GtkAccessible * gtk_accessible_get_parent(GtkAccessible *self); - -GtkAccessible * gtk_accessible_get_child_at_index(GtkAccessible *self, guint index); - -gboolean gtk_accessible_get_bounds (GtkAccessible *self, int *x, int *y, int *width, int *height); - -void gtk_accessible_bounds_changed (GtkAccessible *self); - void gtk_accessible_update_children (GtkAccessible *self, GtkAccessible *child, GtkAccessibleChildState state); diff --git a/gtk/gtkatcontextprivate.h b/gtk/gtkatcontextprivate.h index c05c04948f..7808d133d3 100644 --- a/gtk/gtkatcontextprivate.h +++ b/gtk/gtkatcontextprivate.h @@ -80,18 +80,6 @@ typedef enum { GTK_ACCESSIBLE_STATE_CHANGE_SELECTED = 1 << GTK_ACCESSIBLE_STATE_SELECTED } GtkAccessibleStateChange; -typedef enum { - GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE, - GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED, - GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE -} GtkAccessiblePlatformState; - -typedef enum { - GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE, - GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED, - GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE, -} GtkAccessiblePlatformChange; - typedef enum { GTK_ACCESSIBLE_CHILD_STATE_ADDED, GTK_ACCESSIBLE_CHILD_STATE_REMOVED diff --git a/gtk/gtktypes.h b/gtk/gtktypes.h index 71afde94b0..36084c036d 100644 --- a/gtk/gtktypes.h +++ b/gtk/gtktypes.h @@ -34,6 +34,7 @@ G_BEGIN_DECLS typedef struct _GtkAdjustment GtkAdjustment; +typedef struct _GtkATContext GtkATContext; typedef struct _GtkBitset GtkBitset; typedef struct _GtkBuilder GtkBuilder; typedef struct _GtkBuilderScope GtkBuilderScope;