|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/gdk-pixbuf/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GdkPixbufLoader</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="The gdk-pixbuf Library">
<link rel="up" href="rn01.html" title="API Reference">
<link rel="prev" href="gdk-pixbuf-animation.html" title="Animations">
<link rel="next" href="gdk-pixbuf-Module-Interface.html" title="Module Interface">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="rn01.html" title="API Reference">
<link rel="reference" href="rn02.html" title="Tools Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="appendix" href="apa.html" title="Appendix A. Porting applications from Imlib to gdk-pixbuf">
<link rel="appendix" href="license.html" title="Appendix B. License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-pixbuf-animation.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">The <span class="application">gdk-pixbuf</span> Library</th>
<td><a accesskey="n" href="gdk-pixbuf-Module-Interface.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3124284" class="shortcut">Top</a>
 | 
<a href="#id3124791" class="shortcut">Description</a>
 | 
<a href="#id3124571" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id3124595" class="shortcut">Signals</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="GdkPixbufLoader"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3124284"></a><span class="refentrytitle">GdkPixbufLoader</span>
</h2>
<p>GdkPixbufLoader — Application-driven progressive image loading.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk-pixbuf/gdk-pixbuf.h>
<a href="GdkPixbufLoader.html#GdkPixbufLoader-struct">GdkPixbufLoader</a>;
<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a>* <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-new">gdk_pixbuf_loader_new</a> (void);
<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a>* <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-new-with-type">gdk_pixbuf_loader_new_with_type</a>
(const char *image_type,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a>* <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-new-with-mime-type">gdk_pixbuf_loader_new_with_mime_type</a>
(const char *mime_type,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat">GdkPixbufFormat</a>* <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-format">gdk_pixbuf_loader_get_format</a>
(<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-write">gdk_pixbuf_loader_write</a> (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
const <a
href="../glib/glib-Basic-Types.html#guchar"
>guchar</a> *buf,
<a
href="../glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
void <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-set-size">gdk_pixbuf_loader_set_size</a> (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
int width,
int height);
<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a>* <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-pixbuf">gdk_pixbuf_loader_get_pixbuf</a> (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader);
<a href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a>* <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-animation">gdk_pixbuf_loader_get_animation</a>
(<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-close">gdk_pixbuf_loader_close</a> (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3124571"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
+----GdkPixbufLoader
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3124595"></a><h2>Signals</h2>
<pre class="synopsis">
"<a href="GdkPixbufLoader.html#GdkPixbufLoader-area-prepared">area-prepared</a>"
void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last
"<a href="GdkPixbufLoader.html#GdkPixbufLoader-area-updated">area-updated</a>"
void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> width,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> height,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last
"<a href="GdkPixbufLoader.html#GdkPixbufLoader-closed">closed</a>" void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last
"<a href="GdkPixbufLoader.html#GdkPixbufLoader-size-prepared">size-prepared</a>"
void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> width,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> height,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3124791"></a><h2>Description</h2>
<p>
<a href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a> 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
<a href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file"><code class="function">gdk_pixbuf_new_from_file()</code></a> or <a href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-new-from-file"><code class="function">gdk_pixbuf_animation_new_from_file()</code></a>
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.
</p>
<p>
To use <a href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a> to load an image, just create a new one,
and call <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-write"><code class="function">gdk_pixbuf_loader_write()</code></a> to send the data to it. When
done, <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-close"><code class="function">gdk_pixbuf_loader_close()</code></a> should be called to end the stream
and finalize everything. The loader will emit three important
signals throughout the process. The first, "<a href="GdkPixbufLoader.html#GdkPixbufLoader-size-prepared">size_prepared</a>",
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 <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-set-size"><code class="function">gdk_pixbuf_loader_set_size()</code></a>
in response to this signal.
</p>
<p>The second signal, "<a href="GdkPixbufLoader.html#GdkPixbufLoader-area-prepared">area_prepared</a>",
will be called as soon as the pixbuf of the desired has been
allocated. You can obtain it by calling <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-pixbuf"><code class="function">gdk_pixbuf_loader_get_pixbuf()</code></a>.
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
<a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-pixbuf"><code class="function">gdk_pixbuf_loader_get_pixbuf()</code></a> later and get the same pixbuf.
</p>
<p>
The last signal, "<a href="GdkPixbufLoader.html#GdkPixbufLoader-area-updated">area_updated</a>" 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.
</p>
<div class="refsect2" lang="en">
<a name="id3124961"></a><h3>Loading an animation</h3>
<p>
Loading an animation is almost as easy as loading an
image. Once the first "<a href="GdkPixbufLoader.html#GdkPixbufLoader-area-prepared">area_prepared</a>" signal
has been emitted, you can call <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-animation"><code class="function">gdk_pixbuf_loader_get_animation()</code></a>
to get the <a href="gdk-pixbuf-animation.html#GdkPixbufAnimation"><span class="type">GdkPixbufAnimation</span></a> struct and <a href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-iter"><code class="function">gdk_pixbuf_animation_get_iter()</code></a>
to get an <a href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter"><span class="type">GdkPixbufAnimationIter</span></a> for displaying it.
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3125022"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3125033"></a><h3>
<a name="GdkPixbufLoader-struct"></a>GdkPixbufLoader</h3>
<a class="indexterm" name="id3125046"></a><pre class="programlisting">typedef struct _GdkPixbufLoader GdkPixbufLoader;</pre>
<p>
The <span class="structname">GdkPixbufLoader</span> struct contains only private
fields.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125066"></a><h3>
<a name="gdk-pixbuf-loader-new"></a>gdk_pixbuf_loader_new ()</h3>
<a class="indexterm" name="id3125078"></a><pre class="programlisting"><a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a>* gdk_pixbuf_loader_new (void);</pre>
<p>
Creates a new pixbuf loader object.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A newly-created pixbuf loader.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125119"></a><h3>
<a name="gdk-pixbuf-loader-new-with-type"></a>gdk_pixbuf_loader_new_with_type ()</h3>
<a class="indexterm" name="id3125133"></a><pre class="programlisting"><a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a>* gdk_pixbuf_loader_new_with_type
(const char *image_type,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of type <em class="parameter"><code>image_type</code></em>, 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.
</p>
<p>
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 <a href="gdk-pixbuf-Module-Interface.html#gdk-pixbuf-format-get-name"><code class="function">gdk_pixbuf_format_get_name()</code></a> on each
of the <a href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat"><span class="type">GdkPixbufFormat</span></a> structs returned by <a href="gdk-pixbuf-Module-Interface.html#gdk-pixbuf-get-formats"><code class="function">gdk_pixbuf_get_formats()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>image_type</code></em> :</span></td>
<td> name of the image format to be loaded with the image
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td> return location for an allocated <a
href="../glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a>, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore errors
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A newly-created pixbuf loader.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125288"></a><h3>
<a name="gdk-pixbuf-loader-new-with-mime-type"></a>gdk_pixbuf_loader_new_with_mime_type ()</h3>
<a class="indexterm" name="id3125304"></a><pre class="programlisting"><a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a>* gdk_pixbuf_loader_new_with_mime_type
(const char *mime_type,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of mime type <em class="parameter"><code>mime_type</code></em>, 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.
</p>
<p>
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
<a href="gdk-pixbuf-Module-Interface.html#gdk-pixbuf-format-get-mime-types"><code class="function">gdk_pixbuf_format_get_mime_types()</code></a> on each of the <a href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat"><span class="type">GdkPixbufFormat</span></a>
structs returned by <a href="gdk-pixbuf-Module-Interface.html#gdk-pixbuf-get-formats"><code class="function">gdk_pixbuf_get_formats()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>mime_type</code></em> :</span></td>
<td> the mime type to be loaded
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td> return location for an allocated <a
href="../glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a>, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore errors
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A newly-created pixbuf loader.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125464"></a><h3>
<a name="gdk-pixbuf-loader-get-format"></a>gdk_pixbuf_loader_get_format ()</h3>
<a class="indexterm" name="id3125479"></a><pre class="programlisting"><a href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat">GdkPixbufFormat</a>* gdk_pixbuf_loader_get_format
(<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader);</pre>
<p>
Obtains the available information about the format of the
currently loading image file.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> A pixbuf loader.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A <a href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat"><span class="type">GdkPixbufFormat</span></a> or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>. The return value is owned
by GdkPixbuf and should not be freed.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125566"></a><h3>
<a name="gdk-pixbuf-loader-write"></a>gdk_pixbuf_loader_write ()</h3>
<a class="indexterm" name="id3125579"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_pixbuf_loader_write (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
const <a
href="../glib/glib-Basic-Types.html#guchar"
>guchar</a> *buf,
<a
href="../glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
This will cause a pixbuf loader to parse the next <em class="parameter"><code>count</code></em> bytes of
an image. It will return <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the data was loaded successfully,
and <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> if an error occurred. In the latter case, the loader
will be closed, and will not accept further writes. If <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> is
returned, <em class="parameter"><code>error</code></em> will be set to an error from the <a href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS"><span class="type">GDK_PIXBUF_ERROR</span></a>
or <a
href="../glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"
><span class="type">G_FILE_ERROR</span></a> domains.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> A pixbuf loader.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
<td> Pointer to image data.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>count</code></em> :</span></td>
<td> Length of the <em class="parameter"><code>buf</code></em> buffer in bytes.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td> return location for errors
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the write was successful, or <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> if the loader
cannot parse the buffer.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125796"></a><h3>
<a name="gdk-pixbuf-loader-set-size"></a>gdk_pixbuf_loader_set_size ()</h3>
<a class="indexterm" name="id3125812"></a><pre class="programlisting">void gdk_pixbuf_loader_set_size (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
int width,
int height);</pre>
<p>
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 <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-set-size"><code class="function">gdk_pixbuf_loader_set_size()</code></a> from a
signal handler for the ::size_prepared signal.
</p>
<p>
Attempts to set the desired image size are ignored after the
emission of the ::size_prepared signal.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> A pixbuf loader.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em> :</span></td>
<td> The desired width of the image being loaded.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em> :</span></td>
<td> The desired height of the image being loaded.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125929"></a><h3>
<a name="gdk-pixbuf-loader-get-pixbuf"></a>gdk_pixbuf_loader_get_pixbuf ()</h3>
<a class="indexterm" name="id3125942"></a><pre class="programlisting"><a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a>* gdk_pixbuf_loader_get_pixbuf (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader);</pre>
<p>
Queries the <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> 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
<a href="GdkPixbufLoader.html#gdk-pixbuf-loader-write"><code class="function">gdk_pixbuf_loader_write()</code></a>, then this function returns <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>. The
returned pixbuf will be the same in all future calls to the loader,
so simply calling <a
href="../gobject/gobject-The-Base-Object-Type.html#g-object-ref"
><code class="function">g_object_ref()</code></a> should be sufficient to continue
using it. Additionally, if the loader is an animation, it will
return the "static image" of the animation
(see <a href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-static-image"><code class="function">gdk_pixbuf_animation_get_static_image()</code></a>).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> A pixbuf loader.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> The <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> that the loader is creating, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if not
enough data has been read to determine how to create the image buffer.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126084"></a><h3>
<a name="gdk-pixbuf-loader-get-animation"></a>gdk_pixbuf_loader_get_animation ()</h3>
<a class="indexterm" name="id3126097"></a><pre class="programlisting"><a href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a>* gdk_pixbuf_loader_get_animation
(<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader);</pre>
<p>
Queries the <a href="gdk-pixbuf-animation.html#GdkPixbufAnimation"><span class="type">GdkPixbufAnimation</span></a> 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 <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> A pixbuf loader
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> The <a href="gdk-pixbuf-animation.html#GdkPixbufAnimation"><span class="type">GdkPixbufAnimation</span></a> that the loader is loading, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if
not enough data has been read to determine the information.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126202"></a><h3>
<a name="gdk-pixbuf-loader-close"></a>gdk_pixbuf_loader_close ()</h3>
<a class="indexterm" name="id3126215"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_pixbuf_loader_close (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Informs a pixbuf loader that no further writes with
<a href="GdkPixbufLoader.html#gdk-pixbuf-loader-write"><code class="function">gdk_pixbuf_loader_write()</code></a> 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 <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> is returned, <em class="parameter"><code>error</code></em>
will be set to an error from the <a href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS"><span class="type">GDK_PIXBUF_ERROR</span></a> or <a
href="../glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"
><span class="type">G_FILE_ERROR</span></a>
domains. If you're just cancelling a load rather than expecting it
to be finished, passing <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> for <em class="parameter"><code>error</code></em> to ignore it is
reasonable.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> A pixbuf loader.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td> return location for a <a
href="../glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a>, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore errors
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if all image data written so far was successfully
passed out via the update_area signal
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3126395"></a><h2>Signal Details</h2>
<div class="refsect2" lang="en">
<a name="id3126406"></a><h3>
<a name="GdkPixbufLoader-area-prepared"></a>The "area-prepared" signal</h3>
<a class="indexterm" name="id3126417"></a><pre class="programlisting">void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last</pre>
<p>
This signal is emitted when the pixbuf loader has allocated the
pixbuf in the desired size. After this signal is emitted,
applications can call <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-get-pixbuf"><code class="function">gdk_pixbuf_loader_get_pixbuf()</code></a> to fetch
the partially-loaded pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126503"></a><h3>
<a name="GdkPixbufLoader-area-updated"></a>The "area-updated" signal</h3>
<a class="indexterm" name="id3126514"></a><pre class="programlisting">void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> width,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> height,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last</pre>
<p>
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.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x</code></em> :</span></td>
<td> X offset of upper-left corner of the updated area.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y</code></em> :</span></td>
<td> Y offset of upper-left corner of the updated area.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em> :</span></td>
<td> Width of updated area.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em> :</span></td>
<td> Height of updated area.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126679"></a><h3>
<a name="GdkPixbufLoader-closed"></a>The "closed" signal</h3>
<a class="indexterm" name="id3126689"></a><pre class="programlisting">void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last</pre>
<p>
This signal is emitted when <a href="GdkPixbufLoader.html#gdk-pixbuf-loader-close"><code class="function">gdk_pixbuf_loader_close()</code></a> 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.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126774"></a><h3>
<a name="GdkPixbufLoader-size-prepared"></a>The "size-prepared" signal</h3>
<a class="indexterm" name="id3126786"></a><pre class="programlisting">void user_function (<a href="GdkPixbufLoader.html" title="GdkPixbufLoader">GdkPixbufLoader</a> *loader,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> width,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> height,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last</pre>
<p>
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
<a href="GdkPixbufLoader.html#gdk-pixbuf-loader-set-size"><code class="function">gdk_pixbuf_loader_set_size()</code></a> in response to this signal to set
the desired size to which the image should be scaled.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>loader</code></em> :</span></td>
<td> the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em> :</span></td>
<td> the original width of the image
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em> :</span></td>
<td> the original height of the image
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3126920"></a><h2>See Also</h2>
<p>
<a href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file"><code class="function">gdk_pixbuf_new_from_file()</code></a>, <a href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-new-from-file"><code class="function">gdk_pixbuf_animation_new_from_file()</code></a>
</p>
</div>
</div>
</body>
</html>