~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gdk-pixbuf/xml/animation.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="gdk-pixbuf-animation">
 
2
<refmeta>
 
3
<refentrytitle role="top_of_page">Animations</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>Animations</refname>
 
10
<refpurpose>Animated images.</refpurpose>
 
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
 
12
</refnamediv>
 
13
 
 
14
<refsynopsisdiv role="synopsis">
 
15
<title role="synopsis.title">Synopsis</title>
 
16
<anchor id="GdkPixbufAnimation"/><anchor id="GdkPixbufAnimationIter"/>
 
17
<synopsis>
 
18
 
 
19
#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;
 
20
 
 
21
 
 
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);
 
44
 
 
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);
 
51
 
 
52
 
 
53
</synopsis>
 
54
</refsynopsisdiv>
 
55
 
 
56
<refsect1 role="object_hierarchy">
 
57
<title role="object_hierarchy.title">Object Hierarchy</title>
 
58
<synopsis>
 
59
 
 
60
  <link linkend="GObject">GObject</link>
 
61
   +----GdkPixbufAnimation
 
62
</synopsis>
 
63
<synopsis>
 
64
 
 
65
  <link linkend="GObject">GObject</link>
 
66
   +----GdkPixbufAnimationIter
 
67
</synopsis>
 
68
 
 
69
</refsect1>
 
70
 
 
71
 
 
72
 
 
73
 
 
74
 
 
75
 
 
76
 
 
77
 
 
78
<refsect1 role="desc">
 
79
<title role="desc.title">Description</title>
 
80
  <para>
 
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. 
 
88
  </para>
 
89
</refsect1>
 
90
 
 
91
<refsect1 role="details">
 
92
<title role="details.title">Details</title>
 
93
<refsect2>
 
94
<title><anchor id="GdkPixbufAnimation-struct" role="struct"/>GdkPixbufAnimation</title>
 
95
<indexterm><primary>GdkPixbufAnimation</primary></indexterm><programlisting>typedef struct _GdkPixbufAnimation GdkPixbufAnimation;</programlisting>
 
96
<para>
 
97
And opaque struct representing an animation.
 
98
</para></refsect2>
 
99
<refsect2>
 
100
<title><anchor id="GdkPixbufAnimationIter-struct" role="struct"/>GdkPixbufAnimationIter</title>
 
101
<indexterm><primary>GdkPixbufAnimationIter</primary></indexterm><programlisting>typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;</programlisting>
 
102
<para>
 
103
And opaque struct representing an iterator which points to a
 
104
certain position in an animation.
 
105
</para></refsect2>
 
106
<refsect2>
 
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>
 
110
<para>
 
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>
 
115
<para>
 
116
 
 
117
</para><variablelist role="params">
 
118
<varlistentry><term><parameter>filename</parameter>&nbsp;:</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>&nbsp;:</term>
 
122
<listitem><simpara> return location for error
 
123
</simpara></listitem></varlistentry>
 
124
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
130
<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>
 
134
<para>
 
135
Adds a reference to an animation.</para>
 
136
<para>
 
137
 
 
138
</para><variablelist role="params">
 
139
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
140
<listitem><simpara> An animation.
 
141
</simpara></listitem></varlistentry>
 
142
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The same as the <parameter>animation</parameter> argument.
 
143
 
 
144
</simpara></listitem></varlistentry>
 
145
</variablelist></refsect2>
 
146
<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>
 
150
<para>
 
151
Removes a reference from an animation.</para>
 
152
<para>
 
153
 
 
154
</para><variablelist role="params">
 
155
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
156
<listitem><simpara> An animation.
 
157
</simpara></listitem></varlistentry>
 
158
</variablelist></refsect2>
 
159
<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>
 
162
<para>
 
163
Queries the width of the bounding box of a pixbuf animation.</para>
 
164
<para>
 
165
 
 
166
</para><variablelist role="params">
 
167
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
168
<listitem><simpara> An animation.
 
169
</simpara></listitem></varlistentry>
 
170
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> Width of the bounding box of the animation.
 
171
</simpara></listitem></varlistentry>
 
172
</variablelist></refsect2>
 
173
<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>
 
176
<para>
 
177
Queries the height of the bounding box of a pixbuf animation.</para>
 
178
<para>
 
179
 
 
180
</para><variablelist role="params">
 
181
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
182
<listitem><simpara> An animation.
 
183
</simpara></listitem></varlistentry>
 
184
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> Height of the bounding box of the animation.
 
185
</simpara></listitem></varlistentry>
 
186
</variablelist></refsect2>
 
187
<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>
 
191
<para>
 
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>.
 
195
</para>
 
196
<para>
 
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.
 
206
</para>
 
207
<para>
 
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.
 
210
</para>
 
211
<para>
 
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>.
 
215
</para>
 
216
<para>
 
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
 
226
area_updated signal.
 
227
</para>
 
228
<para>
 
229
A delay time of -1 is possible, indicating "infinite."</para>
 
230
<para>
 
231
 
 
232
</para><variablelist role="params">
 
233
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
234
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
 
235
</simpara></listitem></varlistentry>
 
236
<varlistentry><term><parameter>start_time</parameter>&nbsp;:</term>
 
237
<listitem><simpara> time when the animation starts playing
 
238
</simpara></listitem></varlistentry>
 
239
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an iterator to move over the animation
 
240
</simpara></listitem></varlistentry>
 
241
</variablelist></refsect2>
 
242
<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>
 
246
<para>
 
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
 
250
the image.</para>
 
251
<para>
 
252
 
 
253
</para><variablelist role="params">
 
254
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
255
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
 
256
</simpara></listitem></varlistentry>
 
257
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
260
<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>
 
264
<para>
 
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>
 
271
<para>
 
272
 
 
273
</para><variablelist role="params">
 
274
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
275
<listitem><simpara> a <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link>
 
276
</simpara></listitem></varlistentry>
 
277
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> unanimated image representing the animation
 
278
</simpara></listitem></varlistentry>
 
279
</variablelist></refsect2>
 
280
<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>
 
284
<para>
 
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>.
 
287
</para>
 
288
<para>
 
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
 
294
play forward.
 
295
</para>
 
296
<para>
 
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
 
300
at double speed.
 
301
</para>
 
302
<para>
 
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>
 
307
<para>
 
308
 
 
309
</para><variablelist role="params">
 
310
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
 
311
<listitem><simpara> a <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link>
 
312
</simpara></listitem></varlistentry>
 
313
<varlistentry><term><parameter>current_time</parameter>&nbsp;:</term>
 
314
<listitem><simpara> current time
 
315
</simpara></listitem></varlistentry>
 
316
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the image may need updating
 
317
 
 
318
</simpara></listitem></varlistentry>
 
319
</variablelist></refsect2>
 
320
<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>
 
324
<para>
 
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>
 
329
<para>
 
330
 
 
331
</para><variablelist role="params">
 
332
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
 
333
<listitem><simpara> an animation iterator
 
334
</simpara></listitem></varlistentry>
 
335
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> delay time in milliseconds (thousandths of a second)
 
336
</simpara></listitem></varlistentry>
 
337
</variablelist></refsect2>
 
338
<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>
 
342
<para>
 
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>
 
348
<para>
 
349
 
 
350
</para><variablelist role="params">
 
351
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
 
352
<listitem><simpara> a <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link>
 
353
</simpara></listitem></varlistentry>
 
354
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
357
<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>
 
361
<para>
 
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
 
372
the iterator.</para>
 
373
<para>
 
374
 
 
375
</para><variablelist role="params">
 
376
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
 
377
<listitem><simpara> an animation iterator
 
378
</simpara></listitem></varlistentry>
 
379
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the pixbuf to be displayed
 
380
</simpara></listitem></varlistentry>
 
381
</variablelist></refsect2>
 
382
<refsect2>
 
383
<title><anchor id="GdkPixbufSimpleAnim" role="struct"/>GdkPixbufSimpleAnim</title>
 
384
<indexterm><primary>GdkPixbufSimpleAnim</primary></indexterm><programlisting>typedef struct _GdkPixbufSimpleAnim GdkPixbufSimpleAnim;</programlisting>
 
385
<para>
 
386
An
 
387
</para></refsect2>
 
388
<refsect2>
 
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>
 
393
<para>
 
394
Creates a new, empty animation.</para>
 
395
<para>
 
396
 
 
397
</para><variablelist role="params">
 
398
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
 
399
<listitem><simpara> the width of the animation
 
400
</simpara></listitem></varlistentry>
 
401
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
 
402
<listitem><simpara> the height of the animation
 
403
</simpara></listitem></varlistentry>
 
404
<varlistentry><term><parameter>rate</parameter>&nbsp;:</term>
 
405
<listitem><simpara> the speed of the animation, in frames per second
 
406
</simpara></listitem></varlistentry>
 
407
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link> 
 
408
 
 
409
</simpara></listitem></varlistentry>
 
410
</variablelist><para role="since">Since  2.8
 
411
</para></refsect2>
 
412
<refsect2>
 
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>
 
416
<para>
 
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>
 
420
<para>
 
421
 
 
422
</para><variablelist role="params">
 
423
<varlistentry><term><parameter>animation</parameter>&nbsp;:</term>
 
424
<listitem><simpara> a <link linkend="GdkPixbufSimpleAnim"><type>GdkPixbufSimpleAnim</type></link>
 
425
</simpara></listitem></varlistentry>
 
426
<varlistentry><term><parameter>pixbuf</parameter>&nbsp;:</term>
 
427
<listitem><simpara> the pixbuf to add 
 
428
</simpara></listitem></varlistentry>
 
429
</variablelist><para role="since">Since  2.8
 
430
</para></refsect2>
 
431
 
 
432
</refsect1>
 
433
 
 
434
 
 
435
 
 
436
<refsect1>
 
437
<title>See Also</title>
 
438
  <para>
 
439
    <link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link>
 
440
  </para>
 
441
</refsect1>
 
442
 
 
443
</refentry>