diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-06-27 19:12:06 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-06-27 19:12:06 -0400 |
commit | 0969a103e7c143545cbde7e458967b42a9415307 (patch) | |
tree | 23335d73fe013c29716f0627755469b6ecaad98b | |
parent | 077a3ea5eaa8ff662f44ad4ef0ad33bcc916e22a (diff) | |
download | gdk-pixbuf-0969a103e7c143545cbde7e458967b42a9415307.tar.gz |
Bring back deprecated api
Grudgingly, in the name of api stability.
-rw-r--r-- | docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt | 4 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-animation.c | 30 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-animation.h | 5 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-core.h | 7 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf.c | 33 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf.symbols | 8 |
6 files changed, 87 insertions, 0 deletions
diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt b/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt index 8e70fa352..58ea4abd4 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt @@ -54,6 +54,8 @@ gdk_pixbuf_error_get_type <SECTION> <FILE>refcounting</FILE> +gdk_pixbuf_ref +gdk_pixbuf_unref GdkPixbufDestroyNotify </SECTION> @@ -118,6 +120,8 @@ gdk_pixbuf_fill GdkPixbufAnimation GdkPixbufAnimationIter gdk_pixbuf_animation_new_from_file +gdk_pixbuf_animation_ref +gdk_pixbuf_animation_unref gdk_pixbuf_animation_get_width gdk_pixbuf_animation_get_height gdk_pixbuf_animation_get_iter diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index 907e0e798..5b500f6c3 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -256,6 +256,36 @@ gdk_pixbuf_animation_new_from_file (const char *filename, #endif /** + * gdk_pixbuf_animation_ref: + * @animation: An animation. + * + * Adds a reference to an animation. + * + * Return value: The same as the @animation argument. + * + * Deprecated: 2.0: Use g_object_ref(). + **/ +GdkPixbufAnimation * +gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation) +{ + return (GdkPixbufAnimation*) g_object_ref (animation); +} + +/** + * gdk_pixbuf_animation_unref: + * @animation: An animation. + * + * Removes a reference from an animation. + * + * Deprecated: 2.0: Use g_object_unref(). + **/ +void +gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation) +{ + g_object_unref (animation); +} + +/** * gdk_pixbuf_animation_is_static_image: * @animation: a #GdkPixbufAnimation * diff --git a/gdk-pixbuf/gdk-pixbuf-animation.h b/gdk-pixbuf/gdk-pixbuf-animation.h index a67e3c907..3143c7085 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.h +++ b/gdk-pixbuf/gdk-pixbuf-animation.h @@ -58,6 +58,11 @@ GType gdk_pixbuf_animation_get_type (void) G_GNUC_CONST; GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file (const char *filename, GError **error); +#ifndef GDK_PIXBUF_DISABLE_DEPRECATED +GdkPixbufAnimation *gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation); +void gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation); +#endif + int gdk_pixbuf_animation_get_width (GdkPixbufAnimation *animation); int gdk_pixbuf_animation_get_height (GdkPixbufAnimation *animation); gboolean gdk_pixbuf_animation_is_static_image (GdkPixbufAnimation *animation); diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h index 4ea16934c..079a3a797 100644 --- a/gdk-pixbuf/gdk-pixbuf-core.h +++ b/gdk-pixbuf/gdk-pixbuf-core.h @@ -84,6 +84,13 @@ GQuark gdk_pixbuf_error_quark (void); GType gdk_pixbuf_get_type (void) G_GNUC_CONST; +/* Reference counting */ + +#ifndef GDK_PIXBUF_DISABLE_DEPRECATED +GdkPixbuf *gdk_pixbuf_ref (GdkPixbuf *pixbuf); +void gdk_pixbuf_unref (GdkPixbuf *pixbuf); +#endif + /* GdkPixbuf accessors */ GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf); diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 1b2728bf7..c38b78238 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -186,6 +186,39 @@ gdk_pixbuf_finalize (GObject *object) G_OBJECT_CLASS (gdk_pixbuf_parent_class)->finalize (object); } + +/** + * gdk_pixbuf_ref: + * @pixbuf: A pixbuf. + * + * Adds a reference to a pixbuf. + * + * Return value: The same as the @pixbuf argument. + * + * Deprecated: 2.0: Use g_object_ref(). + **/ +GdkPixbuf * +gdk_pixbuf_ref (GdkPixbuf *pixbuf) +{ + return (GdkPixbuf *) g_object_ref (pixbuf); +} + +/** + * gdk_pixbuf_unref: + * @pixbuf: A pixbuf. + * + * Removes a reference from a pixbuf. + * + * Deprecated: 2.0: Use g_object_unref(). + **/ +void +gdk_pixbuf_unref (GdkPixbuf *pixbuf) +{ + g_object_unref (pixbuf); +} + + + /* Used as the destroy notification function for gdk_pixbuf_new() */ static void free_buffer (guchar *pixels, gpointer data) diff --git a/gdk-pixbuf/gdk-pixbuf.symbols b/gdk-pixbuf/gdk-pixbuf.symbols index b1c7e1796..03bd08a62 100644 --- a/gdk-pixbuf/gdk-pixbuf.symbols +++ b/gdk-pixbuf/gdk-pixbuf.symbols @@ -15,6 +15,10 @@ #if IN_FILE(__GDK_PIXBUF_C__) gdk_pixbuf_error_quark gdk_pixbuf_get_type G_GNUC_CONST +#ifndef GDK_PIXBUF_DISABLE_DEPRECATED +gdk_pixbuf_ref +gdk_pixbuf_unref +#endif gdk_pixbuf_new gdk_pixbuf_get_bits_per_sample gdk_pixbuf_get_colorspace @@ -120,6 +124,10 @@ gdk_pixbuf_animation_new_from_file PRIVATE #ifdef G_OS_WIN32 gdk_pixbuf_animation_new_from_file_utf8 #endif +#ifndef GDK_PIXBUF_DISABLE_DEPRECATED +gdk_pixbuf_animation_ref +gdk_pixbuf_animation_unref +#endif gdk_pixbuf_non_anim_new gdk_pixbuf_non_anim_get_type G_GNUC_CONST #endif |