<?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="GdkPixbufLoader">
<refmeta>
<refentrytitle role="top_of_page" id="GdkPixbufLoader.top_of_page">GdkPixbufLoader</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GdkPixbufLoader</refname>
<refpurpose>Application-driven progressive image loading.</refpurpose>
</refnamediv>

<refsynopsisdiv id="GdkPixbufLoader.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

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

                    <link linkend="GdkPixbufLoader-struct">GdkPixbufLoader</link>;
<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *   <link linkend="gdk-pixbuf-loader-new">gdk_pixbuf_loader_new</link>               (void);
<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *   <link linkend="gdk-pixbuf-loader-new-with-type">gdk_pixbuf_loader_new_with_type</link>     (const <link linkend="char">char</link> *image_type,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *   <link linkend="gdk-pixbuf-loader-new-with-mime-type">gdk_pixbuf_loader_new_with_mime_type</link>
                                                        (const <link linkend="char">char</link> *mime_type,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GdkPixbufFormat">GdkPixbufFormat</link> *   <link linkend="gdk-pixbuf-loader-get-format">gdk_pixbuf_loader_get_format</link>        (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-pixbuf-loader-write">gdk_pixbuf_loader_write</link>             (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gsize">gsize</link> count,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="gdk-pixbuf-loader-set-size">gdk_pixbuf_loader_set_size</link>          (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                         <link linkend="int">int</link> width,
                                                         <link linkend="int">int</link> height);
<link linkend="GdkPixbuf">GdkPixbuf</link> *         <link linkend="gdk-pixbuf-loader-get-pixbuf">gdk_pixbuf_loader_get_pixbuf</link>        (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader);
<link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> * <link linkend="gdk-pixbuf-loader-get-animation">gdk_pixbuf_loader_get_animation</link>    (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-pixbuf-loader-close">gdk_pixbuf_loader_close</link>             (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                         <link linkend="GError">GError</link> **error);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GdkPixbufLoader.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GdkPixbufLoader
</synopsis>
</refsect1>






<refsect1 id="GdkPixbufLoader.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GdkPixbufLoader-area-prepared">area-prepared</link>&quot;                                  : Run Last
  &quot;<link linkend="GdkPixbufLoader-area-updated">area-updated</link>&quot;                                   : Run Last
  &quot;<link linkend="GdkPixbufLoader-closed">closed</link>&quot;                                         : Run Last
  &quot;<link linkend="GdkPixbufLoader-size-prepared">size-prepared</link>&quot;                                  : Run Last
</synopsis>
</refsect1>


<refsect1 id="GdkPixbufLoader.description" role="desc">
<title role="desc.title">Description</title>
  <para>
    <link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link> provides a way for applications to drive the
    process of loading an image, by letting them send the image data
    directly to the loader instead of having the loader read the data
    from a file.  Applications can use this functionality instead of
    <link linkend="gdk-pixbuf-new-from-file"><function>gdk_pixbuf_new_from_file()</function></link> or <link linkend="gdk-pixbuf-animation-new-from-file"><function>gdk_pixbuf_animation_new_from_file()</function></link>
    when they need to parse image data in
    small chunks.  For example, it should be used when reading an
    image from a (potentially) slow network connection, or when
    loading an extremely large file.
  </para>
  <para>
    To use <link linkend="GdkPixbufLoader"><type>GdkPixbufLoader</type></link> to load an image, just create a new one,
    and call <link linkend="gdk-pixbuf-loader-write"><function>gdk_pixbuf_loader_write()</function></link> to send the data to it.  When
    done, <link linkend="gdk-pixbuf-loader-close"><function>gdk_pixbuf_loader_close()</function></link> should be called to end the stream
    and finalize everything.  The loader will emit three important
    signals throughout the process.  The first, "<link
    linkend="GdkPixbufLoader-size-prepared">size_prepared</link>",
    will be called as soon as the image has enough information to
    determine the size of the image to be used. If you want to scale
    the image while loading it, you can call <link linkend="gdk-pixbuf-loader-set-size"><function>gdk_pixbuf_loader_set_size()</function></link>
    in response to this signal.
    </para>
    <para>The second signal, "<link
    linkend="GdkPixbufLoader-area-prepared">area_prepared</link>",
    will be called as soon as the pixbuf of the desired has been
    allocated.  You can obtain it by calling <link linkend="gdk-pixbuf-loader-get-pixbuf"><function>gdk_pixbuf_loader_get_pixbuf()</function></link>.
    If you want to use it, simply ref it.
    In addition, no actual information will be passed in yet, so the
    pixbuf can be safely filled with any temporary graphics (or an
    initial color) as needed.  You can also call
    <link linkend="gdk-pixbuf-loader-get-pixbuf"><function>gdk_pixbuf_loader_get_pixbuf()</function></link> later and get the same pixbuf.
  </para>
  <para>
    The last signal, "<link
    linkend="GdkPixbufLoader-area-updated">area_updated</link>" gets
    called every time a region is updated.  This way you can update a
    partially completed image.  Note that you do not know anything
    about the completeness of an image from the area updated.  For
    example, in an interlaced image, you need to make several passes
    before the image is done loading.
  </para>
  <refsect2>
    <title>Loading an animation</title>
    <para>
      Loading an animation is almost as easy as loading an
      image.  Once the first "<link
      linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" signal
      has been emitted, you can call <link linkend="gdk-pixbuf-loader-get-animation"><function>gdk_pixbuf_loader_get_animation()</function></link>
      to get the <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link> struct and <link linkend="gdk-pixbuf-animation-get-iter"><function>gdk_pixbuf_animation_get_iter()</function></link>
      to get an <link linkend="GdkPixbufAnimationIter"><type>GdkPixbufAnimationIter</type></link> for displaying it.
    </para>
  </refsect2>
</refsect1>

<refsect1 id="GdkPixbufLoader.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GdkPixbufLoader-struct" role="struct">
<title>GdkPixbufLoader</title>
<indexterm zone="GdkPixbufLoader-struct"><primary>GdkPixbufLoader</primary></indexterm><programlisting>typedef struct _GdkPixbufLoader GdkPixbufLoader;</programlisting>
<para>
The <structname>GdkPixbufLoader</structname> struct contains only private
fields.
</para></refsect2>
<refsect2 id="gdk-pixbuf-loader-new" role="function">
<title>gdk_pixbuf_loader_new ()</title>
<indexterm zone="gdk-pixbuf-loader-new"><primary sortas="loader_new">gdk_pixbuf_loader_new</primary></indexterm><programlisting><link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *   gdk_pixbuf_loader_new               (void);</programlisting>
<para>
Creates a new pixbuf loader object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A newly-created pixbuf loader.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-loader-new-with-type" role="function">
<title>gdk_pixbuf_loader_new_with_type ()</title>
<indexterm zone="gdk-pixbuf-loader-new-with-type"><primary sortas="loader_new_with_type">gdk_pixbuf_loader_new_with_type</primary></indexterm><programlisting><link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *   gdk_pixbuf_loader_new_with_type     (const <link linkend="char">char</link> *image_type,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of type <parameter>image_type</parameter>, instead of
identifying the type automatically. Useful if you want an error if
the image isn't the expected type, for loading image formats
that can't be reliably identified by looking at the data, or if
the user manually forces a specific type.
</para>
<para>
The list of supported image formats depends on what image loaders
are installed, but typically "png", "jpeg", "gif", "tiff" and 
"xpm" are among the supported formats. To obtain the full list of
supported image formats, call <link linkend="gdk-pixbuf-format-get-name"><function>gdk_pixbuf_format_get_name()</function></link> on each 
of the <link linkend="GdkPixbufFormat"><type>GdkPixbufFormat</type></link> structs returned by <link linkend="gdk-pixbuf-get-formats"><function>gdk_pixbuf_get_formats()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>image_type</parameter>&#160;:</term>
<listitem><simpara> name of the image format to be loaded with the image
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for an allocated <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore errors
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A newly-created pixbuf loader.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-loader-new-with-mime-type" role="function" condition="since:2.4">
<title>gdk_pixbuf_loader_new_with_mime_type ()</title>
<indexterm zone="gdk-pixbuf-loader-new-with-mime-type" role="2.4"><primary sortas="loader_new_with_mime_type">gdk_pixbuf_loader_new_with_mime_type</primary></indexterm><programlisting><link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *   gdk_pixbuf_loader_new_with_mime_type
                                                        (const <link linkend="char">char</link> *mime_type,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of mime type <parameter>mime_type</parameter>, instead of
identifying the type automatically. Useful if you want an error if
the image isn't the expected mime type, for loading image formats
that can't be reliably identified by looking at the data, or if
the user manually forces a specific mime type.
</para>
<para>
The list of supported mime types depends on what image loaders
are installed, but typically "image/png", "image/jpeg", "image/gif", 
"image/tiff" and "image/x-xpixmap" are among the supported mime types. 
To obtain the full list of supported mime types, call 
<link linkend="gdk-pixbuf-format-get-mime-types"><function>gdk_pixbuf_format_get_mime_types()</function></link> on each of the <link linkend="GdkPixbufFormat"><type>GdkPixbufFormat</type></link> 
structs returned by <link linkend="gdk-pixbuf-get-formats"><function>gdk_pixbuf_get_formats()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara> the mime type to be loaded 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for an allocated <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore errors
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A newly-created pixbuf loader.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gdk-pixbuf-loader-get-format" role="function" condition="since:2.2">
<title>gdk_pixbuf_loader_get_format ()</title>
<indexterm zone="gdk-pixbuf-loader-get-format" role="2.2"><primary sortas="loader_get_format">gdk_pixbuf_loader_get_format</primary></indexterm><programlisting><link linkend="GdkPixbufFormat">GdkPixbufFormat</link> *   gdk_pixbuf_loader_get_format        (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader);</programlisting>
<para>
Obtains the available information about the format of the 
currently loading image file.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> A pixbuf loader.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A <link linkend="GdkPixbufFormat"><type>GdkPixbufFormat</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link>. The return value is owned 
by GdkPixbuf and should not be freed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-pixbuf-loader-write" role="function">
<title>gdk_pixbuf_loader_write ()</title>
<indexterm zone="gdk-pixbuf-loader-write"><primary sortas="loader_write">gdk_pixbuf_loader_write</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_pixbuf_loader_write             (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gsize">gsize</link> count,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
This will cause a pixbuf loader to parse the next <parameter>count</parameter> bytes of
an image.  It will return <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the data was loaded successfully,
and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if an error occurred.  In the latter case, the loader
will be closed, and will not accept further writes. If <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> is
returned, <parameter>error</parameter> will be set to an error from the <link linkend="GDK-PIXBUF-ERROR--CAPS"><type>GDK_PIXBUF_ERROR</type></link>
or <link linkend="G-FILE-ERROR--CAPS"><type>G_FILE_ERROR</type></link> domains.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> A pixbuf loader.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara> Pointer to image data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara> Length of the <parameter>buf</parameter> buffer in bytes.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for errors
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the write was successful, or <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if the loader
cannot parse the buffer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-loader-set-size" role="function" condition="since:2.2">
<title>gdk_pixbuf_loader_set_size ()</title>
<indexterm zone="gdk-pixbuf-loader-set-size" role="2.2"><primary sortas="loader_set_size">gdk_pixbuf_loader_set_size</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_pixbuf_loader_set_size          (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                         <link linkend="int">int</link> width,
                                                         <link linkend="int">int</link> height);</programlisting>
<para>
Causes the image to be scaled while it is loaded. The desired
image size can be determined relative to the original size of
the image by calling <link linkend="gdk-pixbuf-loader-set-size"><function>gdk_pixbuf_loader_set_size()</function></link> from a
signal handler for the ::size-prepared signal.
</para>
<para>
Attempts to set the desired image size  are ignored after the 
emission of the ::size-prepared signal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> A pixbuf loader.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> The desired width of the image being loaded.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> The desired height of the image being loaded.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-pixbuf-loader-get-pixbuf" role="function">
<title>gdk_pixbuf_loader_get_pixbuf ()</title>
<indexterm zone="gdk-pixbuf-loader-get-pixbuf"><primary sortas="loader_get_pixbuf">gdk_pixbuf_loader_get_pixbuf</primary></indexterm><programlisting><link linkend="GdkPixbuf">GdkPixbuf</link> *         gdk_pixbuf_loader_get_pixbuf        (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader);</programlisting>
<para>
Queries the <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> that a pixbuf loader is currently creating.
In general it only makes sense to call this function after the
"area-prepared" signal has been emitted by the loader; this means
that enough data has been read to know the size of the image that
will be allocated.  If the loader has not received enough data via
<link linkend="gdk-pixbuf-loader-write"><function>gdk_pixbuf_loader_write()</function></link>, then this function returns <link linkend="NULL--CAPS"><literal>NULL</literal></link>.  The
returned pixbuf will be the same in all future calls to the loader,
so simply calling <link linkend="g-object-ref"><function>g_object_ref()</function></link> should be sufficient to continue
using it.  Additionally, if the loader is an animation, it will
return the "static image" of the animation
(see <link linkend="gdk-pixbuf-animation-get-static-image"><function>gdk_pixbuf_animation_get_static_image()</function></link>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> A pixbuf loader.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> that the loader is creating, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if not
enough data has been read to determine how to create the image buffer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-loader-get-animation" role="function">
<title>gdk_pixbuf_loader_get_animation ()</title>
<indexterm zone="gdk-pixbuf-loader-get-animation"><primary sortas="loader_get_animation">gdk_pixbuf_loader_get_animation</primary></indexterm><programlisting><link linkend="GdkPixbufAnimation">GdkPixbufAnimation</link> * gdk_pixbuf_loader_get_animation    (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader);</programlisting>
<para>
Queries the <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link> that a pixbuf loader is currently creating.
In general it only makes sense to call this function after the "area-prepared"
signal has been emitted by the loader. If the loader doesn't have enough
bytes yet (hasn't emitted the "area-prepared" signal) this function will 
return <link linkend="NULL--CAPS"><literal>NULL</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> A pixbuf loader
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The <link linkend="GdkPixbufAnimation"><type>GdkPixbufAnimation</type></link> that the loader is loading, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if
 not enough data has been read to determine the information.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-pixbuf-loader-close" role="function">
<title>gdk_pixbuf_loader_close ()</title>
<indexterm zone="gdk-pixbuf-loader-close"><primary sortas="loader_close">gdk_pixbuf_loader_close</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_pixbuf_loader_close             (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Informs a pixbuf loader that no further writes with
<link linkend="gdk-pixbuf-loader-write"><function>gdk_pixbuf_loader_write()</function></link> will occur, so that it can free its
internal loading structures. Also, tries to parse any data that
hasn't yet been parsed; if the remaining data is partial or
corrupt, an error will be returned.  If <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> is returned, <parameter>error</parameter>
will be set to an error from the <link linkend="GDK-PIXBUF-ERROR--CAPS"><type>GDK_PIXBUF_ERROR</type></link> or <link linkend="G-FILE-ERROR--CAPS"><type>G_FILE_ERROR</type></link>
domains. If you're just cancelling a load rather than expecting it
to be finished, passing <link linkend="NULL--CAPS"><literal>NULL</literal></link> for <parameter>error</parameter> to ignore it is
reasonable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> A pixbuf loader.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore errors
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if all image data written so far was successfully
            passed out via the update_area signal
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

<refsect1 id="GdkPixbufLoader.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GdkPixbufLoader-area-prepared" role="signal"><title>The <literal>&quot;area-prepared&quot;</literal> signal</title>
<indexterm zone="GdkPixbufLoader-area-prepared"><primary>GdkPixbufLoader::area-prepared</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
This signal is emitted when the pixbuf loader has allocated the
pixbuf in the desired size.  After this signal is emitted, 
applications can call <link linkend="gdk-pixbuf-loader-get-pixbuf"><function>gdk_pixbuf_loader_get_pixbuf()</function></link> to fetch 
the partially-loaded pixbuf.</para>
  <para>
  </para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GdkPixbufLoader-area-updated" role="signal"><title>The <literal>&quot;area-updated&quot;</literal> signal</title>
<indexterm zone="GdkPixbufLoader-area-updated"><primary>GdkPixbufLoader::area-updated</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                        <link linkend="gint">gint</link>             x,
                                                        <link linkend="gint">gint</link>             y,
                                                        <link linkend="gint">gint</link>             width,
                                                        <link linkend="gint">gint</link>             height,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
This signal is emitted when a significant area of the image being
loaded has been updated.  Normally it means that a complete
scanline has been read in, but it could be a different area as
well.  Applications can use this signal to know when to repaint
areas of an image that is being loaded.</para>
  <para>
  </para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara> X offset of upper-left corner of the updated area.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara> Y offset of upper-left corner of the updated area.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> Width of updated area.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> Height of updated area.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GdkPixbufLoader-closed" role="signal"><title>The <literal>&quot;closed&quot;</literal> signal</title>
<indexterm zone="GdkPixbufLoader-closed"><primary>GdkPixbufLoader::closed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
This signal is emitted when <link linkend="gdk-pixbuf-loader-close"><function>gdk_pixbuf_loader_close()</function></link> is called.
It can be used by different parts of an application to receive
notification when an image loader is closed by the code that
drives it.</para>
  <para>
  </para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GdkPixbufLoader-size-prepared" role="signal"><title>The <literal>&quot;size-prepared&quot;</literal> signal</title>
<indexterm zone="GdkPixbufLoader-size-prepared"><primary>GdkPixbufLoader::size-prepared</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GdkPixbufLoader">GdkPixbufLoader</link> *loader,
                                                        <link linkend="gint">gint</link>             width,
                                                        <link linkend="gint">gint</link>             height,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
This signal is emitted when the pixbuf loader has been fed the
initial amount of data that is required to figure out the size
of the image that it will create.  Applications can call  
<link linkend="gdk-pixbuf-loader-set-size"><function>gdk_pixbuf_loader_set_size()</function></link> in response to this signal to set
the desired size to which the image should be scaled.</para>
  <para>
  </para><variablelist role="params">
<varlistentry><term><parameter>loader</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> the original width of the image
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> the original height of the image
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>


<refsect1 id="GdkPixbufLoader.see-also">
<title>See Also</title>
  <para>
    <link linkend="gdk-pixbuf-new-from-file"><function>gdk_pixbuf_new_from_file()</function></link>, <link linkend="gdk-pixbuf-animation-new-from-file"><function>gdk_pixbuf_animation_new_from_file()</function></link>
  </para>
</refsect1>

</refentry>
