[gtk+/a11y] Convert GailContainer to GtkContainerAccessible



commit 1400ee2635568958be0ac197d2083590e8a4a5b1
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 1 23:29:06 2011 -0400

    Convert GailContainer to GtkContainerAccessible

 gtk/a11y/Makefile.am                   |    4 +-
 gtk/a11y/gail.c                        |    3 -
 gtk/a11y/gailcontainer.c               |  244 --------------------------------
 gtk/a11y/gailcontainer.h               |   60 --------
 gtk/a11y/gtkboxaccessible.c            |    3 +-
 gtk/a11y/gtkboxaccessible.h            |   18 ++--
 gtk/a11y/gtkbuttonaccessible.c         |    4 +-
 gtk/a11y/gtkbuttonaccessible.h         |    7 +-
 gtk/a11y/gtkcomboboxaccessible.c       |    2 +-
 gtk/a11y/gtkcomboboxaccessible.h       |    6 +-
 gtk/a11y/gtkcontaineraccessible.c      |  202 ++++++++++++++++++++++++++
 gtk/a11y/gtkcontaineraccessible.h      |   60 ++++++++
 gtk/a11y/gtkexpanderaccessible.c       |    2 +-
 gtk/a11y/gtkexpanderaccessible.h       |    6 +-
 gtk/a11y/gtkframeaccessible.c          |    2 +-
 gtk/a11y/gtkframeaccessible.h          |    6 +-
 gtk/a11y/gtkmenuitemaccessible.c       |    2 +-
 gtk/a11y/gtkmenuitemaccessible.h       |    6 +-
 gtk/a11y/gtkmenushellaccessible.c      |    2 +-
 gtk/a11y/gtkmenushellaccessible.h      |    6 +-
 gtk/a11y/gtknotebookaccessible.c       |    4 +-
 gtk/a11y/gtknotebookaccessible.h       |    6 +-
 gtk/a11y/gtkpanedaccessible.c          |    2 +-
 gtk/a11y/gtkpanedaccessible.h          |    6 +-
 gtk/a11y/gtkscrolledwindowaccessible.c |    2 +-
 gtk/a11y/gtkscrolledwindowaccessible.h |    6 +-
 gtk/a11y/gtkstatusbaraccessible.c      |    2 +-
 gtk/a11y/gtksubmenuitemaccessible.c    |   22 ++--
 gtk/a11y/gtktextviewaccessible.c       |    2 +-
 gtk/a11y/gtktextviewaccessible.h       |   10 +-
 gtk/a11y/gtktreeviewaccessible.c       |    6 +-
 gtk/a11y/gtktreeviewaccessible.h       |    6 +-
 gtk/a11y/gtkwindowaccessible.c         |    2 +-
 gtk/a11y/gtkwindowaccessible.h         |    6 +-
 gtk/gtkcontainer.c                     |    4 +-
 gtk/gtkiconview.c                      |   30 +---
 tests/a11y/colorchooser.txt            |   80 +++++-----
 37 files changed, 392 insertions(+), 449 deletions(-)
---
diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am
index 031fb49..f960d43 100644
--- a/gtk/a11y/Makefile.am
+++ b/gtk/a11y/Makefile.am
@@ -13,7 +13,7 @@ gail_c_sources =			\
 	gtkcheckmenuitemaccessible.c	\
 	gtkchecksubmenuitemaccessible.c	\
 	gtkcomboboxaccessible.c		\
-	gailcontainer.c			\
+	gtkcontaineraccessible.c	\
 	gailcontainercell.c		\
 	gtkentryaccessible.c		\
 	gtkexpanderaccessible.c		\
@@ -64,8 +64,8 @@ gail_private_h_sources =		\
 	gtkcheckmenuitemaccessible.h	\
 	gtkchecksubmenuitemaccessible.h	\
 	gtkcomboboxaccessible.h		\
+	gtkcontaineraccessible.h	\
 	gailcontainercell.h		\
-	gailcontainer.h			\
 	gtkentryaccessible.h		\
 	gtkexpanderaccessible.h		\
 	gailfactory.h			\
diff --git a/gtk/a11y/gail.c b/gtk/a11y/gail.c
index 0011064..fcf09f7 100644
--- a/gtk/a11y/gail.c
+++ b/gtk/a11y/gail.c
@@ -25,7 +25,6 @@
 #include <gtk/gtkx.h>
 #include "gailbooleancell.h"
 #include "gailcell.h"
-#include "gailcontainer.h"
 #include "gailcontainercell.h"
 #include "gailimagecell.h"
 #include "gailrenderercell.h"
@@ -79,7 +78,6 @@ static guint focus_tracker_id = 0;
 static GQuark quark_focus_object = 0;
 
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
 GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
 GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
 GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
@@ -825,7 +823,6 @@ gail_accessibility_module_init (void)
     fprintf (stderr, "GTK Accessibility Module initialized\n");
 
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WIDGET, gail_widget);
-  GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CONTAINER, gail_container);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
diff --git a/gtk/a11y/gtkboxaccessible.c b/gtk/a11y/gtkboxaccessible.c
index 5352619..94aae41 100644
--- a/gtk/a11y/gtkboxaccessible.c
+++ b/gtk/a11y/gtkboxaccessible.c
@@ -22,7 +22,8 @@
 #include <gtk/gtk.h>
 #include "gtkboxaccessible.h"
 
-G_DEFINE_TYPE (GtkBoxAccessible, gtk_box_accessible, GAIL_TYPE_CONTAINER)
+
+G_DEFINE_TYPE (GtkBoxAccessible, gtk_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
 
 static void
 gtk_box_accessible_initialize (AtkObject *accessible,
diff --git a/gtk/a11y/gtkboxaccessible.h b/gtk/a11y/gtkboxaccessible.h
index 79598f5..ad0e7d4 100644
--- a/gtk/a11y/gtkboxaccessible.h
+++ b/gtk/a11y/gtkboxaccessible.h
@@ -20,28 +20,28 @@
 #ifndef __GTK_BOX_ACCESSIBLE_H__
 #define __GTK_BOX_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
-#define GTK_TYPE_BOX_ACCESSIBLE                         (gtk_box_accessible_get_type ())
-#define GTK_BOX_ACCESSIBLE(obj)                         (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessible))
-#define GTK_BOX_ACCESSIBLE_CLASS(klass)                       (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
-#define GTK_IS_BOX_ACCESSIBLE(obj)                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOX_ACCESSIBLE))
-#define GTK_IS_BOX_ACCESSIBLE_CLASS(klass)              (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX_ACCESSIBLE))
-#define GTK_BOX_ACCESSIBLE_GET_CLASS(obj)             (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
+#define GTK_TYPE_BOX_ACCESSIBLE            (gtk_box_accessible_get_type ())
+#define GTK_BOX_ACCESSIBLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessible))
+#define GTK_BOX_ACCESSIBLE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
+#define GTK_IS_BOX_ACCESSIBLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOX_ACCESSIBLE))
+#define GTK_IS_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX_ACCESSIBLE))
+#define GTK_BOX_ACCESSIBLE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
 
 typedef struct _GtkBoxAccessible      GtkBoxAccessible;
 typedef struct _GtkBoxAccessibleClass GtkBoxAccessibleClass;
 
 struct _GtkBoxAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkBoxAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_box_accessible_get_type (void);
diff --git a/gtk/a11y/gtkbuttonaccessible.c b/gtk/a11y/gtkbuttonaccessible.c
index 64b6d25..1be1137 100644
--- a/gtk/a11y/gtkbuttonaccessible.c
+++ b/gtk/a11y/gtkbuttonaccessible.c
@@ -28,7 +28,7 @@
 static void atk_action_interface_init (AtkActionIface *iface);
 static void atk_image_interface_init  (AtkImageIface  *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkButtonAccessible, gtk_button_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkButtonAccessible, gtk_button_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
 
@@ -226,7 +226,7 @@ static void
 gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass)
 {
   AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-  GailContainerClass *container_class = (GailContainerClass*)klass;
+  GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
   GailWidgetClass *widget_class = (GailWidgetClass*)klass;
 
   class->get_name = gtk_button_accessible_get_name;
diff --git a/gtk/a11y/gtkbuttonaccessible.h b/gtk/a11y/gtkbuttonaccessible.h
index 66986da..8142028 100644
--- a/gtk/a11y/gtkbuttonaccessible.h
+++ b/gtk/a11y/gtkbuttonaccessible.h
@@ -20,8 +20,7 @@
 #ifndef __GTK_BUTTON_ACCESSIBLE_H__
 #define __GTK_BUTTON_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
-#include "gailtextutil.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -37,12 +36,12 @@ typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass;
 
 struct _GtkButtonAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkButtonAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_button_accessible_get_type (void);
diff --git a/gtk/a11y/gtkcomboboxaccessible.c b/gtk/a11y/gtkcomboboxaccessible.c
index 0e3c3f7..58f8763 100644
--- a/gtk/a11y/gtkcomboboxaccessible.c
+++ b/gtk/a11y/gtkcomboboxaccessible.c
@@ -26,7 +26,7 @@
 static void atk_action_interface_init    (AtkActionIface    *iface);
 static void atk_selection_interface_init (AtkSelectionIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkComboBoxAccessible, gtk_combo_box_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkComboBoxAccessible, gtk_combo_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
 
diff --git a/gtk/a11y/gtkcomboboxaccessible.h b/gtk/a11y/gtkcomboboxaccessible.h
index d422805..bb1142d 100644
--- a/gtk/a11y/gtkcomboboxaccessible.h
+++ b/gtk/a11y/gtkcomboboxaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_COMBO_BOX_ACCESSIBLE_H__
 #define __GTK_COMBO_BOX_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,7 +36,7 @@ typedef struct _GtkComboBoxAccessibleClass GtkComboBoxAccessibleClass;
 
 struct _GtkComboBoxAccessible
 {
-  GailContainer  parent;
+  GtkContainerAccessible parent;
 
   gchar         *name;
   gint           old_selection;
@@ -45,7 +45,7 @@ struct _GtkComboBoxAccessible
 
 struct _GtkComboBoxAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_combo_box_accessible_get_type (void);
diff --git a/gtk/a11y/gtkcontaineraccessible.c b/gtk/a11y/gtkcontaineraccessible.c
new file mode 100644
index 0000000..ad475a4
--- /dev/null
+++ b/gtk/a11y/gtkcontaineraccessible.c
@@ -0,0 +1,202 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include "gtkcontaineraccessible.h"
+
+
+G_DEFINE_TYPE (GtkContainerAccessible, gtk_container_accessible, GAIL_TYPE_WIDGET)
+
+static void
+gtk_container_accessible_init (GtkContainerAccessible *container)
+{
+}
+
+static gint
+gtk_container_accessible_get_n_children (AtkObject* obj)
+{
+  GtkWidget *widget;
+  GList *children;
+  gint count = 0;
+
+  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
+  if (widget == NULL)
+    return 0;
+
+  children = gtk_container_get_children (GTK_CONTAINER(widget));
+  count = g_list_length (children);
+  g_list_free (children);
+
+  return count;
+}
+
+static AtkObject *
+gtk_container_accessible_ref_child (AtkObject *obj,
+                                    gint       i)
+{
+  GList *children, *tmp_list;
+  AtkObject  *accessible;
+  GtkWidget *widget;
+
+  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
+  if (widget == NULL)
+    return NULL;
+
+  children = gtk_container_get_children (GTK_CONTAINER (widget));
+  tmp_list = g_list_nth (children, i);
+  if (!tmp_list)
+    {
+      g_list_free (children);
+      return NULL;
+    }
+  accessible = gtk_widget_get_accessible (GTK_WIDGET (tmp_list->data));
+
+  g_list_free (children);
+  g_object_ref (accessible);
+
+  return accessible;
+}
+
+static gint
+gtk_container_accessible_add_gtk (GtkContainer *container,
+                                  GtkWidget    *widget,
+                                  gpointer      data)
+{
+  GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (data);
+  GtkContainerAccessibleClass *klass;
+
+  klass = GTK_CONTAINER_ACCESSIBLE_GET_CLASS (accessible);
+
+  if (klass->add_gtk)
+    return klass->add_gtk (container, widget, data);
+  else
+    return 1;
+}
+ 
+static gint
+gtk_container_accessible_remove_gtk (GtkContainer *container,
+                           GtkWidget    *widget,
+                           gpointer     data)
+{
+  GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (data);
+  GtkContainerAccessibleClass *klass;
+
+  klass = GTK_CONTAINER_ACCESSIBLE_GET_CLASS (accessible);
+
+  if (klass->remove_gtk)
+    return klass->remove_gtk (container, widget, data);
+  else
+    return 1;
+}
+
+static gint
+gtk_container_accessible_real_add_gtk (GtkContainer *container,
+                                       GtkWidget    *widget,
+                                       gpointer      data)
+{
+  AtkObject *atk_parent;
+  AtkObject *atk_child;
+  GtkContainerAccessible *accessible;
+  gint index;
+
+  atk_parent = ATK_OBJECT (data);
+  atk_child = gtk_widget_get_accessible (widget);
+  accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
+
+  g_object_notify (G_OBJECT (atk_child), "accessible_parent");
+  g_list_free (accessible->children);
+  accessible->children = gtk_container_get_children (container);
+  index = g_list_index (accessible->children, widget);
+  g_signal_emit_by_name (atk_parent, "children_changed::add", index, atk_child, NULL);
+
+  return 1;
+}
+
+static gint
+gtk_container_accessible_real_remove_gtk (GtkContainer *container,
+                                          GtkWidget    *widget,
+                                          gpointer      data)
+{
+  AtkObject* atk_parent;
+  AtkObject *atk_child;
+  GtkContainerAccessible *accessible;
+  gint index;
+
+  atk_parent = ATK_OBJECT (data);
+  atk_child = gtk_widget_get_accessible (widget);
+  accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
+
+  g_object_notify (G_OBJECT (atk_child), "accessible_parent");
+  index = g_list_index (accessible->children, widget);
+  g_list_free (accessible->children);
+  accessible->children = gtk_container_get_children (container);
+  if (index >= 0 && index <= g_list_length (accessible->children))
+    g_signal_emit_by_name (atk_parent, "children_changed::remove", index, atk_child, NULL);
+
+  return 1;
+}
+
+static void
+gtk_container_accessible_real_initialize (AtkObject *obj,
+                                          gpointer   data)
+{
+  GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (obj);
+
+  ATK_OBJECT_CLASS (gtk_container_accessible_parent_class)->initialize (obj, data);
+
+  accessible->children = gtk_container_get_children (GTK_CONTAINER (data));
+
+  g_signal_connect (data, "add", G_CALLBACK (gtk_container_accessible_add_gtk), obj);
+  g_signal_connect (data, "remove", G_CALLBACK (gtk_container_accessible_remove_gtk), obj);
+
+  if (GTK_IS_TOOLBAR (data))
+    obj->role = ATK_ROLE_TOOL_BAR;
+  else if (GTK_IS_VIEWPORT (data))
+    obj->role = ATK_ROLE_VIEWPORT;
+  else
+    obj->role = ATK_ROLE_PANEL;
+}
+
+static void
+gtk_container_accessible_finalize (GObject *object)
+{
+  GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (object);
+
+  g_list_free (accessible->children);
+
+  G_OBJECT_CLASS (gtk_container_accessible_parent_class)->finalize (object);
+}
+
+static void
+gtk_container_accessible_class_init (GtkContainerAccessibleClass *klass)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+  gobject_class->finalize = gtk_container_accessible_finalize;
+
+  class->get_n_children = gtk_container_accessible_get_n_children;
+  class->ref_child = gtk_container_accessible_ref_child;
+  class->initialize = gtk_container_accessible_real_initialize;
+
+  klass->add_gtk = gtk_container_accessible_real_add_gtk;
+  klass->remove_gtk = gtk_container_accessible_real_remove_gtk;
+}
diff --git a/gtk/a11y/gtkcontaineraccessible.h b/gtk/a11y/gtkcontaineraccessible.h
new file mode 100644
index 0000000..1e60c6d
--- /dev/null
+++ b/gtk/a11y/gtkcontaineraccessible.h
@@ -0,0 +1,60 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_CONTAINER_ACCESSIBLE_H__
+#define __GTK_CONTAINER_ACCESSIBLE_H__
+
+#include "gailwidget.h"
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_CONTAINER_ACCESSIBLE                  (gtk_container_accessible_get_type ())
+#define GTK_CONTAINER_ACCESSIBLE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER_ACCESSIBLE, GtkContainerAccessible))
+#define GTK_CONTAINER_ACCESSIBLE_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CONTAINER_ACCESSIBLE, GtkContainerAccessibleClass))
+#define GTK_IS_CONTAINER_ACCESSIBLE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CONTAINER_ACCESSIBLE))
+#define GTK_IS_CONTAINER_ACCESSIBLE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_ACCESSIBLE))
+#define GTK_CONTAINER_ACCESSIBLE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_ACCESSIBLE, GtkContainerAccessibleClass))
+
+typedef struct _GtkContainerAccessible      GtkContainerAccessible;
+typedef struct _GtkContainerAccessibleClass GtkContainerAccessibleClass;
+
+struct _GtkContainerAccessible
+{
+  GailWidget parent;
+
+  GList *children;
+};
+
+struct _GtkContainerAccessibleClass
+{
+  GailWidgetClass parent_class;
+
+  gint (*add_gtk)    (GtkContainer *container,
+                      GtkWidget    *widget,
+                      gpointer     data);
+  gint (*remove_gtk) (GtkContainer *container,
+                      GtkWidget    *widget,
+                      gpointer     data);
+};
+
+GType gtk_container_accessible_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GTK_CONTAINER_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkexpanderaccessible.c b/gtk/a11y/gtkexpanderaccessible.c
index 3ad5bd2..10510f1 100644
--- a/gtk/a11y/gtkexpanderaccessible.c
+++ b/gtk/a11y/gtkexpanderaccessible.c
@@ -25,7 +25,7 @@
 
 static void atk_action_interface_init (AtkActionIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkExpanderAccessible, gtk_expander_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkExpanderAccessible, gtk_expander_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
 
 static const gchar *
diff --git a/gtk/a11y/gtkexpanderaccessible.h b/gtk/a11y/gtkexpanderaccessible.h
index 986a9b3..27e2433 100644
--- a/gtk/a11y/gtkexpanderaccessible.h
+++ b/gtk/a11y/gtkexpanderaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_EXPANDER_ACCESSIBLE_H__
 #define __GTK_EXPANDER_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkExpanderAccessibleClass GtkExpanderAccessibleClass;
 
 struct _GtkExpanderAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkExpanderAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_expander_accessible_get_type (void);
diff --git a/gtk/a11y/gtkframeaccessible.c b/gtk/a11y/gtkframeaccessible.c
index 964ddb9..03d4f27 100644
--- a/gtk/a11y/gtkframeaccessible.c
+++ b/gtk/a11y/gtkframeaccessible.c
@@ -24,7 +24,7 @@
 #include "gtkframeaccessible.h"
 
 
-G_DEFINE_TYPE (GtkFrameAccessible, gtk_frame_accessible, GAIL_TYPE_CONTAINER)
+G_DEFINE_TYPE (GtkFrameAccessible, gtk_frame_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
 
 static void
 gtk_frame_accessible_initialize (AtkObject *accessible,
diff --git a/gtk/a11y/gtkframeaccessible.h b/gtk/a11y/gtkframeaccessible.h
index 02e638e..78df072 100644
--- a/gtk/a11y/gtkframeaccessible.h
+++ b/gtk/a11y/gtkframeaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_FRAME_ACCESSIBLE_H__
 #define __GTK_FRAME_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
 
 struct _GtkFrameAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkFrameAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_frame_accessible_get_type (void);
diff --git a/gtk/a11y/gtkmenuitemaccessible.c b/gtk/a11y/gtkmenuitemaccessible.c
index 3f8d908..e0eb01a 100644
--- a/gtk/a11y/gtkmenuitemaccessible.c
+++ b/gtk/a11y/gtkmenuitemaccessible.c
@@ -33,7 +33,7 @@ static gchar     *get_text_from_label_widget (GtkWidget *widget);
 
 static void atk_action_interface_init (AtkActionIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkMenuItemAccessible, gtk_menu_item_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkMenuItemAccessible, gtk_menu_item_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
 
 static void
diff --git a/gtk/a11y/gtkmenuitemaccessible.h b/gtk/a11y/gtkmenuitemaccessible.h
index 88470da..2c13048 100644
--- a/gtk/a11y/gtkmenuitemaccessible.h
+++ b/gtk/a11y/gtkmenuitemaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_MENU_ITEM_ACCESSIBLE_H__
 #define __GTK_MENU_ITEM_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,14 +36,14 @@ typedef struct _GtkMenuItemAccessibleClass GtkMenuItemAccessibleClass;
 
 struct _GtkMenuItemAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 
   gchar *text;
 };
 
 struct _GtkMenuItemAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_menu_item_accessible_get_type (void);
diff --git a/gtk/a11y/gtkmenushellaccessible.c b/gtk/a11y/gtkmenushellaccessible.c
index 1381523..ba11ddc 100644
--- a/gtk/a11y/gtkmenushellaccessible.c
+++ b/gtk/a11y/gtkmenushellaccessible.c
@@ -25,7 +25,7 @@
 
 static void atk_selection_interface_init (AtkSelectionIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkMenuShellAccessible, gtk_menu_shell_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkMenuShellAccessible, gtk_menu_shell_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
 
 static void
diff --git a/gtk/a11y/gtkmenushellaccessible.h b/gtk/a11y/gtkmenushellaccessible.h
index 265b74e..b5392e9 100644
--- a/gtk/a11y/gtkmenushellaccessible.h
+++ b/gtk/a11y/gtkmenushellaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_MENU_SHELL_ACCESSIBLE_H__
 #define __GTK_MENU_SHELL_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkMenuShellAccessibleClass GtkMenuShellAccessibleClass;
 
 struct _GtkMenuShellAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkMenuShellAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_menu_shell_accessible_get_type (void);
diff --git a/gtk/a11y/gtknotebookaccessible.c b/gtk/a11y/gtknotebookaccessible.c
index 6a3eae7..0668e00 100644
--- a/gtk/a11y/gtknotebookaccessible.c
+++ b/gtk/a11y/gtknotebookaccessible.c
@@ -27,7 +27,7 @@
 
 static void atk_selection_interface_init (AtkSelectionIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkNotebookAccessible, gtk_notebook_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkNotebookAccessible, gtk_notebook_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
 
 static gboolean
@@ -310,7 +310,7 @@ gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
   GailWidgetClass *widget_class = (GailWidgetClass*)klass;
-  GailContainerClass *container_class = (GailContainerClass*)klass;
+  GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
 
 
   gobject_class->finalize = gtk_notebook_accessible_finalize;
diff --git a/gtk/a11y/gtknotebookaccessible.h b/gtk/a11y/gtknotebookaccessible.h
index 770c12b..1164bb7 100644
--- a/gtk/a11y/gtknotebookaccessible.h
+++ b/gtk/a11y/gtknotebookaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_NOTEBOOK_ACCESSIBLE_H__
 #define __GTK_NOTEBOOK_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,7 +36,7 @@ typedef struct _GtkNotebookAccessibleClass GtkNotebookAccessibleClass;
 
 struct _GtkNotebookAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 
   /*
    * page_cache maintains a list of pre-ref'd Notebook Pages.
@@ -52,7 +52,7 @@ struct _GtkNotebookAccessible
 
 struct _GtkNotebookAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_notebook_accessible_get_type (void);
diff --git a/gtk/a11y/gtkpanedaccessible.c b/gtk/a11y/gtkpanedaccessible.c
index 9390870..40704fd 100644
--- a/gtk/a11y/gtkpanedaccessible.c
+++ b/gtk/a11y/gtkpanedaccessible.c
@@ -25,7 +25,7 @@
 
 static void atk_value_interface_init (AtkValueIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkPanedAccessible, gtk_paned_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkPanedAccessible, gtk_paned_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
 
 static void
diff --git a/gtk/a11y/gtkpanedaccessible.h b/gtk/a11y/gtkpanedaccessible.h
index e255ec2..5b73e3e 100644
--- a/gtk/a11y/gtkpanedaccessible.h
+++ b/gtk/a11y/gtkpanedaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_PANED_ACCESSIBLE_H__
 #define __GTK_PANED_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkPanedAccessibleClass GtkPanedAccessibleClass;
 
 struct _GtkPanedAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkPanedAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_paned_accessible_get_type (void);
diff --git a/gtk/a11y/gtkscrolledwindowaccessible.c b/gtk/a11y/gtkscrolledwindowaccessible.c
index 7cd4ab6..d094909 100644
--- a/gtk/a11y/gtkscrolledwindowaccessible.c
+++ b/gtk/a11y/gtkscrolledwindowaccessible.c
@@ -24,7 +24,7 @@
 #include "gtkscrolledwindowaccessible.h"
 
 
-G_DEFINE_TYPE (GtkScrolledWindowAccessible, gtk_scrolled_window_accessible, GAIL_TYPE_CONTAINER)
+G_DEFINE_TYPE (GtkScrolledWindowAccessible, gtk_scrolled_window_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
 
 static void
 visibility_changed (GObject    *object,
diff --git a/gtk/a11y/gtkscrolledwindowaccessible.h b/gtk/a11y/gtkscrolledwindowaccessible.h
index c3f1ac5..139c99d 100644
--- a/gtk/a11y/gtkscrolledwindowaccessible.h
+++ b/gtk/a11y/gtkscrolledwindowaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_SCROLLED_WINDOW_ACCESSIBLE_H__
 #define __GTK_SCROLLED_WINDOW_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkScrolledWindowAccessibleClass GtkScrolledWindowAccessibleClas
 
 struct _GtkScrolledWindowAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkScrolledWindowAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_scrolled_window_accessible_get_type (void);
diff --git a/gtk/a11y/gtkstatusbaraccessible.c b/gtk/a11y/gtkstatusbaraccessible.c
index 404b1fa..4d92c0d 100644
--- a/gtk/a11y/gtkstatusbaraccessible.c
+++ b/gtk/a11y/gtkstatusbaraccessible.c
@@ -130,7 +130,7 @@ static void
 gtk_statusbar_accessible_class_init (GtkStatusbarAccessibleClass *klass)
 {
   AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
-  GailContainerClass *container_class = (GailContainerClass*)klass;
+  GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
 
   class->get_name = gtk_statusbar_accessible_get_name;
   class->get_n_children = gtk_statusbar_accessible_get_n_children;
diff --git a/gtk/a11y/gtksubmenuitemaccessible.c b/gtk/a11y/gtksubmenuitemaccessible.c
index cf879eb..f9a0453 100644
--- a/gtk/a11y/gtksubmenuitemaccessible.c
+++ b/gtk/a11y/gtksubmenuitemaccessible.c
@@ -242,7 +242,7 @@ menu_item_add_gtk (GtkContainer *container,
   GtkWidget *parent_widget;
   AtkObject *atk_parent;
   AtkObject *atk_child;
-  GailContainer *gail_container;
+  GtkContainerAccessible *container_accessible;
   gint index;
 
   g_return_val_if_fail (GTK_IS_MENU (container), 1);
@@ -254,10 +254,10 @@ menu_item_add_gtk (GtkContainer *container,
       atk_child = gtk_widget_get_accessible (widget);
 
       g_object_notify (G_OBJECT (atk_child), "accessible-parent");
-      gail_container = GAIL_CONTAINER (atk_parent);
-      g_list_free (gail_container->children);
-      gail_container->children = gtk_container_get_children (container);
-      index = g_list_index (gail_container->children, widget);
+      container_accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
+      g_list_free (container_accessible->children);
+      container_accessible->children = gtk_container_get_children (container);
+      index = g_list_index (container_accessible->children, widget);
       g_signal_emit_by_name (atk_parent, "children_changed::add",
                              index, atk_child, NULL);
     }
@@ -271,7 +271,7 @@ menu_item_remove_gtk (GtkContainer *container,
   GtkWidget *parent_widget;
   AtkObject *atk_parent;
   AtkObject *atk_child;
-  GailContainer *gail_container;
+  GtkContainerAccessible *container_accessible;
   gint index;
   gint list_length;
 
@@ -285,11 +285,11 @@ menu_item_remove_gtk (GtkContainer *container,
 
       g_object_notify (G_OBJECT (atk_child), "accessible-parent");
 
-      gail_container = GAIL_CONTAINER (atk_parent);
-      index = g_list_index (gail_container->children, widget);
-      list_length = g_list_length (gail_container->children);
-      g_list_free (gail_container->children);
-      gail_container->children = gtk_container_get_children (container);
+      container_accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
+      index = g_list_index (container_accessible->children, widget);
+      list_length = g_list_length (container_accessible->children);
+      g_list_free (container_accessible->children);
+      container_accessible->children = gtk_container_get_children (container);
       if (index >= 0 && index <= list_length)
         g_signal_emit_by_name (atk_parent, "children_changed::remove",
                                index, atk_child, NULL);
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
index 7789fcd..f98021b 100644
--- a/gtk/a11y/gtktextviewaccessible.c
+++ b/gtk/a11y/gtktextviewaccessible.c
@@ -53,7 +53,7 @@ static void atk_editable_text_interface_init      (AtkEditableTextIface      *if
 static void atk_text_interface_init               (AtkTextIface              *iface);
 static void atk_streamable_content_interface_init (AtkStreamableContentIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkTextViewAccessible, gtk_text_view_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkTextViewAccessible, gtk_text_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          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))
diff --git a/gtk/a11y/gtktextviewaccessible.h b/gtk/a11y/gtktextviewaccessible.h
index 9e0dd60..3f69fad 100644
--- a/gtk/a11y/gtktextviewaccessible.h
+++ b/gtk/a11y/gtktextviewaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_TEXT_VIEW_ACCESSIBLE_H__
 #define __GTK_TEXT_VIEW_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -31,12 +31,12 @@ G_BEGIN_DECLS
 #define GTK_IS_TEXT_VIEW_ACCESSIBLE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_VIEW_ACCESSIBLE))
 #define GTK_TEXT_VIEW_ACCESSIBLE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_VIEW_ACCESSIBLE, GtkTextViewAccessibleClass))
 
-typedef struct _GtkTextViewAccessible              GtkTextViewAccessible;
-typedef struct _GtkTextViewAccessibleClass         GtkTextViewAccessibleClass;
+typedef struct _GtkTextViewAccessible      GtkTextViewAccessible;
+typedef struct _GtkTextViewAccessibleClass GtkTextViewAccessibleClass;
 
 struct _GtkTextViewAccessible
 {
-  GailContainer  parent;
+  GtkContainerAccessible parent;
 
   gint           previous_insert_offset;
   gint           previous_selection_bound;
@@ -52,7 +52,7 @@ struct _GtkTextViewAccessible
 
 struct _GtkTextViewAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_text_view_accessible_get_type (void);
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 09e3e57..86ef72e 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -160,7 +160,7 @@ static void atk_selection_interface_init    (AtkSelectionIface   *iface);
 static void atk_component_interface_init    (AtkComponentIface   *iface);
 static void gail_cell_parent_interface_init (GailCellParentIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkTreeViewAccessible, gtk_tree_view_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkTreeViewAccessible, gtk_tree_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          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)
@@ -724,11 +724,11 @@ gtk_tree_view_accessible_class_init (GtkTreeViewAccessibleClass *klass)
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   GtkAccessibleClass *accessible_class;
   GailWidgetClass *widget_class;
-  GailContainerClass *container_class;
+  GtkContainerAccessibleClass *container_class;
 
   accessible_class = (GtkAccessibleClass*)klass;
   widget_class = (GailWidgetClass*)klass;
-  container_class = (GailContainerClass*)klass;
+  container_class = (GtkContainerAccessibleClass*)klass;
 
   class->get_n_children = gtk_tree_view_accessible_get_n_children;
   class->ref_child = gtk_tree_view_accessible_ref_child;
diff --git a/gtk/a11y/gtktreeviewaccessible.h b/gtk/a11y/gtktreeviewaccessible.h
index 698a83b..64d9d6e 100644
--- a/gtk/a11y/gtktreeviewaccessible.h
+++ b/gtk/a11y/gtktreeviewaccessible.h
@@ -21,7 +21,7 @@
 #define __GTK_TREE_VIEW_ACCESSIBLE_H__
 
 #include <gtk/gtk.h>
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 #include "gailcell.h"
 
 G_BEGIN_DECLS
@@ -38,7 +38,7 @@ typedef struct _GtkTreeViewAccessibleClass GtkTreeViewAccessibleClass;
 
 struct _GtkTreeViewAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 
   gint           n_children_deleted;
   gint           n_rows;
@@ -58,7 +58,7 @@ struct _GtkTreeViewAccessible
 
 struct _GtkTreeViewAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType      gtk_tree_view_accessible_get_type       (void);
diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c
index f07d35f..e421093 100644
--- a/gtk/a11y/gtkwindowaccessible.c
+++ b/gtk/a11y/gtkwindowaccessible.c
@@ -56,7 +56,7 @@ static guint gtk_window_accessible_signals [LAST_SIGNAL] = { 0, };
 
 static void atk_component_interface_init (AtkComponentIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkWindowAccessible, gtk_window_accessible, GAIL_TYPE_CONTAINER,
+G_DEFINE_TYPE_WITH_CODE (GtkWindowAccessible, gtk_window_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
 
 
diff --git a/gtk/a11y/gtkwindowaccessible.h b/gtk/a11y/gtkwindowaccessible.h
index ee9cb82..5c781b3 100644
--- a/gtk/a11y/gtkwindowaccessible.h
+++ b/gtk/a11y/gtkwindowaccessible.h
@@ -20,7 +20,7 @@
 #ifndef __GTK_WINDOW_ACCESSIBLE_H__
 #define __GTK_WINDOW_ACCESSIBLE_H__
 
-#include "gailcontainer.h"
+#include "gtkcontaineraccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkWindowAccessibleClass GtkWindowAccessibleClass;
 
 struct _GtkWindowAccessible
 {
-  GailContainer parent;
+  GtkContainerAccessible parent;
 };
 
 struct _GtkWindowAccessibleClass
 {
-  GailContainerClass parent_class;
+  GtkContainerAccessibleClass parent_class;
 };
 
 GType gtk_window_accessible_get_type (void);
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 66e7a0c..e9ddd0f 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -47,7 +47,7 @@
 #include "gtkwindow.h"
 #include "gtkintl.h"
 #include "gtktoolbar.h"
-
+#include "a11y/gtkcontaineraccessible.h"
 
 /**
  * SECTION:gtkcontainer
@@ -512,6 +512,8 @@ gtk_container_class_init (GtkContainerClass *class)
                   GTK_TYPE_WIDGET);
 
   g_type_class_add_private (class, sizeof (GtkContainerPrivate));
+
+  gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_CONTAINER_ACCESSIBLE);
 }
 
 static void
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index b395f43..3dd5d37 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -47,6 +47,7 @@
 #include "gtktreednd.h"
 #include "gtktypebuiltins.h"
 #include "gtkprivate.h"
+#include "a11y/gtkcontaineraccessible.h"
 
 /**
  * SECTION:gtkiconview
@@ -447,6 +448,7 @@ static void     gtk_icon_view_buildable_custom_tag_end   (GtkBuildable  *buildab
 							  GObject       *child,
 							  const gchar   *tagname,
 							  gpointer      *data);
+static GType    gtk_icon_view_accessible_get_type        (void);
 
 static guint icon_view_signals[LAST_SIGNAL] = { 0 };
 
@@ -1046,6 +1048,8 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
 				  GTK_MOVEMENT_VISUAL_POSITIONS, 1);
   gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Left, 0, 
 				  GTK_MOVEMENT_VISUAL_POSITIONS, -1);
+
+  gtk_widget_class_set_accessible_type (widget_class, gtk_icon_view_accessible_get_type ());
 }
 
 static void
@@ -9216,13 +9220,13 @@ gtk_icon_view_accessible_get_type (void)
     {
       GTypeInfo tinfo =
       {
-        0, /* class size */
+        sizeof (GtkContainerAccessibleClass), /* class size */
         (GBaseInitFunc) NULL, /* base init */
         (GBaseFinalizeFunc) NULL, /* base finalize */
         (GClassInitFunc) gtk_icon_view_accessible_class_init,
         (GClassFinalizeFunc) NULL, /* class finalize */
         NULL, /* class data */
-        0, /* instance size */
+        sizeof (GtkContainerAccessible), /* instance size */
         0, /* nb preallocs */
         (GInstanceInitFunc) NULL, /* instance init */
         NULL /* value table */
@@ -9240,26 +9244,8 @@ gtk_icon_view_accessible_get_type (void)
         NULL
       };
 
-      /*
-       * Figure out the size of the class and instance
-       * we are deriving from
-       */
-      AtkObjectFactory *factory;
-      GType derived_type;
-      GTypeQuery query;
-      GType derived_atk_type;
-
-      derived_type = g_type_parent (GTK_TYPE_ICON_VIEW);
-      factory = atk_registry_get_factory (atk_get_default_registry (), 
-                                          derived_type);
-      derived_atk_type = atk_object_factory_get_accessible_type (factory);
-      g_type_query (derived_atk_type, &query);
-      tinfo.class_size = query.class_size;
-      tinfo.instance_size = query.instance_size;
- 
-      type = g_type_register_static (derived_atk_type, 
-                                     I_("GtkIconViewAccessible"), 
-                                     &tinfo, 0);
+      type = g_type_register_static (GTK_TYPE_CONTAINER_ACCESSIBLE,
+                                     I_("GtkIconViewAccessible"), &tinfo, 0);
       g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
                                    &atk_component_info);
       g_type_add_interface_static (type, ATK_TYPE_SELECTION,
diff --git a/tests/a11y/colorchooser.txt b/tests/a11y/colorchooser.txt
index 84c82ab..b445584 100644
--- a/tests/a11y/colorchooser.txt
+++ b/tests/a11y/colorchooser.txt
@@ -126,7 +126,7 @@ window1
           <AtkComponent>
           layer: widget
           alpha: 1
-          unnamed-GailContainer-12
+          unnamed-GtkContainerAccessible-12
             "panel"
             parent: unnamed-GtkBoxAccessible-11
             index: 0
@@ -137,7 +137,7 @@ window1
             alpha: 1
             #FFFFFF
               "text"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 0
               description: You can enter an HTML-style hexadecimal color value, or simply a color name such as 'orange' in this entry.
               labelled-by: Color name:
@@ -180,7 +180,7 @@ window1
               action 0 keybinding: <Alt>n
             Color name:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 1
               name: Color name:
               label-for: #FFFFFF
@@ -220,7 +220,7 @@ window1
                                   wrap-mode: word
             255
               "text"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 2
               description: Transparency of the color.
               state: editable enabled focusable sensitive single-line
@@ -261,7 +261,7 @@ window1
               action 0 name: activate
             unnamed-GtkScaleAccessible-13
               "slider"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 3
               description: Transparency of the color.
               labelled-by: Opacity:
@@ -280,7 +280,7 @@ window1
               minimum increment: 1.000000
             Opacity:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 4
               name: Opacity:
               label-for: unnamed-GtkScaleAccessible-13
@@ -320,7 +320,7 @@ window1
                                   wrap-mode: word
             unnamed-GailWidget-14
               "separator"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 5
               state: enabled horizontal sensitive showing visible
               toolkit: gail
@@ -329,7 +329,7 @@ window1
               alpha: 1
             255
               "spin button"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 6
               description: Amount of blue light in the color.
               controller-for: unnamed-GailWidget-4
@@ -378,7 +378,7 @@ window1
               minimum increment: 1.000000
             Blue:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 7
               name: Blue:
               label-for: 255
@@ -418,7 +418,7 @@ window1
                                   wrap-mode: word
             255
               "spin button"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 8
               description: Amount of green light in the color.
               controller-for: unnamed-GailWidget-4
@@ -467,7 +467,7 @@ window1
               minimum increment: 1.000000
             Green:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 9
               name: Green:
               label-for: 255
@@ -507,7 +507,7 @@ window1
                                   wrap-mode: word
             255
               "spin button"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 10
               description: Amount of red light in the color.
               controller-for: unnamed-GailWidget-4
@@ -556,7 +556,7 @@ window1
               minimum increment: 1.000000
             Red:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 11
               name: Red:
               label-for: 255
@@ -596,7 +596,7 @@ window1
                                   wrap-mode: word
             100
               "spin button"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 12
               description: Brightness of the color.
               controller-for: unnamed-GailWidget-4
@@ -645,7 +645,7 @@ window1
               minimum increment: 1.000000
             Value:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 13
               name: Value:
               label-for: 100
@@ -685,7 +685,7 @@ window1
                                   wrap-mode: word
             0
               "spin button"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 14
               description: Intensity of the color.
               controller-for: unnamed-GailWidget-4
@@ -734,7 +734,7 @@ window1
               minimum increment: 1.000000
             Saturation:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 15
               name: Saturation:
               label-for: 0
@@ -774,7 +774,7 @@ window1
                                   wrap-mode: word
             0
               "spin button"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 16
               description: Position on the color wheel.
               controller-for: unnamed-GailWidget-4
@@ -823,7 +823,7 @@ window1
               minimum increment: 1.000000
             Hue:
               "label"
-              parent: unnamed-GailContainer-12
+              parent: unnamed-GtkContainerAccessible-12
               index: 17
               name: Hue:
               label-for: 0
@@ -910,7 +910,7 @@ window1
                                   variant: <omitted>
                                   weight: <omitted>
                                   wrap-mode: word
-            unnamed-GailContainer-17
+            unnamed-GtkContainerAccessible-17
               "panel"
               parent: unnamed-GtkBoxAccessible-15
               index: 1
@@ -921,7 +921,7 @@ window1
               alpha: 1
               unnamed-GtkFrameAccessible-18
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 0
                 state: enabled sensitive visible
                 toolkit: gail
@@ -940,7 +940,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-20
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 1
                 state: enabled sensitive visible
                 toolkit: gail
@@ -959,7 +959,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-22
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 2
                 state: enabled sensitive visible
                 toolkit: gail
@@ -978,7 +978,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-24
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 3
                 state: enabled sensitive visible
                 toolkit: gail
@@ -997,7 +997,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-26
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 4
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1016,7 +1016,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-28
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 5
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1035,7 +1035,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-30
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 6
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1054,7 +1054,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-32
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 7
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1073,7 +1073,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-34
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 8
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1092,7 +1092,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-36
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 9
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1111,7 +1111,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-38
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 10
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1130,7 +1130,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-40
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 11
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1149,7 +1149,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-42
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 12
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1168,7 +1168,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-44
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 13
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1187,7 +1187,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-46
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 14
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1206,7 +1206,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-48
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 15
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1225,7 +1225,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-50
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 16
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1244,7 +1244,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-52
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 17
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1263,7 +1263,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-54
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 18
                 state: enabled sensitive visible
                 toolkit: gail
@@ -1282,7 +1282,7 @@ window1
                   alpha: 1
               unnamed-GtkFrameAccessible-56
                 "panel"
-                parent: unnamed-GailContainer-17
+                parent: unnamed-GtkContainerAccessible-17
                 index: 19
                 state: enabled sensitive visible
                 toolkit: gail



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