summaryrefslogtreecommitdiff
blob: 3710791cbc1511f94803c9bac20a6dcce76ff210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
From 0969a103e7c143545cbde7e458967b42a9415307 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sun, 27 Jun 2010 23:12:06 +0000
Subject: Bring back deprecated api

Grudgingly, in the name of api stability.
---
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
--
cgit v0.8.3.1