]> Pileus Git - ~andy/gtk/blobdiff - gtk/a11y/gtkimagecellaccessible.c
filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
[~andy/gtk] / gtk / a11y / gtkimagecellaccessible.c
index e87eaabbcc46354742d98e9641f18c6c1e0bebde..6b690606c73531e788b4ef0b44a0339c59e5bba2 100644 (file)
@@ -1,4 +1,4 @@
-/* GAIL - The GNOME Accessibility Enabling 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 "gtkimagecellaccessible.h"
 
-static gchar *property_list[] = {
-  "pixbuf",
-  NULL
+struct _GtkImageCellAccessiblePrivate
+{
+  gchar *image_description;
 };
 
 static void atk_image_interface_init (AtkImageIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GtkImageCellAccessible, _gtk_image_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
+G_DEFINE_TYPE_WITH_CODE (GtkImageCellAccessible, gtk_image_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
 
 static void
@@ -37,33 +35,26 @@ gtk_image_cell_accessible_finalize (GObject *object)
 {
   GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (object);
 
-  g_free (image_cell->image_description);
-  G_OBJECT_CLASS (_gtk_image_cell_accessible_parent_class)->finalize (object);
-}
-
-static gboolean
-gtk_image_cell_accessible_update_cache (GtkRendererCellAccessible *cell,
-                                        gboolean                   emit_change_signal)
-{
-  return FALSE;
+  g_free (image_cell->priv->image_description);
+  G_OBJECT_CLASS (gtk_image_cell_accessible_parent_class)->finalize (object);
 }
 
 static void
-_gtk_image_cell_accessible_class_init (GtkImageCellAccessibleClass *klass)
+gtk_image_cell_accessible_class_init (GtkImageCellAccessibleClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GtkRendererCellAccessibleClass *renderer_cell_class = GTK_RENDERER_CELL_ACCESSIBLE_CLASS (klass);
 
   gobject_class->finalize = gtk_image_cell_accessible_finalize;
 
-  renderer_cell_class->update_cache = gtk_image_cell_accessible_update_cache;
-  renderer_cell_class->property_list = property_list;
+  g_type_class_add_private (klass, sizeof (GtkImageCellAccessiblePrivate));
 }
 
 static void
-_gtk_image_cell_accessible_init (GtkImageCellAccessible *image_cell)
+gtk_image_cell_accessible_init (GtkImageCellAccessible *image_cell)
 {
-  image_cell->image_description = NULL;
+  image_cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (image_cell,
+                                                  GTK_TYPE_IMAGE_CELL_ACCESSIBLE,
+                                                  GtkImageCellAccessiblePrivate);
 }
 
 static const gchar *
@@ -71,7 +62,7 @@ gtk_image_cell_accessible_get_image_description (AtkImage *image)
 {
   GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
 
-  return image_cell->image_description;
+  return image_cell->priv->image_description;
 }
 
 static gboolean
@@ -80,10 +71,10 @@ gtk_image_cell_accessible_set_image_description (AtkImage    *image,
 {
   GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
 
-  g_free (image_cell->image_description);
-  image_cell->image_description = g_strdup (description);
+  g_free (image_cell->priv->image_description);
+  image_cell->priv->image_description = g_strdup (description);
 
-  if (image_cell->image_description)
+  if (image_cell->priv->image_description)
     return TRUE;
   else
     return FALSE;
@@ -110,10 +101,11 @@ gtk_image_cell_accessible_get_image_size (AtkImage *image,
   *width = 0;
   *height = 0;
 
-  cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
-  g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer),
+  g_object_get (cell, "renderer", &cell_renderer, NULL);
+  g_object_get (cell_renderer,
                 "pixbuf", &pixbuf,
                 NULL);
+  g_object_unref (cell_renderer);
 
   if (pixbuf)
     {