From 7264a996fe6bb4a21f6c8453b1acd4dc1a2daf79 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 14 Oct 2012 02:39:32 -0400 Subject: [PATCH] GtkArrowAccessible: add a private struct Move instance fields to a private struct, in preparation for installing a11y headers. --- gtk/a11y/gtkarrowaccessible.c | 18 +++++++++++++----- gtk/a11y/gtkarrowaccessible.h | 6 ++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/gtk/a11y/gtkarrowaccessible.c b/gtk/a11y/gtkarrowaccessible.c index 7368be78aa..9950158a6a 100644 --- a/gtk/a11y/gtkarrowaccessible.c +++ b/gtk/a11y/gtkarrowaccessible.c @@ -20,6 +20,10 @@ #include #include "gtkarrowaccessible.h" +struct _GtkArrowAccessiblePrivate +{ + gchar *image_description; +}; static void atk_image_interface_init (AtkImageIface *iface); @@ -40,7 +44,7 @@ gtk_arrow_accessible_finalize (GObject *object) { GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (object); - g_free (arrow->image_description); + g_free (arrow->priv->image_description); G_OBJECT_CLASS (_gtk_arrow_accessible_parent_class)->finalize (object); } @@ -54,12 +58,16 @@ _gtk_arrow_accessible_class_init (GtkArrowAccessibleClass *klass) atk_object_class->initialize = gtk_arrow_accessible_initialize; gobject_class->finalize = gtk_arrow_accessible_finalize; + + g_type_class_add_private (klass, sizeof (GtkArrowAccessiblePrivate)); } static void _gtk_arrow_accessible_init (GtkArrowAccessible *arrow) { - arrow->image_description = NULL; + arrow->priv = G_TYPE_INSTANCE_GET_PRIVATE (arrow, + GTK_TYPE_ARROW_ACCESSIBLE, + GtkArrowAccessiblePrivate); } static const gchar * @@ -67,7 +75,7 @@ gtk_arrow_accessible_get_image_description (AtkImage *obj) { GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj); - return arrow->image_description; + return arrow->priv->image_description; } static gboolean @@ -76,8 +84,8 @@ gtk_arrow_accessible_set_image_description (AtkImage *obj, { GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj); - g_free (arrow->image_description); - arrow->image_description = g_strdup (description); + g_free (arrow->priv->image_description); + arrow->priv->image_description = g_strdup (description); return TRUE; diff --git a/gtk/a11y/gtkarrowaccessible.h b/gtk/a11y/gtkarrowaccessible.h index 84d7f10a88..492a473a8a 100644 --- a/gtk/a11y/gtkarrowaccessible.h +++ b/gtk/a11y/gtkarrowaccessible.h @@ -29,13 +29,15 @@ G_BEGIN_DECLS #define GTK_IS_ARROW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ARROW_ACCESSIBLE)) #define GTK_ARROW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ARROW_ACCESSIBLE, GtkArrowAccessibleClass)) -typedef struct _GtkArrowAccessible GtkArrowAccessible; -typedef struct _GtkArrowAccessibleClass GtkArrowAccessibleClass; +typedef struct _GtkArrowAccessible GtkArrowAccessible; +typedef struct _GtkArrowAccessibleClass GtkArrowAccessibleClass; +typedef struct _GtkArrowAccessiblePrivate GtkArrowAccessiblePrivate; struct _GtkArrowAccessible { GtkWidgetAccessible parent; + GtkArrowAccessiblePrivate *priv; gchar *image_description; };