summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-01-21 22:54:44 +0000
committerArturo Espinosa <unammx@src.gnome.org>2000-01-21 22:54:44 +0000
commit47a9aa1f8576e3beec90af9c31cf6fe60907ef89 (patch)
tree3e507b5e642a6cfccb452e118626c8343d27bb3b
parentf469e7a92c394bcf2413993bf2089a9ed9f34a6e (diff)
downloadgdk-pixbuf-47a9aa1f8576e3beec90af9c31cf6fe60907ef89.tar.gz
Return the same pixbuf as the input parameter.
2000-01-21 Federico Mena Quintero <federico@helixcode.com> * gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_ref): Return the same pixbuf as the input parameter. * gdk-pixbuf/gdk-pixbuf-animation.c (gdk_pixbuf_animation_ref): Return the same animation as the input parameter.
-rw-r--r--gdk-pixbuf/gdk-pixbuf-animation.c9
-rw-r--r--gdk-pixbuf/gdk-pixbuf.c9
-rw-r--r--gdk-pixbuf/gdk-pixbuf.h4
3 files changed, 14 insertions, 8 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c
index 5e9e0d17e..0577a97c4 100644
--- a/gdk-pixbuf/gdk-pixbuf-animation.c
+++ b/gdk-pixbuf/gdk-pixbuf-animation.c
@@ -117,14 +117,17 @@ gdk_pixbuf_animation_new_from_file (const char *filename)
*
* Adds a reference to an animation. It must be released afterwards using
* gdk_pixbuf_animation_unref().
+ *
+ * Return value: The same as the @animation argument.
**/
-void
+GdkPixbufAnimation *
gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation)
{
- g_return_if_fail (animation != NULL);
- g_return_if_fail (animation->ref_count > 0);
+ g_return_val_if_fail (animation != NULL, NULL);
+ g_return_val_if_fail (animation->ref_count > 0, NULL);
animation->ref_count++;
+ return animation;
}
/**
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index fab12f2e3..792f04b74 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -41,14 +41,17 @@
*
* Adds a reference to a pixbuf. It must be released afterwards using
* gdk_pixbuf_unref().
+ *
+ * Return value: The same as the @pixbuf argument.
**/
-void
+GdkPixbuf *
gdk_pixbuf_ref (GdkPixbuf *pixbuf)
{
- g_return_if_fail (pixbuf != NULL);
- g_return_if_fail (pixbuf->ref_count > 0);
+ g_return_val_if_fail (pixbuf != NULL, NULL);
+ g_return_val_if_fail (pixbuf->ref_count > 0, NULL);
pixbuf->ref_count++;
+ return pixbuf;
}
/**
diff --git a/gdk-pixbuf/gdk-pixbuf.h b/gdk-pixbuf/gdk-pixbuf.h
index 097c25644..ad94e445c 100644
--- a/gdk-pixbuf/gdk-pixbuf.h
+++ b/gdk-pixbuf/gdk-pixbuf.h
@@ -97,7 +97,7 @@ int gdk_pixbuf_get_rowstride (GdkPixbuf *pixbuf);
/* Reference counting */
-void gdk_pixbuf_ref (GdkPixbuf *pixbuf);
+GdkPixbuf *gdk_pixbuf_ref (GdkPixbuf *pixbuf);
void gdk_pixbuf_unref (GdkPixbuf *pixbuf);
/* Wrap a libart pixbuf */
@@ -234,7 +234,7 @@ GdkPixbuf *gdk_pixbuf_composite_color_simple (GdkPixbuf *src,
GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file (const char *filename);
-void gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation);
+GdkPixbufAnimation *gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation);
void gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation);
/* General (presently empty) initialization hooks, primarily for gnome-libs */