]> Pileus Git - ~andy/gtk/blobdiff - gtk/a11y/gtkimageaccessible.c
filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
[~andy/gtk] / gtk / a11y / gtkimageaccessible.c
index 82c3be6bcd2e7bcfdb895dbb989e6f963cba9e14..704dd1b10246884c53b4b4f5d85a7145ed14c72a 100644 (file)
@@ -1,4 +1,4 @@
-/* GAIL - The GNOME Accessibility Implementation Library
+/* GTK+ - accessibility implementations
  * Copyright 2001 Sun Microsystems Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -12,9 +12,7 @@
  * 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.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
 #include <gtk/gtk.h>
 #include "gtkimageaccessible.h"
 
+struct _GtkImageAccessiblePrivate
+{
+  gchar *image_description;
+  gchar *stock_name;
+};
 
 static void atk_image_interface_init (AtkImageIface  *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkImageAccessible, gtk_image_accessible, GAIL_TYPE_WIDGET,
+G_DEFINE_TYPE_WITH_CODE (GtkImageAccessible, gtk_image_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
 
 static void
@@ -43,8 +46,8 @@ gtk_image_accessible_finalize (GObject *object)
 {
   GtkImageAccessible *aimage = GTK_IMAGE_ACCESSIBLE (object);
 
-  g_free (aimage->image_description);
-  g_free (aimage->stock_name);
+  g_free (aimage->priv->image_description);
+  g_free (aimage->priv->stock_name);
 
   G_OBJECT_CLASS (gtk_image_accessible_parent_class)->finalize (object);
 }
@@ -70,8 +73,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
   image = GTK_IMAGE (widget);
   image_accessible = GTK_IMAGE_ACCESSIBLE (accessible);
 
-  g_free (image_accessible->stock_name);
-  image_accessible->stock_name = NULL;
+  g_free (image_accessible->priv->stock_name);
+  image_accessible->priv->stock_name = NULL;
 
   if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK)
     return NULL;
@@ -83,8 +86,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
   if (!gtk_stock_lookup (stock_id, &stock_item))
     return NULL;
 
-  image_accessible->stock_name = _gtk_toolbar_elide_underscores (stock_item.label);
-  return image_accessible->stock_name;
+  image_accessible->priv->stock_name = _gtk_toolbar_elide_underscores (stock_item.label);
+  return image_accessible->priv->stock_name;
 }
 
 static void
@@ -96,11 +99,16 @@ 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);
 }
 
 static const gchar *
@@ -108,7 +116,7 @@ gtk_image_accessible_get_image_description (AtkImage *image)
 {
   GtkImageAccessible *accessible = GTK_IMAGE_ACCESSIBLE (image);
 
-  return accessible->image_description;
+  return accessible->priv->image_description;
 }
 
 static void
@@ -189,8 +197,8 @@ gtk_image_accessible_set_image_description (AtkImage    *image,
 {
   GtkImageAccessible* accessible = GTK_IMAGE_ACCESSIBLE (image);
 
-  g_free (accessible->image_description);
-  accessible->image_description = g_strdup (description);
+  g_free (accessible->priv->image_description);
+  accessible->priv->image_description = g_strdup (description);
 
   return TRUE;
 }