Commit 7264a996 authored by Matthias Clasen's avatar Matthias Clasen

GtkArrowAccessible: add a private struct

Move instance fields to a private struct, in preparation
for installing a11y headers.
parent 1cb322e8
......@@ -20,6 +20,10 @@
#include <gtk/gtk.h>
#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;
......
......@@ -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;
};
......
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