Commit 3cc22eed authored by Matthias Clasen's avatar Matthias Clasen

Add some GtkAccessible documentation

Describe the current thinking about how to provide
3rd party accessible implementations.
parent 7c2414ec
...@@ -28,13 +28,20 @@ ...@@ -28,13 +28,20 @@
* SECTION:gtkaccessible * SECTION:gtkaccessible
* @Short_description: Accessibility support for widgets * @Short_description: Accessibility support for widgets
* @Title: GtkAccessible * @Title: GtkAccessible
*
* The #GtkAccessible class is the base class for accessible
* implementations for #GtkWidget subclasses. It is a thin
* wrapper around #AtkObject, which adds facilities for associating
* a widget with its accessible object.
*
* An accessible implementation for a third-party widget should
* derive from #GtkAccessible and implement the suitable interfaces
* from ATK, such as #AtkText or #AtkSelection. To establish
* the connection between the widget class and its corresponding
* acccessible implementation, override the get_accessible vfunc
* in #GtkWidgetClass.
*/ */
/*
* GtkAccessiblePriv:
* @widget: The GtkWidget whose properties and features are exported via this
* accessible instance
*/
struct _GtkAccessiblePrivate struct _GtkAccessiblePrivate
{ {
GtkWidget *widget; GtkWidget *widget;
...@@ -68,7 +75,7 @@ gtk_accessible_class_init (GtkAccessibleClass *klass) ...@@ -68,7 +75,7 @@ gtk_accessible_class_init (GtkAccessibleClass *klass)
* Sets the #GtkWidget corresponding to the #GtkAccessible. * Sets the #GtkWidget corresponding to the #GtkAccessible.
* *
* Since: 2.22 * Since: 2.22
**/ */
void void
gtk_accessible_set_widget (GtkAccessible *accessible, gtk_accessible_set_widget (GtkAccessible *accessible,
GtkWidget *widget) GtkWidget *widget)
...@@ -82,14 +89,15 @@ gtk_accessible_set_widget (GtkAccessible *accessible, ...@@ -82,14 +89,15 @@ gtk_accessible_set_widget (GtkAccessible *accessible,
* gtk_accessible_get_widget: * gtk_accessible_get_widget:
* @accessible: a #GtkAccessible * @accessible: a #GtkAccessible
* *
* Gets the #GtkWidget corresponding to the #GtkAccessible. The returned widget * Gets the #GtkWidget corresponding to the #GtkAccessible.
* does not have a reference added, so you do not need to unref it. * The returned widget does not have a reference added, so
* you do not need to unref it.
* *
* Returns: (transfer none): pointer to the #GtkWidget corresponding to * Returns: (transfer none): pointer to the #GtkWidget
* the #GtkAccessible, or %NULL. * corresponding to the #GtkAccessible, or %NULL.
* *
* Since: 2.22 * Since: 2.22
**/ */
GtkWidget* GtkWidget*
gtk_accessible_get_widget (GtkAccessible *accessible) gtk_accessible_get_widget (GtkAccessible *accessible)
{ {
...@@ -99,11 +107,11 @@ gtk_accessible_get_widget (GtkAccessible *accessible) ...@@ -99,11 +107,11 @@ gtk_accessible_get_widget (GtkAccessible *accessible)
} }
/** /**
* gtk_accessible_connect_widget_destroyed * gtk_accessible_connect_widget_destroyed:
* @accessible: a #GtkAccessible * @accessible: a #GtkAccessible
* *
* This function specifies the callback function to be called when the widget * This function specifies the callback function to be called
* corresponding to a GtkAccessible is destroyed. * when the widget corresponding to a GtkAccessible is destroyed.
*/ */
void void
gtk_accessible_connect_widget_destroyed (GtkAccessible *accessible) gtk_accessible_connect_widget_destroyed (GtkAccessible *accessible)
......
...@@ -36,13 +36,10 @@ G_BEGIN_DECLS ...@@ -36,13 +36,10 @@ G_BEGIN_DECLS
#define GTK_IS_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCESSIBLE)) #define GTK_IS_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCESSIBLE))
#define GTK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCESSIBLE, GtkAccessibleClass)) #define GTK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCESSIBLE, GtkAccessibleClass))
typedef struct _GtkAccessible GtkAccessible; typedef struct _GtkAccessible GtkAccessible;
typedef struct _GtkAccessiblePrivate GtkAccessiblePrivate; typedef struct _GtkAccessiblePrivate GtkAccessiblePrivate;
typedef struct _GtkAccessibleClass GtkAccessibleClass; typedef struct _GtkAccessibleClass GtkAccessibleClass;
/*
* This object is a thin wrapper, in the GTK+ namespace, for AtkObject
*/
struct _GtkAccessible struct _GtkAccessible
{ {
AtkObject parent; AtkObject parent;
...@@ -55,8 +52,8 @@ struct _GtkAccessibleClass ...@@ -55,8 +52,8 @@ struct _GtkAccessibleClass
{ {
AtkObjectClass parent_class; AtkObjectClass parent_class;
void (*connect_widget_destroyed) (GtkAccessible *accessible); void (*connect_widget_destroyed) (GtkAccessible *accessible);
/* Padding for future expansion */ /* Padding for future expansion */
void (*_gtk_reserved1) (void); void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void); void (*_gtk_reserved2) (void);
...@@ -64,12 +61,12 @@ struct _GtkAccessibleClass ...@@ -64,12 +61,12 @@ struct _GtkAccessibleClass
void (*_gtk_reserved4) (void); void (*_gtk_reserved4) (void);
}; };
GType gtk_accessible_get_type (void) G_GNUC_CONST; GType gtk_accessible_get_type (void) G_GNUC_CONST;
void gtk_accessible_set_widget (GtkAccessible *accessible, void gtk_accessible_set_widget (GtkAccessible *accessible,
GtkWidget *widget); GtkWidget *widget);
GtkWidget* gtk_accessible_get_widget (GtkAccessible *accessible); GtkWidget *gtk_accessible_get_widget (GtkAccessible *accessible);
void gtk_accessible_connect_widget_destroyed (GtkAccessible *accessible); void gtk_accessible_connect_widget_destroyed (GtkAccessible *accessible);
G_END_DECLS G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment