X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fa11y%2Fgtkcontaineraccessible.c;h=ccf075c17b5ed4d984f2e426ddb35d495e1b05a3;hb=0795237bb2ef7d7381bf5686ddd0d7fee70e9181;hp=423cdf43edb341ce8b96fba19b54364cc7b70db4;hpb=9d0febc9a64a5bfb0fcfc3a88de4757f6c1ff090;p=~andy%2Fgtk diff --git a/gtk/a11y/gtkcontaineraccessible.c b/gtk/a11y/gtkcontaineraccessible.c index 423cdf43e..ccf075c17 100644 --- a/gtk/a11y/gtkcontaineraccessible.c +++ b/gtk/a11y/gtkcontaineraccessible.c @@ -1,4 +1,4 @@ -/* GAIL - The GNOME Accessibility Implementation Library +/* GTK+ - accessibility implementations * Copyright 2001, 2002, 2003 Sun Microsystems Inc. * * This library is free software; you can redistribute it and/or @@ -20,8 +20,12 @@ #include #include "gtkcontaineraccessible.h" +struct _GtkContainerAccessiblePrivate +{ + GList *children; +}; -G_DEFINE_TYPE (GtkContainerAccessible, _gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE) +G_DEFINE_TYPE (GtkContainerAccessible, gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE) static gint gtk_container_accessible_get_n_children (AtkObject* obj) @@ -34,7 +38,7 @@ gtk_container_accessible_get_n_children (AtkObject* obj) if (widget == NULL) return 0; - children = gtk_container_get_children (GTK_CONTAINER(widget)); + children = gtk_container_get_children (GTK_CONTAINER (widget)); count = g_list_length (children); g_list_free (children); @@ -115,9 +119,9 @@ gtk_container_accessible_real_add_gtk (GtkContainer *container, 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_list_free (accessible->priv->children); + accessible->priv->children = gtk_container_get_children (container); + index = g_list_index (accessible->priv->children, widget); g_signal_emit_by_name (atk_parent, "children-changed::add", index, atk_child, NULL); return 1; @@ -140,10 +144,10 @@ gtk_container_accessible_real_remove_gtk (GtkContainer *container, 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)) + index = g_list_index (accessible->priv->children, widget); + g_list_free (accessible->priv->children); + accessible->priv->children = gtk_container_get_children (container); + if (index >= 0 && index <= g_list_length (accessible->priv->children)) g_signal_emit_by_name (atk_parent, "children-changed::remove", index, atk_child, NULL); return 1; @@ -155,9 +159,9 @@ gtk_container_accessible_real_initialize (AtkObject *obj, { GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (obj); - ATK_OBJECT_CLASS (_gtk_container_accessible_parent_class)->initialize (obj, data); + ATK_OBJECT_CLASS (gtk_container_accessible_parent_class)->initialize (obj, data); - accessible->children = gtk_container_get_children (GTK_CONTAINER (data)); + accessible->priv->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); @@ -170,13 +174,13 @@ gtk_container_accessible_finalize (GObject *object) { GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (object); - g_list_free (accessible->children); + g_list_free (accessible->priv->children); - G_OBJECT_CLASS (_gtk_container_accessible_parent_class)->finalize (object); + G_OBJECT_CLASS (gtk_container_accessible_parent_class)->finalize (object); } static void -_gtk_container_accessible_class_init (GtkContainerAccessibleClass *klass) +gtk_container_accessible_class_init (GtkContainerAccessibleClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); AtkObjectClass *class = ATK_OBJECT_CLASS (klass); @@ -189,10 +193,14 @@ _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) +gtk_container_accessible_init (GtkContainerAccessible *container) { + container->priv = G_TYPE_INSTANCE_GET_PRIVATE (container, + GTK_TYPE_CONTAINER_ACCESSIBLE, + GtkContainerAccessiblePrivate); } -