[gdk-pixbuf] Bring back deprecated api



commit 0969a103e7c143545cbde7e458967b42a9415307
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 27 19:12:06 2010 -0400

    Bring back deprecated api
    
    Grudgingly, in the name of api stability.

 docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt |    4 ++
 gdk-pixbuf/gdk-pixbuf-animation.c                 |   30 +++++++++++++++++++
 gdk-pixbuf/gdk-pixbuf-animation.h                 |    5 +++
 gdk-pixbuf/gdk-pixbuf-core.h                      |    7 ++++
 gdk-pixbuf/gdk-pixbuf.c                           |   33 +++++++++++++++++++++
 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 8e70fa3..58ea4ab 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 907e0e7..5b500f6 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 a67e3c9..3143c70 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 4ea1693..079a3a7 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 1b2728b..c38b782 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 b1c7e17..03bd08a 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]