[gtk+/rendering-cleanup: 14/40] image: remove GdkImage as a possible image type



commit ec0cff94f288f8329ca4cdfc756ffcfe0acbcfd9
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jul 12 17:34:19 2010 +0200

    image: remove GdkImage as a possible image type
    
    GdkImage is about to be deprecated.

 docs/reference/gtk/gtk3-sections.txt |    3 -
 gtk/gtk.symbols                      |    3 -
 gtk/gtkimage.c                       |  174 +---------------------------------
 gtk/gtkimage.h                       |   16 ---
 modules/other/gail/gailimage.c       |    8 --
 5 files changed, 1 insertions(+), 203 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index ce77892..5bd66c9 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -1672,7 +1672,6 @@ GtkIconViewPrivate
 GtkImage
 GtkImageType
 gtk_image_get_icon_set
-gtk_image_get_image
 gtk_image_get_pixbuf
 gtk_image_get_pixmap
 gtk_image_get_stock
@@ -1682,7 +1681,6 @@ gtk_image_get_gicon
 gtk_image_get_storage_type
 gtk_image_new_from_file
 gtk_image_new_from_icon_set
-gtk_image_new_from_image
 gtk_image_new_from_pixbuf
 gtk_image_new_from_pixmap
 gtk_image_new_from_stock
@@ -1691,7 +1689,6 @@ gtk_image_new_from_icon_name
 gtk_image_new_from_gicon
 gtk_image_set_from_file
 gtk_image_set_from_icon_set
-gtk_image_set_from_image
 gtk_image_set_from_pixbuf
 gtk_image_set_from_pixmap
 gtk_image_set_from_stock
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index fe70e5c..86f44da 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -1738,7 +1738,6 @@ gtk_image_clear
 gtk_image_get_animation
 gtk_image_get_icon_name
 gtk_image_get_icon_set
-gtk_image_get_image
 gtk_image_get_pixbuf
 gtk_image_get_pixel_size
 gtk_image_get_pixmap
@@ -1756,7 +1755,6 @@ gtk_image_new_from_file_utf8
 #endif
 gtk_image_new_from_icon_name
 gtk_image_new_from_icon_set
-gtk_image_new_from_image
 gtk_image_new_from_pixbuf
 gtk_image_new_from_pixmap
 gtk_image_new_from_stock
@@ -1770,7 +1768,6 @@ gtk_image_set_from_file_utf8
 #endif
 gtk_image_set_from_icon_name
 gtk_image_set_from_icon_set
-gtk_image_set_from_image
 gtk_image_set_from_pixbuf
 gtk_image_set_from_pixmap
 gtk_image_set_from_stock
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index a9b4e75..0ce785a 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -180,7 +180,6 @@ enum
   PROP_0,
   PROP_PIXBUF,
   PROP_PIXMAP,
-  PROP_IMAGE,
   PROP_MASK,
   PROP_FILE,
   PROP_STOCK,
@@ -237,18 +236,10 @@ gtk_image_class_init (GtkImageClass *class)
                                                         GTK_PARAM_READWRITE));
 
   g_object_class_install_property (gobject_class,
-                                   PROP_IMAGE,
-                                   g_param_spec_object ("image",
-                                                        P_("Image"),
-                                                        P_("A GdkImage to display"),
-                                                        GDK_TYPE_IMAGE,
-                                                        GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
                                    PROP_MASK,
                                    g_param_spec_object ("mask",
                                                         P_("Mask"),
-                                                        P_("Mask bitmap to use with GdkImage or GdkPixmap"),
+                                                        P_("Mask bitmap to use with GdkPixmap"),
                                                         GDK_TYPE_PIXMAP,
                                                         GTK_PARAM_READWRITE));
   
@@ -403,20 +394,11 @@ gtk_image_set_property (GObject      *object,
                                  g_value_get_object (value),
                                  image->mask);
       break;
-    case PROP_IMAGE:
-      gtk_image_set_from_image (image,
-                                g_value_get_object (value),
-                                image->mask);
-      break;
     case PROP_MASK:
       if (image->storage_type == GTK_IMAGE_PIXMAP)
         gtk_image_set_from_pixmap (image,
                                    image->data.pixmap.pixmap,
                                    g_value_get_object (value));
-      else if (image->storage_type == GTK_IMAGE_IMAGE)
-        gtk_image_set_from_image (image,
-                                  image->data.image.image,
-                                  g_value_get_object (value));
       else
         {
           GdkBitmap *mask;
@@ -522,13 +504,6 @@ gtk_image_get_property (GObject     *object,
     case PROP_MASK:
       g_value_set_object (value, image->mask);
       break;
-    case PROP_IMAGE:
-      if (image->storage_type != GTK_IMAGE_IMAGE)
-        g_value_set_object (value, NULL);
-      else
-        g_value_set_object (value,
-                            image->data.image.image);
-      break;
     case PROP_FILE:
       g_value_set_string (value, priv->filename);
       break;
@@ -611,32 +586,6 @@ gtk_image_new_from_pixmap (GdkPixmap *pixmap,
 }
 
 /**
- * gtk_image_new_from_image:
- * @image: (allow-none): a #GdkImage, or %NULL
- * @mask: (allow-none): a #GdkBitmap, or %NULL
- *
- * Creates a #GtkImage widget displaying a @image with a @mask.
- * A #GdkImage is a client-side image buffer in the pixel format of the
- * current display. The #GtkImage does not assume a reference to the
- * image or mask; you still need to unref them if you own references.
- * #GtkImage will add its own reference rather than adopting yours.
- * 
- * Return value: a new #GtkImage
- **/
-GtkWidget*
-gtk_image_new_from_image  (GdkImage  *gdk_image,
-                           GdkBitmap *mask)
-{
-  GtkImage *image;
-
-  image = g_object_new (GTK_TYPE_IMAGE, NULL);
-
-  gtk_image_set_from_image (image, gdk_image, mask);
-
-  return GTK_WIDGET (image);
-}
-
-/**
  * gtk_image_new_from_file:
  * @filename: a filename
  * 
@@ -893,57 +842,6 @@ gtk_image_set_from_pixmap (GtkImage  *image,
 }
 
 /**
- * gtk_image_set_from_image:
- * @image: a #GtkImage
- * @gdk_image: (allow-none): a #GdkImage or %NULL
- * @mask:  (allow-none): a #GdkBitmap or %NULL
- *
- * See gtk_image_new_from_image() for details.
- **/
-void
-gtk_image_set_from_image  (GtkImage  *image,
-                           GdkImage  *gdk_image,
-                           GdkBitmap *mask)
-{
-  g_return_if_fail (GTK_IS_IMAGE (image));
-  g_return_if_fail (gdk_image == NULL ||
-                    GDK_IS_IMAGE (gdk_image));
-  g_return_if_fail (mask == NULL ||
-                    GDK_IS_PIXMAP (mask));
-
-  g_object_freeze_notify (G_OBJECT (image));
-  
-  if (gdk_image)
-    g_object_ref (gdk_image);
-
-  if (mask)
-    g_object_ref (mask);
-
-  gtk_image_clear (image);
-
-  if (gdk_image)
-    {
-      image->storage_type = GTK_IMAGE_IMAGE;
-
-      image->data.image.image = gdk_image;
-      image->mask = mask;
-
-      gtk_image_update_size (image, gdk_image->width, gdk_image->height);
-    }
-  else
-    {
-      /* Clean up the mask if gdk_image was NULL */
-      if (mask)
-        g_object_unref (mask);
-    }
-
-  g_object_notify (G_OBJECT (image), "image");
-  g_object_notify (G_OBJECT (image), "mask");
-  
-  g_object_thaw_notify (G_OBJECT (image));
-}
-
-/**
  * gtk_image_set_from_file:
  * @image: a #GtkImage
  * @filename: (allow-none): a filename or %NULL
@@ -1299,36 +1197,6 @@ gtk_image_get_pixmap (GtkImage   *image,
 }
 
 /**
- * gtk_image_get_image:
- * @image: a #GtkImage
- * @gdk_image: (out) (transfer none) (allow-none): return location for
- *     a #GtkImage, or %NULL
- * @mask: (out) (transfer none) (allow-none): return location for a
- *     #GdkBitmap, or %NULL
- * 
- * Gets the #GdkImage and mask being displayed by the #GtkImage.
- * The storage type of the image must be %GTK_IMAGE_EMPTY or
- * %GTK_IMAGE_IMAGE (see gtk_image_get_storage_type()).
- * The caller of this function does not own a reference to the
- * returned image and mask.
- **/
-void
-gtk_image_get_image  (GtkImage   *image,
-                      GdkImage  **gdk_image,
-                      GdkBitmap **mask)
-{
-  g_return_if_fail (GTK_IS_IMAGE (image));
-  g_return_if_fail (image->storage_type == GTK_IMAGE_IMAGE ||
-                    image->storage_type == GTK_IMAGE_EMPTY);
-
-  if (gdk_image)
-    *gdk_image = image->data.image.image;
-  
-  if (mask)
-    *mask = image->mask;
-}
-
-/**
  * gtk_image_get_pixbuf:
  * @image: a #GtkImage
  *
@@ -1919,27 +1787,6 @@ gtk_image_expose (GtkWidget      *widget,
 	  
           break;
 
-        case GTK_IMAGE_IMAGE:
-          mask = image->mask;
-          image_bound.width = image->data.image.image->width;
-          image_bound.height = image->data.image.image->height;
-
-	  if (rectangle_intersect_even (&area, &image_bound) &&
-	      needs_state_transform)
-            {
-              pixbuf = gdk_pixbuf_get_from_image (NULL,
-                                                  image->data.image.image,
-                                                  gtk_widget_get_colormap (widget),
-						  image_bound.x - x, image_bound.y - y,
-                                                  0, 0,
-                                                  image_bound.width,
-                                                  image_bound.height);
-
-	      x = image_bound.x;
-	      y = image_bound.y;
-            }
-          break;
-
         case GTK_IMAGE_PIXBUF:
           image_bound.width = gdk_pixbuf_get_width (image->data.pixbuf.pixbuf);
           image_bound.height = gdk_pixbuf_get_height (image->data.pixbuf.pixbuf);            
@@ -2132,15 +1979,6 @@ gtk_image_expose (GtkWidget      *widget,
                                      image_bound.width, image_bound.height);
                   break;
               
-                case GTK_IMAGE_IMAGE:
-                  gdk_draw_image (widget->window,
-                                  widget->style->black_gc,
-                                  image->data.image.image,
-                                  image_bound.x - x, image_bound.y - y,
-                                  image_bound.x, image_bound.y,
-                                  image_bound.width, image_bound.height);
-                  break;
-
                 case GTK_IMAGE_PIXBUF:
                 case GTK_IMAGE_STOCK:
                 case GTK_IMAGE_ICON_SET:
@@ -2205,16 +2043,6 @@ gtk_image_reset (GtkImage *image)
       
       break;
 
-    case GTK_IMAGE_IMAGE:
-
-      if (image->data.image.image)
-        g_object_unref (image->data.image.image);
-      image->data.image.image = NULL;
-      
-      g_object_notify (G_OBJECT (image), "image");
-      
-      break;
-
     case GTK_IMAGE_PIXBUF:
 
       if (image->data.pixbuf.pixbuf)
diff --git a/gtk/gtkimage.h b/gtk/gtkimage.h
index eb60306..26a9331 100644
--- a/gtk/gtkimage.h
+++ b/gtk/gtkimage.h
@@ -63,11 +63,6 @@ struct _GtkImagePixmapData
   GdkPixmap *pixmap;
 };
 
-struct _GtkImageImageData
-{
-  GdkImage *image;
-};
-
 struct _GtkImagePixbufData
 {
   GdkPixbuf *pixbuf;
@@ -108,7 +103,6 @@ struct _GtkImageGIconData
  * GtkImageType:
  * @GTK_IMAGE_EMPTY: there is no image displayed by the widget
  * @GTK_IMAGE_PIXMAP: the widget contains a #GdkPixmap
- * @GTK_IMAGE_IMAGE: the widget contains a #GdkImage
  * @GTK_IMAGE_PIXBUF: the widget contains a #GdkPixbuf
  * @GTK_IMAGE_STOCK: the widget contains a stock icon name (see
  *  <xref linkend="gtk3-Stock-Items"/>)
@@ -131,7 +125,6 @@ typedef enum
 {
   GTK_IMAGE_EMPTY,
   GTK_IMAGE_PIXMAP,
-  GTK_IMAGE_IMAGE,
   GTK_IMAGE_PIXBUF,
   GTK_IMAGE_STOCK,
   GTK_IMAGE_ICON_SET,
@@ -155,7 +148,6 @@ struct _GtkImage
   union
   {
     GtkImagePixmapData pixmap;
-    GtkImageImageData image;
     GtkImagePixbufData pixbuf;
     GtkImageStockData stock;
     GtkImageIconSetData icon_set;
@@ -193,8 +185,6 @@ GType      gtk_image_get_type (void) G_GNUC_CONST;
 GtkWidget* gtk_image_new                (void);
 GtkWidget* gtk_image_new_from_pixmap    (GdkPixmap       *pixmap,
                                          GdkBitmap       *mask);
-GtkWidget* gtk_image_new_from_image     (GdkImage        *image,
-                                         GdkBitmap       *mask);
 GtkWidget* gtk_image_new_from_file      (const gchar     *filename);
 GtkWidget* gtk_image_new_from_pixbuf    (GdkPixbuf       *pixbuf);
 GtkWidget* gtk_image_new_from_stock     (const gchar     *stock_id,
@@ -211,9 +201,6 @@ void gtk_image_clear              (GtkImage        *image);
 void gtk_image_set_from_pixmap    (GtkImage        *image,
                                    GdkPixmap       *pixmap,
                                    GdkBitmap       *mask);
-void gtk_image_set_from_image     (GtkImage        *image,
-                                   GdkImage        *gdk_image,
-                                   GdkBitmap       *mask);
 void gtk_image_set_from_file      (GtkImage        *image,
                                    const gchar     *filename);
 void gtk_image_set_from_pixbuf    (GtkImage        *image,
@@ -240,9 +227,6 @@ GtkImageType gtk_image_get_storage_type (GtkImage   *image);
 void       gtk_image_get_pixmap   (GtkImage         *image,
                                    GdkPixmap       **pixmap,
                                    GdkBitmap       **mask);
-void       gtk_image_get_image    (GtkImage         *image,
-                                   GdkImage        **gdk_image,
-                                   GdkBitmap       **mask);
 GdkPixbuf* gtk_image_get_pixbuf   (GtkImage         *image);
 void       gtk_image_get_stock    (GtkImage         *image,
                                    gchar           **stock_id,
diff --git a/modules/other/gail/gailimage.c b/modules/other/gail/gailimage.c
index 6dd1e02..a1aa31e 100644
--- a/modules/other/gail/gailimage.c
+++ b/modules/other/gail/gailimage.c
@@ -220,14 +220,6 @@ gail_image_get_image_size (AtkImage *image,
       *width = gdk_pixbuf_get_width(pixbuf);
       break;
     }
-    case GTK_IMAGE_IMAGE:
-    {
-      GdkImage *gdk_image;
-      gtk_image_get_image(gtk_image, &gdk_image, NULL);
-      *height = gdk_image->height;
-      *width = gdk_image->width;
-      break;
-    }
     case GTK_IMAGE_STOCK:
     case GTK_IMAGE_ICON_SET:
     case GTK_IMAGE_ICON_NAME:



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