[gdk-pixbuf] gdk-pixbuf: implement the GIcon interface



commit 23e39b9b3ae80874d489fef61dba2d93a3446834
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Nov 5 10:31:54 2010 +0100

    gdk-pixbuf: implement the GIcon interface
    
    https://bugzilla.gnome.org/show_bug.cgi?id=634059

 gdk-pixbuf/gdk-pixbuf.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index 77fe6e6..525173a 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -36,6 +36,7 @@
 
 /* Include the marshallers */
 #include <glib-object.h>
+#include <gio/gio.h>
 #include "gdk-pixbuf-marshal.c"
 
 static void gdk_pixbuf_finalize     (GObject        *object);
@@ -62,7 +63,11 @@ enum
   PROP_PIXELS
 };
 
-G_DEFINE_TYPE (GdkPixbuf, gdk_pixbuf, G_TYPE_OBJECT)
+static void gdk_pixbuf_icon_iface_init (GIconIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (GdkPixbuf, gdk_pixbuf, G_TYPE_OBJECT,
+                         G_IMPLEMENT_INTERFACE (G_TYPE_ICON,
+                                                gdk_pixbuf_icon_iface_init))
 
 static void 
 gdk_pixbuf_init (GdkPixbuf *pixbuf)
@@ -216,7 +221,12 @@ gdk_pixbuf_unref (GdkPixbuf *pixbuf)
         g_object_unref (pixbuf);
 }
 
-
+static void
+gdk_pixbuf_icon_iface_init (GIconIface *iface)
+{
+        iface->hash = g_direct_hash;
+        iface->equal = g_direct_equal;
+}
 
 /* Used as the destroy notification function for gdk_pixbuf_new() */
 static void



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