[gtk+] a11y: Use new macros for defining private data



commit 365919d5f6da0a8648815ca5cf5805fb88c9be16
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Jun 24 19:13:44 2013 +0100

    a11y: Use new macros for defining private data
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702996

 gtk/a11y/gtkarrowaccessible.c         |    7 ++-----
 gtk/a11y/gtkbooleancellaccessible.c   |   11 ++++-------
 gtk/a11y/gtkcomboboxaccessible.c      |    7 ++-----
 gtk/a11y/gtkcontaineraccessible.c     |   12 ++++--------
 gtk/a11y/gtkcontainercellaccessible.c |    8 ++------
 gtk/a11y/gtkentryaccessible.c         |    7 ++-----
 gtk/a11y/gtkiconviewaccessible.c      |    7 ++-----
 gtk/a11y/gtkimageaccessible.c         |    7 ++-----
 gtk/a11y/gtkimagecellaccessible.c     |    7 ++-----
 gtk/a11y/gtklabelaccessible.c         |    7 ++-----
 gtk/a11y/gtklinkbuttonaccessible.c    |    7 ++-----
 gtk/a11y/gtkmenuitemaccessible.c      |    7 ++-----
 gtk/a11y/gtknotebookaccessible.c      |    7 ++-----
 gtk/a11y/gtknotebookpageaccessible.c  |    7 ++-----
 gtk/a11y/gtkradiobuttonaccessible.c   |    8 ++------
 gtk/a11y/gtkradiomenuitemaccessible.c |   10 ++++------
 gtk/a11y/gtkrenderercellaccessible.c  |    8 ++------
 gtk/a11y/gtktextcellaccessible.c      |    7 ++-----
 gtk/a11y/gtktextviewaccessible.c      |    7 ++-----
 gtk/a11y/gtktoplevelaccessible.c      |    8 ++------
 gtk/a11y/gtktreeviewaccessible.c      |    7 ++-----
 gtk/a11y/gtkwidgetaccessible.c        |    7 ++-----
 22 files changed, 50 insertions(+), 120 deletions(-)
---
diff --git a/gtk/a11y/gtkarrowaccessible.c b/gtk/a11y/gtkarrowaccessible.c
index 00f401e..fb1fdfc 100644
--- a/gtk/a11y/gtkarrowaccessible.c
+++ b/gtk/a11y/gtkarrowaccessible.c
@@ -28,6 +28,7 @@ struct _GtkArrowAccessiblePrivate
 static void atk_image_interface_init (AtkImageIface  *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkArrowAccessible, gtk_arrow_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkArrowAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
 
 static void
@@ -58,16 +59,12 @@ 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->priv = G_TYPE_INSTANCE_GET_PRIVATE (arrow,
-                                             GTK_TYPE_ARROW_ACCESSIBLE,
-                                             GtkArrowAccessiblePrivate);
+  arrow->priv = gtk_arrow_accessible_get_instance_private (arrow);
 }
 
 static const gchar *
diff --git a/gtk/a11y/gtkbooleancellaccessible.c b/gtk/a11y/gtkbooleancellaccessible.c
index f114261..1b3df15 100644
--- a/gtk/a11y/gtkbooleancellaccessible.c
+++ b/gtk/a11y/gtkbooleancellaccessible.c
@@ -88,8 +88,9 @@ gtk_boolean_cell_accessible_action_interface_init (AtkActionIface *iface)
 }
 
 
-G_DEFINE_TYPE_EXTENDED (GtkBooleanCellAccessible, gtk_boolean_cell_accessible, 
GTK_TYPE_RENDERER_CELL_ACCESSIBLE, 0,
-                        G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, 
gtk_boolean_cell_accessible_action_interface_init))
+G_DEFINE_TYPE_WITH_CODE (GtkBooleanCellAccessible, gtk_boolean_cell_accessible, 
GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkBooleanCellAccessible)
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, 
gtk_boolean_cell_accessible_action_interface_init))
 
 
 static AtkStateSet *
@@ -150,15 +151,11 @@ 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);
+  cell->priv = gtk_boolean_cell_accessible_get_instance_private (cell);
 }
 
diff --git a/gtk/a11y/gtkcomboboxaccessible.c b/gtk/a11y/gtkcomboboxaccessible.c
index 94a53ea..e271f8e 100644
--- a/gtk/a11y/gtkcomboboxaccessible.c
+++ b/gtk/a11y/gtkcomboboxaccessible.c
@@ -31,6 +31,7 @@ struct _GtkComboBoxAccessiblePrivate
 static void atk_action_interface_init    (AtkActionIface    *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkComboBoxAccessible, gtk_combo_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkComboBoxAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
 
 static void
@@ -199,16 +200,12 @@ gtk_combo_box_accessible_class_init (GtkComboBoxAccessibleClass *klass)
   class->get_n_children = gtk_combo_box_accessible_get_n_children;
   class->ref_child = gtk_combo_box_accessible_ref_child;
   class->initialize = gtk_combo_box_accessible_initialize;
-
-  g_type_class_add_private (klass, sizeof (GtkComboBoxAccessiblePrivate));
 }
 
 static void
 gtk_combo_box_accessible_init (GtkComboBoxAccessible *combo_box)
 {
-  combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
-                                                 GTK_TYPE_COMBO_BOX_ACCESSIBLE,
-                                                 GtkComboBoxAccessiblePrivate);
+  combo_box->priv = gtk_combo_box_accessible_get_instance_private (combo_box);
   combo_box->priv->old_selection = -1;
   combo_box->priv->name = NULL;
   combo_box->priv->popup_set = FALSE;
diff --git a/gtk/a11y/gtkcontaineraccessible.c b/gtk/a11y/gtkcontaineraccessible.c
index ccf075c..fcc7301 100644
--- a/gtk/a11y/gtkcontaineraccessible.c
+++ b/gtk/a11y/gtkcontaineraccessible.c
@@ -25,7 +25,7 @@ struct _GtkContainerAccessiblePrivate
   GList *children;
 };
 
-G_DEFINE_TYPE (GtkContainerAccessible, gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkContainerAccessible, gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
 
 static gint
 gtk_container_accessible_get_n_children (AtkObject* obj)
@@ -90,8 +90,8 @@ gtk_container_accessible_add_gtk (GtkContainer *container,
  
 static gint
 gtk_container_accessible_remove_gtk (GtkContainer *container,
-                           GtkWidget    *widget,
-                           gpointer     data)
+                                     GtkWidget    *widget,
+                                     gpointer     data)
 {
   GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (data);
   GtkContainerAccessibleClass *klass;
@@ -193,14 +193,10 @@ gtk_container_accessible_class_init (GtkContainerAccessibleClass *klass)
 
   klass->add_gtk = gtk_container_accessible_real_add_gtk;
   klass->remove_gtk = gtk_container_accessible_real_remove_gtk;
-
-  g_type_class_add_private (klass, sizeof (GtkContainerAccessiblePrivate));
 }
 
 static void
 gtk_container_accessible_init (GtkContainerAccessible *container)
 {
-  container->priv = G_TYPE_INSTANCE_GET_PRIVATE (container,
-                                                 GTK_TYPE_CONTAINER_ACCESSIBLE,
-                                                 GtkContainerAccessiblePrivate);
+  container->priv = gtk_container_accessible_get_instance_private (container);
 }
diff --git a/gtk/a11y/gtkcontainercellaccessible.c b/gtk/a11y/gtkcontainercellaccessible.c
index 2da42ea..519b16b 100644
--- a/gtk/a11y/gtkcontainercellaccessible.c
+++ b/gtk/a11y/gtkcontainercellaccessible.c
@@ -27,7 +27,7 @@ struct _GtkContainerCellAccessiblePrivate
   gint n_children;
 };
 
-G_DEFINE_TYPE (GtkContainerCellAccessible, gtk_container_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkContainerCellAccessible, gtk_container_cell_accessible, 
GTK_TYPE_CELL_ACCESSIBLE)
 
 
 static void
@@ -114,16 +114,12 @@ gtk_container_cell_accessible_class_init (GtkContainerCellAccessibleClass *klass
   accessible_class->widget_unset = gtk_container_cell_widget_unset;
 
   cell_class->update_cache = gtk_container_cell_accessible_update_cache;
-
-  g_type_class_add_private (g_object_class, sizeof (GtkContainerCellAccessiblePrivate));
 }
 
 static void
 gtk_container_cell_accessible_init (GtkContainerCellAccessible *cell)
 {
-  cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
-                                            GTK_TYPE_CONTAINER_CELL_ACCESSIBLE,
-                                            GtkContainerCellAccessiblePrivate);
+  cell->priv = gtk_container_cell_accessible_get_instance_private (cell);
 }
 
 GtkContainerCellAccessible *
diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c
index 7d82e38..981bc80 100644
--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -383,6 +383,7 @@ static void atk_action_interface_init        (AtkActionIface       *iface);
 
 
 G_DEFINE_TYPE_WITH_CODE (GtkEntryAccessible, gtk_entry_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkEntryAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
@@ -750,16 +751,12 @@ gtk_entry_accessible_class_init (GtkEntryAccessibleClass *klass)
   widget_class->notify_gtk = gtk_entry_accessible_notify_gtk;
 
   gobject_class->finalize = gtk_entry_accessible_finalize;
-
-  g_type_class_add_private (klass, sizeof (GtkEntryAccessiblePrivate));
 }
 
 static void
 gtk_entry_accessible_init (GtkEntryAccessible *entry)
 {
-  entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (entry,
-                                             GTK_TYPE_ENTRY_ACCESSIBLE,
-                                             GtkEntryAccessiblePrivate);
+  entry->priv = gtk_entry_accessible_get_instance_private (entry);
   entry->priv->cursor_position = 0;
   entry->priv->selection_bound = 0;
 }
diff --git a/gtk/a11y/gtkiconviewaccessible.c b/gtk/a11y/gtkiconviewaccessible.c
index db02598..ce78c22 100644
--- a/gtk/a11y/gtkiconviewaccessible.c
+++ b/gtk/a11y/gtkiconviewaccessible.c
@@ -850,6 +850,7 @@ static void atk_component_interface_init (AtkComponentIface *iface);
 static void atk_selection_interface_init (AtkSelectionIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkIconViewAccessible, gtk_icon_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkIconViewAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
 
@@ -1336,16 +1337,12 @@ gtk_icon_view_accessible_class_init (GtkIconViewAccessibleClass *klass)
   atk_class->get_n_children = gtk_icon_view_accessible_get_n_children;
   atk_class->ref_child = gtk_icon_view_accessible_ref_child;
   atk_class->initialize = gtk_icon_view_accessible_initialize;
-
-  g_type_class_add_private (klass, sizeof (GtkIconViewAccessiblePrivate));
 }
 
 static void
 gtk_icon_view_accessible_init (GtkIconViewAccessible *accessible)
 {
-  accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible,
-                                                  GTK_TYPE_ICON_VIEW_ACCESSIBLE,
-                                                  GtkIconViewAccessiblePrivate);
+  accessible->priv = gtk_icon_view_accessible_get_instance_private (accessible);
 }
 
 static AtkObject*
diff --git a/gtk/a11y/gtkimageaccessible.c b/gtk/a11y/gtkimageaccessible.c
index 57ff77b..9034f69 100644
--- a/gtk/a11y/gtkimageaccessible.c
+++ b/gtk/a11y/gtkimageaccessible.c
@@ -30,6 +30,7 @@ struct _GtkImageAccessiblePrivate
 static void atk_image_interface_init (AtkImageIface  *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkImageAccessible, gtk_image_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkImageAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
 
 static void
@@ -103,16 +104,12 @@ gtk_image_accessible_class_init (GtkImageAccessibleClass *klass)
   gobject_class->finalize = gtk_image_accessible_finalize;
   class->initialize = gtk_image_accessible_initialize;
   class->get_name = gtk_image_accessible_get_name;
-
-  g_type_class_add_private (klass, sizeof (GtkImageAccessiblePrivate));
 }
 
 static void
 gtk_image_accessible_init (GtkImageAccessible *image)
 {
-  image->priv = G_TYPE_INSTANCE_GET_PRIVATE (image,
-                                             GTK_TYPE_IMAGE_ACCESSIBLE,
-                                             GtkImageAccessiblePrivate);
+  image->priv = gtk_image_accessible_get_instance_private (image);
 }
 
 static const gchar *
diff --git a/gtk/a11y/gtkimagecellaccessible.c b/gtk/a11y/gtkimagecellaccessible.c
index 6b69060..7851bb1 100644
--- a/gtk/a11y/gtkimagecellaccessible.c
+++ b/gtk/a11y/gtkimagecellaccessible.c
@@ -28,6 +28,7 @@ struct _GtkImageCellAccessiblePrivate
 static void atk_image_interface_init (AtkImageIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkImageCellAccessible, gtk_image_cell_accessible, 
GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkImageCellAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
 
 static void
@@ -45,16 +46,12 @@ gtk_image_cell_accessible_class_init (GtkImageCellAccessibleClass *klass)
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
   gobject_class->finalize = gtk_image_cell_accessible_finalize;
-
-  g_type_class_add_private (klass, sizeof (GtkImageCellAccessiblePrivate));
 }
 
 static void
 gtk_image_cell_accessible_init (GtkImageCellAccessible *image_cell)
 {
-  image_cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (image_cell,
-                                                  GTK_TYPE_IMAGE_CELL_ACCESSIBLE,
-                                                  GtkImageCellAccessiblePrivate);
+  image_cell->priv = gtk_image_cell_accessible_get_instance_private (image_cell);
 }
 
 static const gchar *
diff --git a/gtk/a11y/gtklabelaccessible.c b/gtk/a11y/gtklabelaccessible.c
index c216764..9c35ad7 100644
--- a/gtk/a11y/gtklabelaccessible.c
+++ b/gtk/a11y/gtklabelaccessible.c
@@ -31,14 +31,13 @@ struct _GtkLabelAccessiblePrivate
 static void atk_text_interface_init (AtkTextIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkLabelAccessible, gtk_label_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkLabelAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init))
 
 static void
 gtk_label_accessible_init (GtkLabelAccessible *label)
 {
-  label->priv = G_TYPE_INSTANCE_GET_PRIVATE (label,
-                                             GTK_TYPE_LABEL_ACCESSIBLE,
-                                             GtkLabelAccessiblePrivate);
+  label->priv = gtk_label_accessible_get_instance_private (label);
 }
 
 static void
@@ -279,8 +278,6 @@ gtk_label_accessible_class_init (GtkLabelAccessibleClass *klass)
   class->ref_state_set = gtk_label_accessible_ref_state_set;
   class->ref_relation_set = gtk_label_accessible_ref_relation_set;
   class->initialize = gtk_label_accessible_initialize;
-
-  g_type_class_add_private (klass, sizeof (GtkLabelAccessiblePrivate));
 }
 
 /* atktext.h */
diff --git a/gtk/a11y/gtklinkbuttonaccessible.c b/gtk/a11y/gtklinkbuttonaccessible.c
index b76f237..19ffe55 100644
--- a/gtk/a11y/gtklinkbuttonaccessible.c
+++ b/gtk/a11y/gtklinkbuttonaccessible.c
@@ -198,14 +198,13 @@ gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl)
 static void atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, gtk_link_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkLinkButtonAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERLINK_IMPL, atk_hypertext_impl_interface_init))
 
 static void
 gtk_link_button_accessible_init (GtkLinkButtonAccessible *button)
 {
-  button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
-                                              GTK_TYPE_LINK_BUTTON_ACCESSIBLE,
-                                              GtkLinkButtonAccessiblePrivate);
+  button->priv = gtk_link_button_accessible_get_instance_private (button);
 }
 
 static void
@@ -223,8 +222,6 @@ static void
 gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
 {
   G_OBJECT_CLASS (klass)->finalize = gtk_link_button_accessible_finalize;
-
-  g_type_class_add_private (klass, sizeof (GtkLinkButtonAccessiblePrivate));
 }
 
 static void
diff --git a/gtk/a11y/gtkmenuitemaccessible.c b/gtk/a11y/gtkmenuitemaccessible.c
index 15ef15d..ff1fd26 100644
--- a/gtk/a11y/gtkmenuitemaccessible.c
+++ b/gtk/a11y/gtkmenuitemaccessible.c
@@ -47,6 +47,7 @@ static void atk_action_interface_init    (AtkActionIface *iface);
 static void atk_selection_interface_init (AtkSelectionIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkMenuItemAccessible, gtk_menu_item_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkMenuItemAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init);
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
 
@@ -258,16 +259,12 @@ gtk_menu_item_accessible_class_init (GtkMenuItemAccessibleClass *klass)
   class->initialize = gtk_menu_item_accessible_initialize;
   class->get_name = gtk_menu_item_accessible_get_name;
   class->get_role = gtk_menu_item_accessible_get_role;
-
-  g_type_class_add_private (klass, sizeof (GtkMenuItemAccessiblePrivate));
 }
 
 static void
 gtk_menu_item_accessible_init (GtkMenuItemAccessible *menu_item)
 {
-  menu_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (menu_item,
-                                                 GTK_TYPE_MENU_ITEM_ACCESSIBLE,
-                                                 GtkMenuItemAccessiblePrivate);
+  menu_item->priv = gtk_menu_item_accessible_get_instance_private (menu_item);
 }
 
 static GtkWidget *
diff --git a/gtk/a11y/gtknotebookaccessible.c b/gtk/a11y/gtknotebookaccessible.c
index f3b40db..0246288 100644
--- a/gtk/a11y/gtknotebookaccessible.c
+++ b/gtk/a11y/gtknotebookaccessible.c
@@ -39,6 +39,7 @@ struct _GtkNotebookAccessiblePrivate
 static void atk_selection_interface_init (AtkSelectionIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkNotebookAccessible, gtk_notebook_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkNotebookAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
 
 static gboolean
@@ -322,16 +323,12 @@ gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
   /* we listen to page-added/-removed, so we don't care about these */
   container_class->add_gtk = NULL;
   container_class->remove_gtk = NULL;
-
-  g_type_class_add_private (klass, sizeof (GtkNotebookAccessiblePrivate));
 }
 
 static void
 gtk_notebook_accessible_init (GtkNotebookAccessible *notebook)
 {
-  notebook->priv = G_TYPE_INSTANCE_GET_PRIVATE (notebook,
-                                                GTK_TYPE_NOTEBOOK_ACCESSIBLE,
-                                                GtkNotebookAccessiblePrivate);
+  notebook->priv = gtk_notebook_accessible_get_instance_private (notebook);
   notebook->priv->pages = g_hash_table_new_full (g_direct_hash,
                                                  g_direct_equal,
                                                  NULL,
diff --git a/gtk/a11y/gtknotebookpageaccessible.c b/gtk/a11y/gtknotebookpageaccessible.c
index b228757..249d19c 100644
--- a/gtk/a11y/gtknotebookpageaccessible.c
+++ b/gtk/a11y/gtknotebookpageaccessible.c
@@ -31,6 +31,7 @@ struct _GtkNotebookPageAccessiblePrivate
 static void atk_component_interface_init (AtkComponentIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkNotebookPageAccessible, gtk_notebook_page_accessible, ATK_TYPE_OBJECT,
+                         G_ADD_PRIVATE (GtkNotebookPageAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
 
 
@@ -213,16 +214,12 @@ gtk_notebook_page_accessible_class_init (GtkNotebookPageAccessibleClass *klass)
   class->ref_child = gtk_notebook_page_accessible_ref_child;
   class->ref_state_set = gtk_notebook_page_accessible_ref_state_set;
   class->get_index_in_parent = gtk_notebook_page_accessible_get_index_in_parent;
-
-  g_type_class_add_private (klass, sizeof (GtkNotebookPageAccessiblePrivate));
 }
 
 static void
 gtk_notebook_page_accessible_init (GtkNotebookPageAccessible *page)
 {
-  page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page,
-                                            GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE,
-                                            GtkNotebookPageAccessiblePrivate);
+  page->priv = gtk_notebook_page_accessible_get_instance_private (page);
 }
 
 static void
diff --git a/gtk/a11y/gtkradiobuttonaccessible.c b/gtk/a11y/gtkradiobuttonaccessible.c
index d4719a4..df5392b 100644
--- a/gtk/a11y/gtkradiobuttonaccessible.c
+++ b/gtk/a11y/gtkradiobuttonaccessible.c
@@ -26,7 +26,7 @@ struct _GtkRadioButtonAccessiblePrivate
 };
 
 
-G_DEFINE_TYPE (GtkRadioButtonAccessible, gtk_radio_button_accessible, GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkRadioButtonAccessible, gtk_radio_button_accessible, 
GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE)
 
 static void
 gtk_radio_button_accessible_initialize (AtkObject *accessible,
@@ -109,14 +109,10 @@ gtk_radio_button_accessible_class_init (GtkRadioButtonAccessibleClass *klass)
 
   class->initialize = gtk_radio_button_accessible_initialize;
   class->ref_relation_set = gtk_radio_button_accessible_ref_relation_set;
-
-  g_type_class_add_private (klass, sizeof (GtkRadioButtonAccessiblePrivate));
 }
 
 static void
 gtk_radio_button_accessible_init (GtkRadioButtonAccessible *radio_button)
 {
-  radio_button->priv = G_TYPE_INSTANCE_GET_PRIVATE (radio_button,
-                                                    GTK_TYPE_RADIO_BUTTON_ACCESSIBLE,
-                                                    GtkRadioButtonAccessiblePrivate);
+  radio_button->priv = gtk_radio_button_accessible_get_instance_private (radio_button);
 }
diff --git a/gtk/a11y/gtkradiomenuitemaccessible.c b/gtk/a11y/gtkradiomenuitemaccessible.c
index 30df9a2..d720565 100644
--- a/gtk/a11y/gtkradiomenuitemaccessible.c
+++ b/gtk/a11y/gtkradiomenuitemaccessible.c
@@ -25,7 +25,9 @@ struct _GtkRadioMenuItemAccessiblePrivate
   GSList *old_group;
 };
 
-G_DEFINE_TYPE (GtkRadioMenuItemAccessible, gtk_radio_menu_item_accessible, 
GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkRadioMenuItemAccessible,
+                            gtk_radio_menu_item_accessible,
+                            GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE)
 
 
 static AtkRelationSet *
@@ -106,14 +108,10 @@ gtk_radio_menu_item_accessible_class_init (GtkRadioMenuItemAccessibleClass *klas
 
   class->ref_relation_set = gtk_radio_menu_item_accessible_ref_relation_set;
   class->initialize = gtk_radio_menu_item_accessible_initialize;
-
-  g_type_class_add_private (klass, sizeof (GtkRadioMenuItemAccessiblePrivate));
 }
 
 static void
 gtk_radio_menu_item_accessible_init (GtkRadioMenuItemAccessible *radio_menu_item)
 {
-  radio_menu_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (radio_menu_item,
-                                                       GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE,
-                                                       GtkRadioMenuItemAccessiblePrivate);
+  radio_menu_item->priv = gtk_radio_menu_item_accessible_get_instance_private (radio_menu_item);
 }
diff --git a/gtk/a11y/gtkrenderercellaccessible.c b/gtk/a11y/gtkrenderercellaccessible.c
index d8fdc59..3306c6d 100644
--- a/gtk/a11y/gtkrenderercellaccessible.c
+++ b/gtk/a11y/gtkrenderercellaccessible.c
@@ -31,7 +31,7 @@ enum {
   PROP_RENDERER
 };
 
-G_DEFINE_TYPE (GtkRendererCellAccessible, gtk_renderer_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkRendererCellAccessible, gtk_renderer_cell_accessible, 
GTK_TYPE_CELL_ACCESSIBLE)
 
 static void
 gtk_renderer_cell_accessible_set_property (GObject         *object,
@@ -98,16 +98,12 @@ gtk_renderer_cell_accessible_class_init (GtkRendererCellAccessibleClass *klass)
                                                        P_("The cell renderer represented by this 
accessible"),
                                                        GTK_TYPE_CELL_RENDERER,
                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-  g_type_class_add_private (klass, sizeof (GtkRendererCellAccessiblePrivate));
 }
 
 static void
 gtk_renderer_cell_accessible_init (GtkRendererCellAccessible *renderer_cell)
 {
-  renderer_cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (renderer_cell,
-                                                     GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
-                                                     GtkRendererCellAccessiblePrivate);
+  renderer_cell->priv = gtk_renderer_cell_accessible_get_instance_private (renderer_cell);
 }
 
 AtkObject *
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
index 32097e6..74a9954 100644
--- a/gtk/a11y/gtktextcellaccessible.c
+++ b/gtk/a11y/gtktextcellaccessible.c
@@ -90,6 +90,7 @@ static void gtk_text_cell_accessible_update_cache       (GtkCellAccessible *cell
 static void atk_text_interface_init (AtkTextIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkTextCellAccessible, gtk_text_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkTextCellAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init))
 
 static AtkStateSet *
@@ -196,16 +197,12 @@ gtk_text_cell_accessible_class_init (GtkTextCellAccessibleClass *klass)
   atk_object_class->ref_state_set = gtk_text_cell_accessible_ref_state_set;
 
   gobject_class->finalize = gtk_text_cell_accessible_finalize;
-
-  g_type_class_add_private (klass, sizeof (GtkTextCellAccessiblePrivate));
 }
 
 static void
 gtk_text_cell_accessible_init (GtkTextCellAccessible *text_cell)
 {
-  text_cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_cell,
-                                                 GTK_TYPE_TEXT_CELL_ACCESSIBLE,
-                                                 GtkTextCellAccessiblePrivate);
+  text_cell->priv = gtk_text_cell_accessible_get_instance_private (text_cell);
 }
 
 static gchar *
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
index ca07161..7839d2e 100644
--- a/gtk/a11y/gtktextviewaccessible.c
+++ b/gtk/a11y/gtktextviewaccessible.c
@@ -57,6 +57,7 @@ static void atk_text_interface_init               (AtkTextIface              *if
 static void atk_streamable_content_interface_init (AtkStreamableContentIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkTextViewAccessible, gtk_text_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkTextViewAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_STREAMABLE_CONTENT, 
atk_streamable_content_interface_init))
@@ -167,16 +168,12 @@ gtk_text_view_accessible_class_init (GtkTextViewAccessibleClass *klass)
   class->initialize = gtk_text_view_accessible_initialize;
 
   widget_class->notify_gtk = gtk_text_view_accessible_notify_gtk;
-
-  g_type_class_add_private (klass, sizeof (GtkTextViewAccessiblePrivate));
 }
 
 static void
 gtk_text_view_accessible_init (GtkTextViewAccessible *accessible)
 {
-  accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible,
-                                                  GTK_TYPE_TEXT_VIEW_ACCESSIBLE,
-                                                  GtkTextViewAccessiblePrivate);
+  accessible->priv = gtk_text_view_accessible_get_instance_private (accessible);
 }
 
 static gchar *
diff --git a/gtk/a11y/gtktoplevelaccessible.c b/gtk/a11y/gtktoplevelaccessible.c
index 56d5183..037500b 100644
--- a/gtk/a11y/gtktoplevelaccessible.c
+++ b/gtk/a11y/gtktoplevelaccessible.c
@@ -35,7 +35,7 @@ struct _GtkToplevelAccessiblePrivate
   GList *window_list;
 };
 
-G_DEFINE_TYPE (GtkToplevelAccessible, gtk_toplevel_accessible, ATK_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkToplevelAccessible, gtk_toplevel_accessible, ATK_TYPE_OBJECT)
 
 static void
 gtk_toplevel_accessible_initialize (AtkObject *accessible,
@@ -151,8 +151,6 @@ gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
   class->get_name = gtk_toplevel_accessible_get_name;
 
   g_object_class->finalize = gtk_toplevel_accessible_object_finalize;
-
-  g_type_class_add_private (klass, sizeof (GtkToplevelAccessiblePrivate));
 }
 
 static void
@@ -260,9 +258,7 @@ gtk_toplevel_accessible_init (GtkToplevelAccessible *toplevel)
   GList *l;
   guint signal_id;
 
-  toplevel->priv = G_TYPE_INSTANCE_GET_PRIVATE (toplevel,
-                                                GTK_TYPE_TOPLEVEL_ACCESSIBLE,
-                                                GtkToplevelAccessiblePrivate);
+  toplevel->priv = gtk_toplevel_accessible_get_instance_private (toplevel);
 
   l = toplevel->priv->window_list = gtk_window_list_toplevels ();
 
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 31032b2..fb9e2ce 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -82,6 +82,7 @@ static void atk_component_interface_init              (AtkComponentIface
 static void gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkTreeViewAccessible, gtk_tree_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkTreeViewAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE, atk_table_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
@@ -529,16 +530,12 @@ gtk_tree_view_accessible_class_init (GtkTreeViewAccessibleClass *klass)
   container_class->remove_gtk = NULL;
 
   gobject_class->finalize = gtk_tree_view_accessible_finalize;
-
-  g_type_class_add_private (klass, sizeof (GtkTreeViewAccessiblePrivate));
 }
 
 static void
 gtk_tree_view_accessible_init (GtkTreeViewAccessible *view)
 {
-  view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
-                                            GTK_TYPE_TREE_VIEW_ACCESSIBLE,
-                                            GtkTreeViewAccessiblePrivate);
+  view->priv = gtk_tree_view_accessible_get_instance_private (view);
 }
 
 /* atkcomponent.h */
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c
index 6f4acaa..841ae14 100644
--- a/gtk/a11y/gtkwidgetaccessible.c
+++ b/gtk/a11y/gtkwidgetaccessible.c
@@ -40,6 +40,7 @@ static gboolean gtk_widget_accessible_all_parents_visible (GtkWidget *widget);
 static void atk_component_interface_init (AtkComponentIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GtkWidgetAccessible, gtk_widget_accessible, GTK_TYPE_ACCESSIBLE,
+                         G_ADD_PRIVATE (GtkWidgetAccessible)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
 
 /* Translate GtkWidget::focus-in/out-event to AtkObject::focus-event */
@@ -541,16 +542,12 @@ gtk_widget_accessible_class_init (GtkWidgetAccessibleClass *klass)
   class->initialize = gtk_widget_accessible_initialize;
   class->get_attributes = gtk_widget_accessible_get_attributes;
   class->focus_event = gtk_widget_accessible_focus_event;
-
-  g_type_class_add_private (klass, sizeof (GtkWidgetAccessiblePrivate));
 }
 
 static void
 gtk_widget_accessible_init (GtkWidgetAccessible *accessible)
 {
-  accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible,
-                                                  GTK_TYPE_WIDGET_ACCESSIBLE,
-                                                  GtkWidgetAccessiblePrivate);
+  accessible->priv = gtk_widget_accessible_get_instance_private (accessible);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]