[gtk+] GtkBooleanCellAccessible: add a private struct
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkBooleanCellAccessible: add a private struct
- Date: Sun, 14 Oct 2012 06:40:17 +0000 (UTC)
commit 5226327e1129e08e07ad030f61d32d62dff9284f
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 14 02:40:20 2012 -0400
GtkBooleanCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
gtk/a11y/gtkbooleancellaccessible.c | 23 +++++++++++++++++------
gtk/a11y/gtkbooleancellaccessible.h | 9 +++++----
2 files changed, 22 insertions(+), 10 deletions(-)
---
diff --git a/gtk/a11y/gtkbooleancellaccessible.c b/gtk/a11y/gtkbooleancellaccessible.c
index e8e9c62..af64c58 100644
--- a/gtk/a11y/gtkbooleancellaccessible.c
+++ b/gtk/a11y/gtkbooleancellaccessible.c
@@ -20,6 +20,12 @@
#include <gtk/gtk.h>
#include "gtkbooleancellaccessible.h"
+struct _GtkBooleanCellAccessiblePrivate
+{
+ gboolean cell_value;
+ gboolean cell_sensitive;
+};
+
static AtkActionIface *parent_action_iface;
static gint
@@ -82,10 +88,10 @@ gtk_boolean_cell_accessible_ref_state_set (AtkObject *accessible)
state_set = ATK_OBJECT_CLASS (_gtk_boolean_cell_accessible_parent_class)->ref_state_set (accessible);
- if (cell->cell_value)
+ if (cell->priv->cell_value)
atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
- if (cell->cell_sensitive)
+ if (cell->priv->cell_sensitive)
atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
else
atk_state_set_remove_state (state_set, ATK_STATE_SENSITIVE);
@@ -105,16 +111,16 @@ gtk_boolean_cell_accessible_update_cache (GtkCellAccessible *cell)
"sensitive", &sensitive,
NULL);
- if (boolean_cell->cell_value != active)
+ if (boolean_cell->priv->cell_value != active)
{
- boolean_cell->cell_value = !boolean_cell->cell_value;
+ boolean_cell->priv->cell_value = !boolean_cell->priv->cell_value;
atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active);
}
- if (boolean_cell->cell_sensitive != sensitive)
+ if (boolean_cell->priv->cell_sensitive != sensitive)
{
- boolean_cell->cell_sensitive = !boolean_cell->cell_sensitive;
+ boolean_cell->priv->cell_sensitive = !boolean_cell->priv->cell_sensitive;
atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, sensitive);
}
@@ -129,10 +135,15 @@ _gtk_boolean_cell_accessible_class_init (GtkBooleanCellAccessibleClass *klass)
atkobject_class->ref_state_set = gtk_boolean_cell_accessible_ref_state_set;
cell_class->update_cache = gtk_boolean_cell_accessible_update_cache;
+
+ g_type_class_add_private (klass, sizeof (GtkBooleanCellAccessiblePrivate));
}
static void
_gtk_boolean_cell_accessible_init (GtkBooleanCellAccessible *cell)
{
+ cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
+ GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE,
+ GtkBooleanCellAccessiblePrivate);
}
diff --git a/gtk/a11y/gtkbooleancellaccessible.h b/gtk/a11y/gtkbooleancellaccessible.h
index 1d32b72..f711fed 100644
--- a/gtk/a11y/gtkbooleancellaccessible.h
+++ b/gtk/a11y/gtkbooleancellaccessible.h
@@ -30,14 +30,15 @@ G_BEGIN_DECLS
#define GTK_IS_BOOLEAN_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE))
#define GTK_BOOLEAN_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, GtkBooleanCellAccessibleClass))
-typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible;
-typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
+typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible;
+typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
+typedef struct _GtkBooleanCellAccessiblePrivate GtkBooleanCellAccessiblePrivate;
struct _GtkBooleanCellAccessible
{
GtkRendererCellAccessible parent;
- gboolean cell_value;
- gboolean cell_sensitive;
+
+ GtkBooleanCellAccessiblePrivate *priv;
};
struct _GtkBooleanCellAccessibleClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]