summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/gdk-pixbuf.c
diff options
context:
space:
mode:
authorMark Crichton <crichton@src.gnome.org>2000-04-01 03:28:31 +0000
committerMark Crichton <crichton@src.gnome.org>2000-04-01 03:28:31 +0000
commitf77b679fe4166419bcbe7ac478e880751eaf580c (patch)
tree9527af1227d2dd10bb6ce4a4bbd75783cddd272a /gdk-pixbuf/gdk-pixbuf.c
parent2907d515b28123ce4e9e98e181206145964fbf83 (diff)
downloadgdk-pixbuf-f77b679fe4166419bcbe7ac478e880751eaf580c.tar.gz
Added 2 more convience functions.
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.
Diffstat (limited to 'gdk-pixbuf/gdk-pixbuf.c')
-rw-r--r--gdk-pixbuf/gdk-pixbuf.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index 1e9a05df2..65dece8ac 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -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,