<?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>
