summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-05-23 01:06:45 +0200
committerJavier Jardón <jjardon@gnome.org>2010-07-13 19:40:45 +0200
commit472753330d176532c8fcce41598c78d9277b3956 (patch)
tree014a59c1a9e5fdc58b884b8fcbbafac97de3aa87
parent5ee19bdafe57d070b9d4a26a6caf8c0e8fea9225 (diff)
downloadgtk+-472753330d176532c8fcce41598c78d9277b3956.tar.gz
gtkaccessible: Move public members to private structure
-rw-r--r--gtk/gtkaccessible.c28
-rw-r--r--gtk/gtkaccessible.h8
2 files changed, 25 insertions, 11 deletions
diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c
index 3a42ccd28c..228f88f1df 100644
--- a/gtk/gtkaccessible.c
+++ b/gtk/gtkaccessible.c
@@ -30,20 +30,34 @@
* @Title: GtkAccessible
*/
+/*
+ * GtkAccessiblePriv:
+ * @widget: The GtkWidget whose properties and features are exported via this
+ * accessible instance
+ */
+struct _GtkAccessiblePriv
+{
+ GtkWidget *widget;
+};
static void gtk_accessible_real_connect_widget_destroyed (GtkAccessible *accessible);
G_DEFINE_TYPE (GtkAccessible, gtk_accessible, ATK_TYPE_OBJECT)
static void
-gtk_accessible_init (GtkAccessible *object)
+gtk_accessible_init (GtkAccessible *accesible)
{
+ accesible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accesible,
+ GTK_TYPE_ACCESSIBLE,
+ GtkAccessiblePriv);
}
static void
gtk_accessible_class_init (GtkAccessibleClass *klass)
{
klass->connect_widget_destroyed = gtk_accessible_real_connect_widget_destroyed;
+
+ g_type_class_add_private (klass, sizeof (GtkAccessiblePriv));
}
/**
@@ -61,7 +75,7 @@ gtk_accessible_set_widget (GtkAccessible *accessible,
{
g_return_if_fail (GTK_IS_ACCESSIBLE (accessible));
- accessible->widget = widget;
+ accessible->priv->widget = widget;
}
/**
@@ -81,7 +95,7 @@ gtk_accessible_get_widget (GtkAccessible *accessible)
{
g_return_val_if_fail (GTK_IS_ACCESSIBLE (accessible), NULL);
- return accessible->widget;
+ return accessible->priv->widget;
}
/**
@@ -107,11 +121,13 @@ gtk_accessible_connect_widget_destroyed (GtkAccessible *accessible)
static void
gtk_accessible_real_connect_widget_destroyed (GtkAccessible *accessible)
{
- if (accessible->widget)
+ GtkAccessiblePriv *priv = accessible->priv;
+
+ if (priv->widget)
{
- g_signal_connect (accessible->widget,
+ g_signal_connect (priv->widget,
"destroy",
G_CALLBACK (gtk_widget_destroyed),
- &accessible->widget);
+ &priv->widget);
}
}
diff --git a/gtk/gtkaccessible.h b/gtk/gtkaccessible.h
index 1a79f158b2..584bcc5c41 100644
--- a/gtk/gtkaccessible.h
+++ b/gtk/gtkaccessible.h
@@ -37,6 +37,7 @@ G_BEGIN_DECLS
#define GTK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCESSIBLE, GtkAccessibleClass))
typedef struct _GtkAccessible GtkAccessible;
+typedef struct _GtkAccessiblePriv GtkAccessiblePriv;
typedef struct _GtkAccessibleClass GtkAccessibleClass;
/*
@@ -46,11 +47,8 @@ struct _GtkAccessible
{
AtkObject parent;
- /*
- * The GtkWidget whose properties and features are exported via this
- * accessible instance.
- */
- GtkWidget *GSEAL (widget);
+ /*< private >*/
+ GtkAccessiblePriv *priv;
};
struct _GtkAccessibleClass