~bratsche/ubuntu/maverick/gtk+2.0/menu-activation-fix

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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">

<!ENTITY gdk-pixbuf "<application>gdk-pixbuf</application>">
<!ENTITY Imlib "<application>Imlib</application>">
]>
<refentry id="gdk-pixbuf-animation">
<refmeta>
<refentrytitle role="top_of_page" id="gdk-pixbuf-animation.top_of_page">Animations</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Animations</refname>
<refpurpose>Animated images.</refpurpose>
</refnamediv>

<refsynopsisdiv id="gdk-pixbuf-animation.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="GdkPixbufAnimation"/><anchor id="GdkPixbufAnimationIter"/>
<synopsis>

#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;

                    <link linkend="GdkPixbufAnimation-struct">GdkPixbufAnimation</link>;
                    <link linkend="GdkPixbufAnimationIter-struct">GdkPixbufAnimationIter</link>;
<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,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> * <link linkend="gdk-pixbuf-animation-ref">gdk_pixbuf_animation_ref</link>           (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
<link linkend="void">void</link>                <link linkend="gdk-pixbuf-animation-unref">gdk_pixbuf_animation_unref</link>          (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
<link linkend="int">int</link>                 <link linkend="gdk-pixbuf-animation-get-width">gdk_pixbuf_animation_get_width</link>      (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
<link linkend="int">int</link>                 <link linkend="gdk-pixbuf-animation-get-height">gdk_pixbuf_animation_get_height</link>     (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> * <link linkend="gdk-pixbuf-animation-get-iter">gdk_pixbuf_animation_get_iter</link>  (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation,
                                                         const <link linkend="GTimeVal">GTimeVal</link> *start_time);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-pixbuf-animation-is-static-image">gdk_pixbuf_animation_is_static_image</link>
                                                        (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
<link linkend="GdkPixbuf">GdkPixbuf</link> *         <link linkend="gdk-pixbuf-animation-get-static-image">gdk_pixbuf_animation_get_static_image</link>
                                                        (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-pixbuf-animation-iter-advance">gdk_pixbuf_animation_iter_advance</link>   (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter,
                                                         const <link linkend="GTimeVal">GTimeVal</link> *current_time);
<link linkend="int">int</link>                 <link linkend="gdk-pixbuf-animation-iter-get-delay-time">gdk_pixbuf_animation_iter_get_delay_time</link>
                                                        (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-pixbuf-animation-iter-on-currently-loading-frame">gdk_pixbuf_animation_iter_on_currently_loading_frame</link>
                                                        (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);
<link linkend="GdkPixbuf">GdkPixbuf</link> *         <link linkend="gdk-pixbuf-animation-iter-get-pixbuf">gdk_pixbuf_animation_iter_get_pixbuf</link>
                                                        (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);

                    <link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link>;
<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> * <link linkend="gdk-pixbuf-simple-anim-new">gdk_pixbuf_simple_anim_new</link>        (<link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="gfloat">gfloat</link> rate);
<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,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
<link linkend="void">void</link>                <link linkend="gdk-pixbuf-simple-anim-set-loop">gdk_pixbuf_simple_anim_set_loop</link>     (<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> *animation,
                                                         <link linkend="gboolean">gboolean</link> loop);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-pixbuf-simple-anim-get-loop">gdk_pixbuf_simple_anim_get_loop</link>     (<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> *animation);
</synopsis>
</refsynopsisdiv>

<refsect1 id="gdk-pixbuf-animation.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GdkPixbufAnimation
</synopsis>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GdkPixbufAnimationIter
</synopsis>
</refsect1>








<refsect1 id="gdk-pixbuf-animation.description" role="desc">
<title role="desc.title">Description</title>
  <para>
    The &gdk-pixbuf; library provides a simple mechanism to load and represent
    animations. An animation is conceptually a series of frames to be displayed
    over time. Each frame is the same size. The animation may not be represented
    as a series of frames internally; for example, it may be stored as a
    sprite and instructions for moving the sprite around a background. To display
    an animation you don't need to understand its representation, however; you just
    ask &gdk-pixbuf; what should be displayed at a given point in time.
  </para>
</refsect1>

<refsect1 id="gdk-pixbuf-animation.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GdkPixbufAnimation-struct" role="struct">
<title>GdkPixbufAnimation</title>
<indexterm zone="GdkPixbufAnimation-struct"><primary>GdkPixbufAnimation</primary></indexterm><programlisting>typedef struct _GdkPixbufAnimation GdkPixbufAnimation;</programlisting>
<para>
An opaque struct representing an animation.
</para></refsect2>
<refsect2 id="GdkPixbufAnimationIter-struct" role="struct">
<title>GdkPixbufAnimationIter</title>
<indexterm zone="GdkPixbufAnimationIter-struct"><primary>GdkPixbufAnimationIter</primary></indexterm><programlisting>typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;</programlisting>
<para>
An opaque struct representing an iterator which points to a
certain position in an animation.
</para></refsect2>
<refsect2 id="gdk-pixbuf-animation-new-from-file" role="function">
<title>gdk_pixbuf_animation_new_from_file ()</title>
<indexterm zone="gdk-pixbuf-animation-new-from-file"><primary sortas="animation_new_from_file">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,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Creates a new animation by loading it from a file.  The file format is
detected automatically.  If the file's format does not support multi-frame
images, then an animation with a single frame will be created. Possible errors
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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> Name of file to load, in the GLib file name encoding
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for error
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A newly-created animation with a reference count of 1, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
if any of several error conditions ocurred:  the file could not be opened,
there was no loader for the file's format, there was not enough memory to
allocate the image buffer, or the image file contained invalid data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-ref" role="function" condition="deprecated:Use g_object_ref().">
<title>gdk_pixbuf_animation_ref ()</title>
<indexterm zone="gdk-pixbuf-animation-ref" role="deprecated"><primary sortas="animation_ref">gdk_pixbuf_animation_ref</primary></indexterm><programlisting><link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> * gdk_pixbuf_animation_ref           (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
<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>
<para>
Adds a reference to an animation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> An animation.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The same as the <parameter>animation</parameter> argument.

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-unref" role="function" condition="deprecated:Use g_object_unref().">
<title>gdk_pixbuf_animation_unref ()</title>
<indexterm zone="gdk-pixbuf-animation-unref" role="deprecated"><primary sortas="animation_unref">gdk_pixbuf_animation_unref</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_pixbuf_animation_unref          (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
<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>
<para>
Removes a reference from an animation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> An animation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-get-width" role="function">
<title>gdk_pixbuf_animation_get_width ()</title>
<indexterm zone="gdk-pixbuf-animation-get-width"><primary sortas="animation_get_width">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>
<para>
Queries the width of the bounding box of a pixbuf animation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> An animation.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Width of the bounding box of the animation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-get-height" role="function">
<title>gdk_pixbuf_animation_get_height ()</title>
<indexterm zone="gdk-pixbuf-animation-get-height"><primary sortas="animation_get_height">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>
<para>
Queries the height of the bounding box of a pixbuf animation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> An animation.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Height of the bounding box of the animation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-get-iter" role="function">
<title>gdk_pixbuf_animation_get_iter ()</title>
<indexterm zone="gdk-pixbuf-animation-get-iter"><primary sortas="animation_get_iter">gdk_pixbuf_animation_get_iter</primary></indexterm><programlisting><link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> * gdk_pixbuf_animation_get_iter  (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation,
                                                         const <link linkend="GTimeVal">GTimeVal</link> *start_time);</programlisting>
<para>
Get an iterator for displaying an animation. The iterator provides
the frames that should be displayed at a given time.
It should be freed after use with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
</para>
<para>
<parameter>start_time</parameter> would normally come from <link linkend="g-get-current-time"><function>g_get_current_time()</function></link>, and
marks the beginning of animation playback. After creating an
iterator, you should immediately display the pixbuf returned by
<link linkend="gdk-pixbuf-animation-iter-get-pixbuf"><function>gdk_pixbuf_animation_iter_get_pixbuf()</function></link>. Then, you should install a
timeout (with <link linkend="g-timeout-add"><function>g_timeout_add()</function></link>) or by some other mechanism ensure
that you'll update the image after
<link linkend="gdk-pixbuf-animation-iter-get-delay-time"><function>gdk_pixbuf_animation_iter_get_delay_time()</function></link> milliseconds. Each time
the image is updated, you should reinstall the timeout with the new,
possibly-changed delay time.
</para>
<para>
As a shortcut, if <parameter>start_time</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, the result of
<link linkend="g-get-current-time"><function>g_get_current_time()</function></link> will be used automatically.
</para>
<para>
To update the image (i.e. possibly change the result of
<link linkend="gdk-pixbuf-animation-iter-get-pixbuf"><function>gdk_pixbuf_animation_iter_get_pixbuf()</function></link> to a new frame of the animation),
call <link linkend="gdk-pixbuf-animation-iter-advance"><function>gdk_pixbuf_animation_iter_advance()</function></link>.
</para>
<para>
If you're using <link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link>, in addition to updating the image
after the delay time, you should also update it whenever you
receive the area_updated signal and
<link linkend="gdk-pixbuf-animation-iter-on-currently-loading-frame"><function>gdk_pixbuf_animation_iter_on_currently_loading_frame()</function></link> returns
<link linkend="TRUE--CAPS"><literal>TRUE</literal></link>. In this case, the frame currently being fed into the loader
has received new data, so needs to be refreshed. The delay time for
a frame may also be modified after an area_updated signal, for
example if the delay time for a frame is encoded in the data after
the frame itself. So your timeout should be reinstalled after any
area_updated signal.
</para>
<para>
A delay time of -1 is possible, indicating "infinite."</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start_time</parameter>&#160;:</term>
<listitem><simpara> time when the animation starts playing
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an iterator to move over the animation
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-is-static-image" role="function">
<title>gdk_pixbuf_animation_is_static_image ()</title>
<indexterm zone="gdk-pixbuf-animation-is-static-image"><primary sortas="animation_is_static_image">gdk_pixbuf_animation_is_static_image</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_pixbuf_animation_is_static_image
                                                        (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
<para>
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
out to be a plain, unanimated image, then this function will return
<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
the image.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the "animation" was really just an image
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-get-static-image" role="function">
<title>gdk_pixbuf_animation_get_static_image ()</title>
<indexterm zone="gdk-pixbuf-animation-get-static-image"><primary sortas="animation_get_static_image">gdk_pixbuf_animation_get_static_image</primary></indexterm><programlisting><link linkend="GdkPixbuf">GdkPixbuf</link> *         gdk_pixbuf_animation_get_static_image
                                                        (<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> *animation);</programlisting>
<para>
If an animation is really just a plain image (has only one frame),
this function returns that image. If the animation is an animation,
this function returns a reasonable thing to display as a static
unanimated image, which might be the first frame, or something more
sophisticated. If an animation hasn't loaded any frames yet, this
function will return <link linkend="NULL--CAPS"><literal>NULL</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> unanimated image representing the animation
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-iter-advance" role="function">
<title>gdk_pixbuf_animation_iter_advance ()</title>
<indexterm zone="gdk-pixbuf-animation-iter-advance"><primary sortas="animation_iter_advance">gdk_pixbuf_animation_iter_advance</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_pixbuf_animation_iter_advance   (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter,
                                                         const <link linkend="GTimeVal">GTimeVal</link> *current_time);</programlisting>
<para>
Possibly advances an animation to a new frame. Chooses the frame based
on the start time passed to <link linkend="gdk-pixbuf-animation-get-iter"><function>gdk_pixbuf_animation_get_iter()</function></link>.
</para>
<para>
<parameter>current_time</parameter> would normally come from <link linkend="g-get-current-time"><function>g_get_current_time()</function></link>, and
must be greater than or equal to the time passed to
<link linkend="gdk-pixbuf-animation-get-iter"><function>gdk_pixbuf_animation_get_iter()</function></link>, and must increase or remain
unchanged each time <link linkend="gdk-pixbuf-animation-iter-get-pixbuf"><function>gdk_pixbuf_animation_iter_get_pixbuf()</function></link> is
called. That is, you can't go backward in time; animations only
play forward.
</para>
<para>
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>
will be invoked on your behalf. So you only need to explicitly pass
<parameter>current_time</parameter> if you're doing something odd like playing the animation
at double speed.
</para>
<para>
If this function returns <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, there's no need to update the animation
display, assuming the display had been rendered prior to advancing;
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
display with the new pixbuf.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>current_time</parameter>&#160;:</term>
<listitem><simpara> current time
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the image may need updating

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-iter-get-delay-time" role="function">
<title>gdk_pixbuf_animation_iter_get_delay_time ()</title>
<indexterm zone="gdk-pixbuf-animation-iter-get-delay-time"><primary sortas="animation_iter_get_delay_time">gdk_pixbuf_animation_iter_get_delay_time</primary></indexterm><programlisting><link linkend="int">int</link>                 gdk_pixbuf_animation_iter_get_delay_time
                                                        (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);</programlisting>
<para>
Gets the number of milliseconds the current pixbuf should be displayed,
or -1 if the current pixbuf should be displayed forever. <link linkend="g-timeout-add"><function>g_timeout_add()</function></link>
conveniently takes a timeout in milliseconds, so you can use a timeout
to schedule the next update.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an animation iterator
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> delay time in milliseconds (thousandths of a second)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-iter-on-currently-loading-frame" role="function">
<title>gdk_pixbuf_animation_iter_on_currently_loading_frame ()</title>
<indexterm zone="gdk-pixbuf-animation-iter-on-currently-loading-frame"><primary sortas="animation_iter_on_currently_loading_frame">gdk_pixbuf_animation_iter_on_currently_loading_frame</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_pixbuf_animation_iter_on_currently_loading_frame
                                                        (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);</programlisting>
<para>
Used to determine how to respond to the area_updated signal on
<link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link> when loading an animation. area_updated is emitted
for an area of the frame currently streaming in to the loader. So if
you're on the currently loading frame, you need to redraw the screen for
the updated area.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the frame we're on is partially loaded, or the last frame
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-animation-iter-get-pixbuf" role="function">
<title>gdk_pixbuf_animation_iter_get_pixbuf ()</title>
<indexterm zone="gdk-pixbuf-animation-iter-get-pixbuf"><primary sortas="animation_iter_get_pixbuf">gdk_pixbuf_animation_iter_get_pixbuf</primary></indexterm><programlisting><link linkend="GdkPixbuf">GdkPixbuf</link> *         gdk_pixbuf_animation_iter_get_pixbuf
                                                        (<link linkend="GdkPixbufAnimationIter">GdkPixbufAnimationIter</link> *iter);</programlisting>
<para>
Gets the current pixbuf which should be displayed; the pixbuf will
be the same size as the animation itself
(<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>). 
This pixbuf should be displayed for 
<link linkend="gdk-pixbuf-animation-iter-get-delay-time"><function>gdk_pixbuf_animation_iter_get_delay_time()</function></link> milliseconds.  The caller
of this function does not own a reference to the returned pixbuf;
the returned pixbuf will become invalid when the iterator advances
to the next frame, which may happen anytime you call
<link linkend="gdk-pixbuf-animation-iter-advance"><function>gdk_pixbuf_animation_iter_advance()</function></link>. Copy the pixbuf to keep it
(don't just add a reference), as it may get recycled as you advance
the iterator.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an animation iterator
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pixbuf to be displayed
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkPixbufSimpleAnim" role="struct">
<title>GdkPixbufSimpleAnim</title>
<indexterm zone="GdkPixbufSimpleAnim"><primary>GdkPixbufSimpleAnim</primary></indexterm><programlisting>typedef struct _GdkPixbufSimpleAnim GdkPixbufSimpleAnim;</programlisting>
<para>
An opaque struct representing a simple animation.
</para></refsect2>
<refsect2 id="gdk-pixbuf-simple-anim-new" role="function" condition="since:2.8">
<title>gdk_pixbuf_simple_anim_new ()</title>
<indexterm zone="gdk-pixbuf-simple-anim-new" role="2.8"><primary sortas="simple_anim_new">gdk_pixbuf_simple_anim_new</primary></indexterm><programlisting><link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> * gdk_pixbuf_simple_anim_new        (<link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="gfloat">gfloat</link> rate);</programlisting>
<para>
Creates a new, empty animation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> the width of the animation
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> the height of the animation
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rate</parameter>&#160;:</term>
<listitem><simpara> the speed of the animation, in frames per second
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link> 

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="gdk-pixbuf-simple-anim-add-frame" role="function" condition="since:2.8">
<title>gdk_pixbuf_simple_anim_add_frame ()</title>
<indexterm zone="gdk-pixbuf-simple-anim-add-frame" role="2.8"><primary sortas="simple_anim_add_frame">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,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
<para>
Adds a new frame to <parameter>animation</parameter>. The <parameter>pixbuf</parameter> must
have the dimensions specified when the animation 
was constructed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pixbuf</parameter>&#160;:</term>
<listitem><simpara> the pixbuf to add 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="gdk-pixbuf-simple-anim-set-loop" role="function" condition="since:2.18">
<title>gdk_pixbuf_simple_anim_set_loop ()</title>
<indexterm zone="gdk-pixbuf-simple-anim-set-loop" role="2.18"><primary sortas="simple_anim_set_loop">gdk_pixbuf_simple_anim_set_loop</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_pixbuf_simple_anim_set_loop     (<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> *animation,
                                                         <link linkend="gboolean">gboolean</link> loop);</programlisting>
<para>
Sets whether <parameter>animation</parameter> should loop indefinitely when it reaches the end.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara> whether to loop the animation
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="gdk-pixbuf-simple-anim-get-loop" role="function" condition="since:2.18">
<title>gdk_pixbuf_simple_anim_get_loop ()</title>
<indexterm zone="gdk-pixbuf-simple-anim-get-loop" role="2.18"><primary sortas="simple_anim_get_loop">gdk_pixbuf_simple_anim_get_loop</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_pixbuf_simple_anim_get_loop     (<link linkend="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</link> *animation);</programlisting>
<para>
Gets whether <parameter>animation</parameter> should loop indefinitely when it reaches the end.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>animation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the animation loops forever, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>

</refsect1>



<refsect1 id="gdk-pixbuf-animation.see-also">
<title>See Also</title>
  <para>
    <link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link>
  </para>
</refsect1>

</refentry>