Hi,

I was just wondering if there is a good reason why the 'pixbuf'
property of ClutterTexture is created with g_param_spec_pointer and
not g_param_spec_object? GdkPixbuf is a GObject derived type and it
makes it much easier to use from language bindings if you can just
directly pass a GdkPixbuf object. I've attached a patch to
demonstrate.

Regards,
- Neil
Index: clutter/clutter/clutter-texture.c
===================================================================
--- clutter/clutter/clutter-texture.c   (revision 1178)
+++ clutter/clutter/clutter-texture.c   (working copy)
@@ -795,7 +795,7 @@
     {
     case PROP_PIXBUF:
       clutter_texture_set_pixbuf (texture, 
-                                 (GdkPixbuf*)g_value_get_pointer(value),
+                                 GDK_PIXBUF (g_value_get_object (value)),
                                  NULL);
       break;
     case PROP_USE_TILES:
@@ -846,7 +846,7 @@
       {
        GdkPixbuf *pixb;
        pixb = clutter_texture_get_pixbuf (texture);
-       g_value_set_pointer (value, pixb);
+       g_value_set_object (value, pixb);
       }
       break;
     case PROP_USE_TILES:
@@ -903,10 +903,11 @@
 
   g_object_class_install_property
     (gobject_class, PROP_PIXBUF,
-     g_param_spec_pointer ("pixbuf",
-                          "Pixbuf source for Texture.",
-                          "Pixbuf source for Texture.",
-                          CLUTTER_PARAM_READWRITE));
+     g_param_spec_object ("pixbuf",
+                         "Pixbuf source for Texture.",
+                         "Pixbuf source for Texture.",
+                         GDK_TYPE_PIXBUF,
+                         CLUTTER_PARAM_READWRITE));
 
   g_object_class_install_property
     (gobject_class, PROP_USE_TILES,

Reply via email to