This file is indexed.

/usr/share/gtk-doc/html/pygtk/class-gdkpixbufloader.html is in python-gtk2-doc 2.24.0-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.gdk.PixbufLoader</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="prev" href="class-gdkpixbufanimationiter.html" title="gtk.gdk.PixbufAnimationIter"><link rel="next" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.PixbufLoader</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkpixbufanimationiter.html">Prev</a> </td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gdkpixmap.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.gdk.PixbufLoader"><a name="class-gdkpixbufloader"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.gdk.PixbufLoader</h2><p>gtk.gdk.PixbufLoader — an object providing application-driven progressive image
loading</p></div><div class="refsect1" title="Synopsis"><a name="id3080060"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.PixbufLoader</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#constructor-gdkpixbufloader" title="Constructor">gtk.gdk.PixbufLoader</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>image_type</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--write" title="gtk.gdk.PixbufLoader.write">write</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buf</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>count</code></strong></span><span class="initializer">=-1</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--get-pixbuf" title="gtk.gdk.PixbufLoader.get_pixbuf">get_pixbuf</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--get-animation" title="gtk.gdk.PixbufLoader.get_animation">get_animation</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--close" title="gtk.gdk.PixbufLoader.close">close</a></span>()</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--set-size" title="gtk.gdk.PixbufLoader.set_size">set_size</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--get-format" title="gtk.gdk.PixbufLoader.get_format">get_format</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>

<code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkpixbufloader.html#function-gdk--pixbuf-loader-new-with-mime-type" title="gtk.gdk.pixbuf_loader_new_with_mime_type">gtk.gdk.pixbuf_loader_new_with_mime_type</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mime_type</code></strong></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3080314"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
  +-- <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader">gtk.gdk.PixbufLoader</a>
</pre></div><div class="refsect1" title="Signal Prototypes"><a name="id3080340"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gdkpixbufloader.html#signal-gdkpixbufloader--area-prepared" title='The "area-prepared" gtk.gdk.PixbufLoader Signal'>area-prepared</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gdkpixbufloader.html#signal-gdkpixbufloader--area-updated" title='The "area-updated" gtk.gdk.PixbufLoader Signal'>area-updated</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>x</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>y</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>width</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>height</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gdkpixbufloader.html#signal-gdkpixbufloader--closed" title='The "closed" gtk.gdk.PixbufLoader Signal'>closed</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gdkpixbufloader.html#signal-gdkpixbufloader--size-prepared" title='The "size-prepared" gtk.gdk.PixbufLoader Signal'>size-prepared</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>width</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>height</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id3080664"></a><h2>Description</h2><p>A <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></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 instead of
the <a class="link" href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-file" title="gtk.gdk.pixbuf_new_from_file"><code class="function">gtk.gdk.pixbuf_new_from_file</code></a> function 
or the <a class="link" href="class-gdkpixbufanimation.html#constructor-gdkpixbufanimation" title="Constructor"><code class="function">gtk.gdk.PixbufAnimation</code></a> 
constructor 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 class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a> 
to load an image, just create a new one, and call the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--write" title="gtk.gdk.PixbufLoader.write"><code class="methodname">write</code>()</a> 
method to send the data to it. When done, the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--close" title="gtk.gdk.PixbufLoader.close"><code class="methodname">close</code>()</a> 
method should be called to end the stream and finalize everything. The
loader will emit two important signals throughout the process. The first,
"area-prepared", will be called as soon as the image has enough information
to determine the size of the image to be used. The application can call the
<a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--get-pixbuf" title="gtk.gdk.PixbufLoader.get_pixbuf"><code class="methodname">get_pixbuf</code>()</a> 
method to retrieve the pixbuf. No actual image data will be in the pixbuf,
so it can be safely filled with any temporary graphics (or an initial color)
as needed.</p><p>The "area-updated" signal is emitted 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" title="Loading an Animation"><a name="id3080758"></a><h3>Loading an Animation</h3><p>Loading an animation is almost as easy as loading an image. Once
the first "area-prepared" signal has been emitted, you can call the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--get-animation" title="gtk.gdk.PixbufLoader.get_animation"><code class="methodname">get_animation</code>()</a>
method to get the <a class="link" href="class-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"><code class="classname">gtk.gdk.PixbufAnimation</code></a>
object and the <a class="link" href="class-gdkpixbufanimation.html#method-gdkpixbufanimation--get-iter" title="gtk.gdk.PixbufAnimation.get_iter"><code class="methodname">gtk.gdk.PixbufAnimation.get_iter</code>()</a>
method to get an <a class="link" href="class-gdkpixbufanimationiter.html" title="gtk.gdk.PixbufAnimationIter"><code class="classname">gtk.gdk.PixbufAnimationIter</code></a>
for displaying it.</p></div></div><div class="refsect1" title="Constructor"><a name="constructor-gdkpixbufloader"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.gdk.PixbufLoader</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>image_type</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>image_type</code></strong> :</span></p></td><td>the name of the image format or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A new <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a> 
object.</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a>
object. If <em class="parameter"><code>image_type</code></em> is not specified or is
<code class="literal">None</code> the image type will be automatically deduced from
the image data. If <em class="parameter"><code>image_type</code></em> is specified the <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a>
attempts to parse the image data as if it were an image of the specified
type. Identifying the image type is 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>This constructor raises the GError exception if an error occurs
trying to load the module for <em class="parameter"><code>image_type</code></em>.</p></div><div class="refsect1" title="Methods"><a name="id3080943"></a><h2>Methods</h2><div class="refsect2" title="gtk.gdk.PixbufLoader.write"><a name="method-gdkpixbufloader--write"></a><h3>gtk.gdk.PixbufLoader.write</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">write</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buf</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>count</code></strong></span><span class="initializer">=-1</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>buf</code></strong> :</span></p></td><td>a string containing some portion of the image
data.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>count</code></strong> :</span></p></td><td>the length of <em class="parameter"><code>buf</code></em> in
bytes.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the write was
successful.</td></tr></tbody></table><p>The <code class="methodname">write</code>() method causes the pixbuf
loader to parse the bytes of an image contained in the string specified by
<em class="parameter"><code>buf</code></em>. If <em class="parameter"><code>count</code></em> is specified and
is in the range (0, len(buf)) only <em class="parameter"><code>count</code></em> bytes of
<em class="parameter"><code>buf</code></em> are used. This method returns
<code class="literal">True</code> if the image data was loaded successfully. If an
error occurred this method raises the GError exception and will not accept
further writes. The loader may or may not be closed depending on the
error.</p></div><div class="refsect2" title="gtk.gdk.PixbufLoader.get_pixbuf"><a name="method-gdkpixbufloader--get-pixbuf"></a><h3>gtk.gdk.PixbufLoader.get_pixbuf</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_pixbuf</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a> that
the loader is creating, or <code class="literal">None</code> if not enough data has
been read to determine how to create the image buffer.</td></tr></tbody></table><p>The <code class="methodname">get_pixbuf</code>() method returns the
<a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a>
that a pixbuf loader is currently creating. In general it only makes sense
to call this method after the "area-prepared" signal has been emitted by
the loader which 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 the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--write" title="gtk.gdk.PixbufLoader.write"><code class="methodname">write</code>()</a> 
method, this method returns <code class="literal">None</code>. The same pixbuf will be
returned in all future calls to this method. Also, if the loader is an
animation, it will return the "static image" of the animation (see the <a class="link" href="class-gdkpixbufanimation.html#method-gdkpixbufanimation--get-static-image" title="gtk.gdk.PixbufAnimation.get_static_image"><code class="methodname">gtk.gdk.PixbufAnimation.get_static_image</code>()</a> 
method).</p></div><div class="refsect2" title="gtk.gdk.PixbufLoader.get_animation"><a name="method-gdkpixbufloader--get-animation"></a><h3>gtk.gdk.PixbufLoader.get_animation</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_animation</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"><code class="classname">gtk.gdk.PixbufAnimation</code></a> 
that the loader is loading, or <code class="literal">None</code> if not enough data
has been read to determine the information.</td></tr></tbody></table><p>The <code class="methodname">get_animation</code>() method returns the
<a class="link" href="class-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"><code class="classname">gtk.gdk.PixbufAnimation</code></a> 
that the pixbuf loader is currently creating. In general it only makes sense
to call this method 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 method will return
<code class="literal">None</code>.</p></div><div class="refsect2" title="gtk.gdk.PixbufLoader.close"><a name="method-gdkpixbufloader--close"></a><h3>gtk.gdk.PixbufLoader.close</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">close</span>()</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if all image data
written so far was successfully passed out via the "area_update"
signal</td></tr></tbody></table><p>The <code class="methodname">close</code>() method informs the pixbuf
loader that no further writes using the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--write" title="gtk.gdk.PixbufLoader.write"><code class="methodname">write</code>()</a>
will occur, so that it can free its internal loading structures. Also, the
pixbuf loader tries to parse any data that hasn't yet been parsed and if the
remaining data is partial or corrupt, the GError exception will be
raised.</p></div><div class="refsect2" title="gtk.gdk.PixbufLoader.set_size"><a name="method-gdkpixbufloader--set-size"></a><h3>gtk.gdk.PixbufLoader.set_size</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_size</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td>The desired width for the image being
	  loaded.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td>The desired height for the image being
	  loaded.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_size</code>() method causes the image
to be scaled to the size specified by <em class="parameter"><code>width</code></em> and
<em class="parameter"><code>height</code></em> while it is being loaded. The desired image
size can be determined relative to the original size of the image by calling
the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--set-size" title="gtk.gdk.PixbufLoader.set_size"><code class="methodname">set_size()</code></a>
from a signal handler for the "<a class="link" href="class-gdkpixbufloader.html#signal-gdkpixbufloader--size-prepared" title='The "size-prepared" gtk.gdk.PixbufLoader Signal'>size-prepared</a>"
signal.</p><p>Attempts to set the desired image size are ignored after the
emission of the "<a class="link" href="class-gdkpixbufloader.html#signal-gdkpixbufloader--size-prepared" title='The "size-prepared" gtk.gdk.PixbufLoader Signal'>size-prepared</a>".</p></div><div class="refsect2" title="gtk.gdk.PixbufLoader.get_format"><a name="method-gdkpixbufloader--get-format"></a><h3>gtk.gdk.PixbufLoader.get_format</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_format</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a Python dict containing the image format
	  information or <code class="literal">None</code></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_format</code>() method returns the
available information about the format of the currently loading image
file. This method returns None if their is no information available
e.g. before the image has started loading.</p></div></div><div class="refsect1" title="Functions"><a name="id3348626"></a><h2>Functions</h2><div class="refsect2" title="gtk.gdk.pixbuf_loader_new_with_mime_type"><a name="function-gdk--pixbuf-loader-new-with-mime-type"></a><h3>gtk.gdk.pixbuf_loader_new_with_mime_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.pixbuf_loader_new_with_mime_type</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mime_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mime_type</code></strong> :</span></p></td><td> the mime type to be loaded</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a>
	  object.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The
<code class="function">gtk.gdk.pixbuf_loader_new_with_mime_type</code>() function
creates a new pixbuf loader object that always attempts to parse image data
as if it were an image of the mime type specified by
<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>This function raises the GError exception if an error occurs
during the loading of the mime type image module.</p></div></div><div class="refsect1" title="Signals"><a name="id3348751"></a><h2>Signals</h2><div class="refsect2" title='The "area-prepared" gtk.gdk.PixbufLoader Signal'><a name="signal-gdkpixbufloader--area-prepared"></a><h3>The "area-prepared" gtk.gdk.PixbufLoader Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>pixbufloader</code></em> :</span></p></td><td>the pixbufloader that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "area-prepared" signal is emitted when sufficient image data
has been received and parsed to determine the size of the image.</p></div><div class="refsect2" title='The "area-updated" gtk.gdk.PixbufLoader Signal'><a name="signal-gdkpixbufloader--area-updated"></a><h3>The "area-updated" gtk.gdk.PixbufLoader Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>x</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>y</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>width</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>height</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>pixbufloader</code></em> :</span></p></td><td>the pixbufloader that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td><td>the X coordinate of the
region</td></tr><tr><td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td><td>the Y coordinate of the
region</td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td>the width of the region</td></tr><tr><td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td><td>the height of the region</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "area-updated" signal is emitted when sufficient image data
has been received and parsed to allow the region specified by
<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>,
<em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> to be
displayed.</p></div><div class="refsect2" title='The "closed" gtk.gdk.PixbufLoader Signal'><a name="signal-gdkpixbufloader--closed"></a><h3>The "closed" gtk.gdk.PixbufLoader Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>pixbufloader</code></em> :</span></p></td><td>the pixbufloader that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "closed" signal is emitted when the
<em class="parameter"><code>pixbufloader</code></em> is closed by calling the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--close" title="gtk.gdk.PixbufLoader.close"><code class="methodname">close</code>()</a>
method.</p></div><div class="refsect2" title='The "size-prepared" gtk.gdk.PixbufLoader Signal'><a name="signal-gdkpixbufloader--size-prepared"></a><h3>The "size-prepared" gtk.gdk.PixbufLoader Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>pixbufloader</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>width</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>height</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>pixbufloader</code></em> :</span></p></td><td>the pixbufloader that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td>the original width of the
          image</td></tr><tr><td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td><td>he original height of the
          image</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.2 and above.</p></div><p>The "size-prepared" 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 the <a class="link" href="class-gdkpixbufloader.html#method-gdkpixbufloader--set-size" title="gtk.gdk.PixbufLoader.set_size"><code class="methodname">set_size</code>()</a>
method in response to this signal to set the desired size of the
image.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkpixbufanimationiter.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gdkpixmap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.PixbufAnimationIter </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.gdk.Pixmap</td></tr></table></div></body></html>