]> Pileus Git - ~andy/gtk/commitdiff
Added 2 more convience functions.
authorMark Crichton <crichton@src.gnome.org>
Sat, 1 Apr 2000 03:28:31 +0000 (03:28 +0000)
committerMark Crichton <crichton@src.gnome.org>
Sat, 1 Apr 2000 03:28:31 +0000 (03:28 +0000)
Added 2 more convience functions.

gdk_pixbuf_get_refcount for the current refcount of the pixbuf (per someone
at Eazel's request)

gdk_pixbuf_get_artpixbuf: returns the artpixbuf of the pixbuf.  Is this
a good idea?  I'm using it to help make->panel->do->the->right->thing.

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf.c
gdk-pixbuf/gdk-pixbuf.h

index 6afc575597e29b38203ad79fb58f140b6054ed06..4fe3979162fdd07ea65a397b337bdcca0f93bb5c 100644 (file)
@@ -1,3 +1,8 @@
+2000-03-31  Mark Crichton  <crichton@gimp.org>
+
+       * gdk-pixbuf/gdk-pixbuf.c: Added gdk_pixbuf_get_refcount
+       and gdk_pixbuf_get_artpixbuf accessor functions.
+
 2000-03-29  Federico Mena Quintero  <federico@helixcode.com>
 
        * gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_get_has_alpha): Return
index 1e9a05df27048eb5ec13f6c80fe071396e03ec36..65dece8ac4a03f1ce50cfed4761fa2372015a17e 100644 (file)
@@ -295,6 +295,41 @@ gdk_pixbuf_get_rowstride (GdkPixbuf *pixbuf)
        return pixbuf->art_pixbuf->rowstride;
 }
 
+/**
+ * gdk_pixbuf_get_ref:
+ * @pixbuf: A pixbuf.
+ *
+ * Gets the refcount of a pixbuf.
+ *
+ * Return value: The refcount of the @pixbuf argument.
+ **/
+gint
+gdk_pixbuf_get_ref (GdkPixbuf *pixbuf)
+{
+        g_return_val_if_fail (pixbuf != NULL, -1);
+        g_return_val_if_fail (pixbuf->ref_count > 0, -1);
+
+        return (pixbuf->ref_count);
+}
+
+/**
+ * gdk_pixbuf_get_artpixbuf:
+ * @pixbuf: A pixbuf.
+ *
+ * Queries a pointer to the ArtPixBuf data of a pixbuf.
+ *
+ * Return value: A pointer to the pixbuf's ArtPixBuf.
+ **/
+ArtPixBuf *
+gdk_pixbuf_get_artpixbuf (GdkPixbuf *pixbuf)
+{
+        g_return_val_if_fail (pixbuf != NULL, NULL);
+        g_assert (pixbuf->art_pixbuf != NULL);
+
+        return pixbuf->art_pixbuf;
+}
+
+
 /* General initialization hooks */
 const guint gdk_pixbuf_major_version=GDK_PIXBUF_MAJOR,
   gdk_pixbuf_minor_version=GDK_PIXBUF_MINOR,
index 01f2043bfc20318e4487b2a6480249304ede31a2..ff64b7a19c03dc52c44555e6e00a35903ce63850 100644 (file)
@@ -94,6 +94,9 @@ guchar      *gdk_pixbuf_get_pixels          (GdkPixbuf *pixbuf);
 int          gdk_pixbuf_get_width           (GdkPixbuf *pixbuf);
 int          gdk_pixbuf_get_height          (GdkPixbuf *pixbuf);
 int          gdk_pixbuf_get_rowstride       (GdkPixbuf *pixbuf);
+gint         gdk_pixbuf_get_ref             (GdkPixbuf *pixbuf);
+ArtPixBuf   *gdk_pixbuf_get_artpixbuf       (GdkPixbuf *pixbuf);
+
 
 /* Reference counting */