1
<refentry id="gdk-pixbuf-animation">
3
<refentrytitle role="top_of_page">Animations</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
9
<refname>Animations</refname>
10
<refpurpose>Animated images.</refpurpose>
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
14
<refsynopsisdiv role="synopsis">
15
<title role="synopsis.title">Synopsis</title>
16
<anchor id="GdkPixbufAnimation"/><anchor id="GdkPixbufAnimationIter"/>
19
#include <gdk-pixbuf/gdk-pixbuf.h>
22
<link linkend="GdkPixbufAnimation-struct">GdkPixbufAnimation</link>;
23
<link linkend="GdkPixbufAnimationIter-struct">GdkPixbufAnimationIter</link>;
24
<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link>* <link linkend="gdk-pixbuf-animation-new-from-file">gdk_pixbuf_animation_new_from_file</link> (const <link linkend="char">char</link> *filename,
25
<link linkend="GError">GError</link> **error);
26
<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link>* <link linkend="gdk-pixbuf-animation-ref">gdk_pixbuf_animation_ref</link> (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
27
<link linkend="void">void</link> <link linkend="gdk-pixbuf-animation-unref">gdk_pixbuf_animation_unref</link> (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
28
<link linkend="int">int</link> <link linkend="gdk-pixbuf-animation-get-width">gdk_pixbuf_animation_get_width</link> (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
29
<link linkend="int">int</link> <link linkend="gdk-pixbuf-animation-get-height">gdk_pixbuf_animation_get_height</link> (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
30
<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link>* <link linkend="gdk-pixbuf-animation-get-iter">gdk_pixbuf_animation_get_iter</link> (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation,
31
const <link linkend="GTimeVal">GTimeVal</link> *start_time);
32
<link linkend="gboolean">gboolean</link> <link linkend="gdk-pixbuf-animation-is-static-image">gdk_pixbuf_animation_is_static_image</link>
33
(<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
34
<link linkend="GdkPixbuf">GdkPixbuf</link>* <link linkend="gdk-pixbuf-animation-get-static-image">gdk_pixbuf_animation_get_static_image</link>
35
(<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
36
<link linkend="gboolean">gboolean</link> <link linkend="gdk-pixbuf-animation-iter-advance">gdk_pixbuf_animation_iter_advance</link> (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter,
37
const <link linkend="GTimeVal">GTimeVal</link> *current_time);
38
<link linkend="int">int</link> <link linkend="gdk-pixbuf-animation-iter-get-delay-time">gdk_pixbuf_animation_iter_get_delay_time</link>
39
(<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);
40
<link linkend="gboolean">gboolean</link> <link linkend="gdk-pixbuf-animation-iter-on-currently-loading-frame">gdk_pixbuf_animation_iter_on_currently_loading_frame</link>
41
(<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);
42
<link linkend="GdkPixbuf">GdkPixbuf</link>* <link linkend="gdk-pixbuf-animation-iter-get-pixbuf">gdk_pixbuf_animation_iter_get_pixbuf</link>
43
(<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);
45
<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link>;
46
<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link>* <link linkend="gdk-pixbuf-simple-anim-new">gdk_pixbuf_simple_anim_new</link> (<link linkend="gint">gint</link> width,
47
<link linkend="gint">gint</link> height,
48
<link linkend="gfloat">gfloat</link> rate);
49
<link linkend="void">void</link> <link linkend="gdk-pixbuf-simple-anim-add-frame">gdk_pixbuf_simple_anim_add_frame</link> (<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> *animation,
50
<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
56
<refsect1 role="object_hierarchy">
57
<title role="object_hierarchy.title">Object Hierarchy</title>
60
<link linkend="GObject">GObject</link>
61
+----GdkPixbufAnimation
65
<link linkend="GObject">GObject</link>
66
+----GdkPixbufAnimationIter
78
<refsect1 role="desc">
79
<title role="desc.title">Description</title>
81
The &gdk-pixbuf; library provides a simple mechanism to load and represent
82
animations. An animation is conceptually a series of frames to be displayed
83
over time. Each frame is the same size. The animation may not be represented
84
as a series of frames internally; for example, it may be stored as a
85
sprite and instructions for moving the sprite around a background. To display
86
an animation you don't need to understand its representation, however; you just
87
ask &gdk-pixbuf; what should be displayed at a given point in time.
91
<refsect1 role="details">
92
<title role="details.title">Details</title>
94
<title><anchor id="GdkPixbufAnimation-struct" role="struct"/>GdkPixbufAnimation</title>
95
<indexterm><primary>GdkPixbufAnimation</primary></indexterm><programlisting>typedef struct _GdkPixbufAnimation GdkPixbufAnimation;</programlisting>
97
And opaque struct representing an animation.
100
<title><anchor id="GdkPixbufAnimationIter-struct" role="struct"/>GdkPixbufAnimationIter</title>
101
<indexterm><primary>GdkPixbufAnimationIter</primary></indexterm><programlisting>typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;</programlisting>
103
And opaque struct representing an iterator which points to a
104
certain position in an animation.
107
<title><anchor id="gdk-pixbuf-animation-new-from-file" role="function"/>gdk_pixbuf_animation_new_from_file ()</title>
108
<indexterm><primary>gdk_pixbuf_animation_new_from_file</primary></indexterm><programlisting><link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link>* gdk_pixbuf_animation_new_from_file (const <link linkend="char">char</link> *filename,
109
<link linkend="GError">GError</link> **error);</programlisting>
111
Creates a new animation by loading it from a file. The file format is
112
detected automatically. If the file's format does not support multi-frame
113
images, then an animation with a single frame will be created. Possible errors
114
are in the <link linkend="GDK-PIXBUF-ERROR:CAPS"><type>GDK_PIXBUF_ERROR</type></link> and <link linkend="G-FILE-ERROR:CAPS"><type>G_FILE_ERROR</type></link> domains.</para>
117
</para><variablelist role="params">
118
<varlistentry><term><parameter>filename</parameter> :</term>
119
<listitem><simpara> Name of file to load, in the GLib file name encoding
120
</simpara></listitem></varlistentry>
121
<varlistentry><term><parameter>error</parameter> :</term>
122
<listitem><simpara> return location for error
123
</simpara></listitem></varlistentry>
124
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A newly-created animation with a reference count of 1, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
125
if any of several error conditions ocurred: the file could not be opened,
126
there was no loader for the file's format, there was not enough memory to
127
allocate the image buffer, or the image file contained invalid data.
128
</simpara></listitem></varlistentry>
129
</variablelist></refsect2>
131
<title><anchor id="gdk-pixbuf-animation-ref" role="function" condition="deprecated:Use g_object_ref()."/>gdk_pixbuf_animation_ref ()</title>
132
<indexterm role="deprecated"><primary>gdk_pixbuf_animation_ref</primary></indexterm><programlisting><link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link>* gdk_pixbuf_animation_ref (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
133
<warning><para><literal>gdk_pixbuf_animation_ref</literal> is deprecated and should not be used in newly-written code. Use <link linkend="g-object-ref"><function>g_object_ref()</function></link>.</para></warning>
135
Adds a reference to an animation.</para>
138
</para><variablelist role="params">
139
<varlistentry><term><parameter>animation</parameter> :</term>
140
<listitem><simpara> An animation.
141
</simpara></listitem></varlistentry>
142
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> The same as the <parameter>animation</parameter> argument.
144
</simpara></listitem></varlistentry>
145
</variablelist></refsect2>
147
<title><anchor id="gdk-pixbuf-animation-unref" role="function" condition="deprecated:Use g_object_unref()."/>gdk_pixbuf_animation_unref ()</title>
148
<indexterm role="deprecated"><primary>gdk_pixbuf_animation_unref</primary></indexterm><programlisting><link linkend="void">void</link> gdk_pixbuf_animation_unref (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
149
<warning><para><literal>gdk_pixbuf_animation_unref</literal> is deprecated and should not be used in newly-written code. Use <link linkend="g-object-unref"><function>g_object_unref()</function></link>.</para></warning>
151
Removes a reference from an animation.</para>
154
</para><variablelist role="params">
155
<varlistentry><term><parameter>animation</parameter> :</term>
156
<listitem><simpara> An animation.
157
</simpara></listitem></varlistentry>
158
</variablelist></refsect2>
160
<title><anchor id="gdk-pixbuf-animation-get-width" role="function"/>gdk_pixbuf_animation_get_width ()</title>
161
<indexterm><primary>gdk_pixbuf_animation_get_width</primary></indexterm><programlisting><link linkend="int">int</link> gdk_pixbuf_animation_get_width (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
163
Queries the width of the bounding box of a pixbuf animation.</para>
166
</para><variablelist role="params">
167
<varlistentry><term><parameter>animation</parameter> :</term>
168
<listitem><simpara> An animation.
169
</simpara></listitem></varlistentry>
170
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Width of the bounding box of the animation.
171
</simpara></listitem></varlistentry>
172
</variablelist></refsect2>
174
<title><anchor id="gdk-pixbuf-animation-get-height" role="function"/>gdk_pixbuf_animation_get_height ()</title>
175
<indexterm><primary>gdk_pixbuf_animation_get_height</primary></indexterm><programlisting><link linkend="int">int</link> gdk_pixbuf_animation_get_height (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
177
Queries the height of the bounding box of a pixbuf animation.</para>
180
</para><variablelist role="params">
181
<varlistentry><term><parameter>animation</parameter> :</term>
182
<listitem><simpara> An animation.
183
</simpara></listitem></varlistentry>
184
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Height of the bounding box of the animation.
185
</simpara></listitem></varlistentry>
186
</variablelist></refsect2>
188
<title><anchor id="gdk-pixbuf-animation-get-iter" role="function"/>gdk_pixbuf_animation_get_iter ()</title>
189
<indexterm><primary>gdk_pixbuf_animation_get_iter</primary></indexterm><programlisting><link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link>* gdk_pixbuf_animation_get_iter (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation,
190
const <link linkend="GTimeVal">GTimeVal</link> *start_time);</programlisting>
192
Get an iterator for displaying an animation. The iterator provides
193
the frames that should be displayed at a given time.
194
It should be freed after use with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
197
<parameter>start_time</parameter> would normally come from <link linkend="g-get-current-time"><function>g_get_current_time()</function></link>, and
198
marks the beginning of animation playback. After creating an
199
iterator, you should immediately display the pixbuf returned by
200
<link linkend="gdk-pixbuf-animation-iter-get-pixbuf"><function>gdk_pixbuf_animation_iter_get_pixbuf()</function></link>. Then, you should install a
201
timeout (with <link linkend="g-timeout-add"><function>g_timeout_add()</function></link>) or by some other mechanism ensure
202
that you'll update the image after
203
<link linkend="gdk-pixbuf-animation-iter-get-delay-time"><function>gdk_pixbuf_animation_iter_get_delay_time()</function></link> milliseconds. Each time
204
the image is updated, you should reinstall the timeout with the new,
205
possibly-changed delay time.
208
As a shortcut, if <parameter>start_time</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the result of
209
<link linkend="g-get-current-time"><function>g_get_current_time()</function></link> will be used automatically.
212
To update the image (i.e. possibly change the result of
213
<link linkend="gdk-pixbuf-animation-iter-get-pixbuf"><function>gdk_pixbuf_animation_iter_get_pixbuf()</function></link> to a new frame of the animation),
214
call <link linkend="gdk-pixbuf-animation-iter-advance"><function>gdk_pixbuf_animation_iter_advance()</function></link>.
217
If you're using <link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link>, in addition to updating the image
218
after the delay time, you should also update it whenever you
219
receive the area_updated signal and
220
<link linkend="gdk-pixbuf-animation-iter-on-currently-loading-frame"><function>gdk_pixbuf_animation_iter_on_currently_loading_frame()</function></link> returns
221
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>. In this case, the frame currently being fed into the loader
222
has received new data, so needs to be refreshed. The delay time for
223
a frame may also be modified after an area_updated signal, for
224
example if the delay time for a frame is encoded in the data after
225
the frame itself. So your timeout should be reinstalled after any
229
A delay time of -1 is possible, indicating "infinite."</para>
232
</para><variablelist role="params">
233
<varlistentry><term><parameter>animation</parameter> :</term>
234
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
235
</simpara></listitem></varlistentry>
236
<varlistentry><term><parameter>start_time</parameter> :</term>
237
<listitem><simpara> time when the animation starts playing
238
</simpara></listitem></varlistentry>
239
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> an iterator to move over the animation
240
</simpara></listitem></varlistentry>
241
</variablelist></refsect2>
243
<title><anchor id="gdk-pixbuf-animation-is-static-image" role="function"/>gdk_pixbuf_animation_is_static_image ()</title>
244
<indexterm><primary>gdk_pixbuf_animation_is_static_image</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gdk_pixbuf_animation_is_static_image
245
(<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
247
If you load a file with <link linkend="gdk-pixbuf-animation-new-from-file"><function>gdk_pixbuf_animation_new_from_file()</function></link> and it turns
248
out to be a plain, unanimated image, then this function will return
249
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>. Use <link linkend="gdk-pixbuf-animation-get-static-image"><function>gdk_pixbuf_animation_get_static_image()</function></link> to retrieve
253
</para><variablelist role="params">
254
<varlistentry><term><parameter>animation</parameter> :</term>
255
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
256
</simpara></listitem></varlistentry>
257
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the "animation" was really just an image
258
</simpara></listitem></varlistentry>
259
</variablelist></refsect2>
261
<title><anchor id="gdk-pixbuf-animation-get-static-image" role="function"/>gdk_pixbuf_animation_get_static_image ()</title>
262
<indexterm><primary>gdk_pixbuf_animation_get_static_image</primary></indexterm><programlisting><link linkend="GdkPixbuf">GdkPixbuf</link>* gdk_pixbuf_animation_get_static_image
263
(<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
265
If an animation is really just a plain image (has only one frame),
266
this function returns that image. If the animation is an animation,
267
this function returns a reasonable thing to display as a static
268
unanimated image, which might be the first frame, or something more
269
sophisticated. If an animation hasn't loaded any frames yet, this
270
function will return <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
273
</para><variablelist role="params">
274
<varlistentry><term><parameter>animation</parameter> :</term>
275
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
276
</simpara></listitem></varlistentry>
277
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> unanimated image representing the animation
278
</simpara></listitem></varlistentry>
279
</variablelist></refsect2>
281
<title><anchor id="gdk-pixbuf-animation-iter-advance" role="function"/>gdk_pixbuf_animation_iter_advance ()</title>
282
<indexterm><primary>gdk_pixbuf_animation_iter_advance</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gdk_pixbuf_animation_iter_advance (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter,
283
const <link linkend="GTimeVal">GTimeVal</link> *current_time);</programlisting>
285
Possibly advances an animation to a new frame. Chooses the frame based
286
on the start time passed to <link linkend="gdk-pixbuf-animation-get-iter"><function>gdk_pixbuf_animation_get_iter()</function></link>.
289
<parameter>current_time</parameter> would normally come from <link linkend="g-get-current-time"><function>g_get_current_time()</function></link>, and
290
must be greater than or equal to the time passed to
291
<link linkend="gdk-pixbuf-animation-get-iter"><function>gdk_pixbuf_animation_get_iter()</function></link>, and must increase or remain
292
unchanged each time <link linkend="gdk-pixbuf-animation-iter-get-pixbuf"><function>gdk_pixbuf_animation_iter_get_pixbuf()</function></link> is
293
called. That is, you can't go backward in time; animations only
297
As a shortcut, pass <link linkend="NULL:CAPS"><literal>NULL</literal></link> for the current time and <link linkend="g-get-current-time"><function>g_get_current_time()</function></link>
298
will be invoked on your behalf. So you only need to explicitly pass
299
<parameter>current_time</parameter> if you're doing something odd like playing the animation
303
If this function returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, there's no need to update the animation
304
display, assuming the display had been rendered prior to advancing;
305
if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, you need to call <link linkend="gdk-animation-iter-get-pixbuf"><function>gdk_animation_iter_get_pixbuf()</function></link> and update the
306
display with the new pixbuf.</para>
309
</para><variablelist role="params">
310
<varlistentry><term><parameter>iter</parameter> :</term>
311
<listitem><simpara> a <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link>
312
</simpara></listitem></varlistentry>
313
<varlistentry><term><parameter>current_time</parameter> :</term>
314
<listitem><simpara> current time
315
</simpara></listitem></varlistentry>
316
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the image may need updating
318
</simpara></listitem></varlistentry>
319
</variablelist></refsect2>
321
<title><anchor id="gdk-pixbuf-animation-iter-get-delay-time" role="function"/>gdk_pixbuf_animation_iter_get_delay_time ()</title>
322
<indexterm><primary>gdk_pixbuf_animation_iter_get_delay_time</primary></indexterm><programlisting><link linkend="int">int</link> gdk_pixbuf_animation_iter_get_delay_time
323
(<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);</programlisting>
325
Gets the number of milliseconds the current pixbuf should be displayed,
326
or -1 if the current pixbuf should be displayed forever. <link linkend="g-timeout-add"><function>g_timeout_add()</function></link>
327
conveniently takes a timeout in milliseconds, so you can use a timeout
328
to schedule the next update.</para>
331
</para><variablelist role="params">
332
<varlistentry><term><parameter>iter</parameter> :</term>
333
<listitem><simpara> an animation iterator
334
</simpara></listitem></varlistentry>
335
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> delay time in milliseconds (thousandths of a second)
336
</simpara></listitem></varlistentry>
337
</variablelist></refsect2>
339
<title><anchor id="gdk-pixbuf-animation-iter-on-currently-loading-frame" role="function"/>gdk_pixbuf_animation_iter_on_currently_loading_frame ()</title>
340
<indexterm><primary>gdk_pixbuf_animation_iter_on_currently_loading_frame</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gdk_pixbuf_animation_iter_on_currently_loading_frame
341
(<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);</programlisting>
343
Used to determine how to respond to the area_updated signal on
344
<link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link> when loading an animation. area_updated is emitted
345
for an area of the frame currently streaming in to the loader. So if
346
you're on the currently loading frame, you need to redraw the screen for
347
the updated area.</para>
350
</para><variablelist role="params">
351
<varlistentry><term><parameter>iter</parameter> :</term>
352
<listitem><simpara> a <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link>
353
</simpara></listitem></varlistentry>
354
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the frame we're on is partially loaded, or the last frame
355
</simpara></listitem></varlistentry>
356
</variablelist></refsect2>
358
<title><anchor id="gdk-pixbuf-animation-iter-get-pixbuf" role="function"/>gdk_pixbuf_animation_iter_get_pixbuf ()</title>
359
<indexterm><primary>gdk_pixbuf_animation_iter_get_pixbuf</primary></indexterm><programlisting><link linkend="GdkPixbuf">GdkPixbuf</link>* gdk_pixbuf_animation_iter_get_pixbuf
360
(<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);</programlisting>
362
Gets the current pixbuf which should be displayed; the pixbuf will
363
be the same size as the animation itself
364
(<link linkend="gdk-pixbuf-animation-get-width"><function>gdk_pixbuf_animation_get_width()</function></link>, <link linkend="gdk-pixbuf-animation-get-height"><function>gdk_pixbuf_animation_get_height()</function></link>).
365
This pixbuf should be displayed for
366
<link linkend="gdk-pixbuf-animation-iter-get-delay-time"><function>gdk_pixbuf_animation_iter_get_delay_time()</function></link> milliseconds. The caller
367
of this function does not own a reference to the returned pixbuf;
368
the returned pixbuf will become invalid when the iterator advances
369
to the next frame, which may happen anytime you call
370
<link linkend="gdk-pixbuf-animation-iter-advance"><function>gdk_pixbuf_animation_iter_advance()</function></link>. Copy the pixbuf to keep it
371
(don't just add a reference), as it may get recycled as you advance
375
</para><variablelist role="params">
376
<varlistentry><term><parameter>iter</parameter> :</term>
377
<listitem><simpara> an animation iterator
378
</simpara></listitem></varlistentry>
379
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the pixbuf to be displayed
380
</simpara></listitem></varlistentry>
381
</variablelist></refsect2>
383
<title><anchor id="GdkPixbufSimpleAnim" role="struct"/>GdkPixbufSimpleAnim</title>
384
<indexterm><primary>GdkPixbufSimpleAnim</primary></indexterm><programlisting>typedef struct _GdkPixbufSimpleAnim GdkPixbufSimpleAnim;</programlisting>
389
<title><anchor id="gdk-pixbuf-simple-anim-new" role="function" condition="since:2.8"/>gdk_pixbuf_simple_anim_new ()</title>
390
<indexterm role="2.8"><primary>gdk_pixbuf_simple_anim_new</primary></indexterm><programlisting><link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link>* gdk_pixbuf_simple_anim_new (<link linkend="gint">gint</link> width,
391
<link linkend="gint">gint</link> height,
392
<link linkend="gfloat">gfloat</link> rate);</programlisting>
394
Creates a new, empty animation.</para>
397
</para><variablelist role="params">
398
<varlistentry><term><parameter>width</parameter> :</term>
399
<listitem><simpara> the width of the animation
400
</simpara></listitem></varlistentry>
401
<varlistentry><term><parameter>height</parameter> :</term>
402
<listitem><simpara> the height of the animation
403
</simpara></listitem></varlistentry>
404
<varlistentry><term><parameter>rate</parameter> :</term>
405
<listitem><simpara> the speed of the animation, in frames per second
406
</simpara></listitem></varlistentry>
407
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link>
409
</simpara></listitem></varlistentry>
410
</variablelist><para role="since">Since 2.8
413
<title><anchor id="gdk-pixbuf-simple-anim-add-frame" role="function" condition="since:2.8"/>gdk_pixbuf_simple_anim_add_frame ()</title>
414
<indexterm role="2.8"><primary>gdk_pixbuf_simple_anim_add_frame</primary></indexterm><programlisting><link linkend="void">void</link> gdk_pixbuf_simple_anim_add_frame (<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> *animation,
415
<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
417
Adds a new frame to <parameter>animation</parameter>. The <parameter>pixbuf</parameter> must
418
have the dimensions specified when the animation
419
was constructed.</para>
422
</para><variablelist role="params">
423
<varlistentry><term><parameter>animation</parameter> :</term>
424
<listitem><simpara> a <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link>
425
</simpara></listitem></varlistentry>
426
<varlistentry><term><parameter>pixbuf</parameter> :</term>
427
<listitem><simpara> the pixbuf to add
428
</simpara></listitem></varlistentry>
429
</variablelist><para role="since">Since 2.8
437
<title>See Also</title>
439
<link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link>