/usr/share/gtk-doc/html/pygtk/class-gdkpixbufanimationiter.html is in python-gtk2-doc 2.24.0-5.1ubuntu2.
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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.gdk.PixbufAnimationIter</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-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"><link rel="next" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"></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.PixbufAnimationIter</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkpixbufanimation.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-gdkpixbufloader.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.gdk.PixbufAnimationIter"><a name="class-gdkpixbufanimationiter"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.gdk.PixbufAnimationIter</h2><p>gtk.gdk.PixbufAnimationIter — an object providing access to the frames of a <a class="link" href="class-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"><code class="classname">gtk.gdk.PixbufAnimation</code></a></p></div><div class="refsect1" title="Synopsis"><a name="id3074248"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.PixbufAnimationIter</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-delay-time" title="gtk.gdk.PixbufAnimationIter.get_delay_time">get_delay_time</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-pixbuf" title="gtk.gdk.PixbufAnimationIter.get_pixbuf">get_pixbuf</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--on-currently-loading-frame" title="gtk.gdk.PixbufAnimationIter.on_currently_loading_frame">on_currently_loading_frame</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--advance" title="gtk.gdk.PixbufAnimationIter.advance">advance</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>current_time</code></strong></span><span class="initializer">=0.0</span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3074369"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gdkpixbufanimationiter.html" title="gtk.gdk.PixbufAnimationIter">gtk.gdk.PixbufAnimationIter</a>
</pre></div><div class="refsect1" title="Description"><a name="id3074394"></a><h2>Description</h2><p>A <a class="link" href="class-gdkpixbufanimationiter.html" title="gtk.gdk.PixbufAnimationIter"><code class="classname">gtk.gdk.PixbufAnimationIter</code></a>
is used to access the frames of a <a class="link" href="class-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"><code class="classname">gtk.gdk.PixbufAnimation</code></a>
at specified times. A <a class="link" href="class-gdkpixbufanimationiter.html" title="gtk.gdk.PixbufAnimationIter"><code class="classname">gtk.gdk.PixbufAnimationIter</code></a>
object is created using 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. After creating an iterator, you should immediately display the
pixbuf returned by the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-pixbuf" title="gtk.gdk.PixbufAnimationIter.get_pixbuf"><code class="methodname">get_pixbuf</code>()</a>
method. Then, you should install a timeout (with the <PYGTKDOCLINK HREF="function-gobject--timeout-add"><code class="methodname">gobject.timeout_add</code>()</PYGTKDOCLINK>()
function) or by some other mechanism ensure that you'll update the image
after the number of milliseconds specified by the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-delay-time" title="gtk.gdk.PixbufAnimationIter.get_delay_time"><code class="methodname">get_delay_time</code>()</a>
method. Each time the image is updated, you should reinstall the timeout
with the new, possibly-changed delay time.</p><p>To update the image (i.e. possibly change the result of the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-pixbuf" title="gtk.gdk.PixbufAnimationIter.get_pixbuf"><code class="methodname">get_pixbuf</code>()</a>
method to a new frame of the animation), call the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--advance" title="gtk.gdk.PixbufAnimationIter.advance"><code class="methodname">advance</code>()</a>
method.</p><p>If you're using a <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a>,
in addition to updating the image after the delay time, you should also
update it whenever you receive the "area_updated" signal and the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--on-currently-loading-frame" title="gtk.gdk.PixbufAnimationIter.on_currently_loading_frame"><code class="methodname">on_currently_loading_frame</code>()</a>
method returns <code class="literal">True</code>. In this case, the frame currently
being fed into the loader has received new data, so needs to be refreshed.
The delay time for a frame may also be modified after an "area_updated"
signal, for example if the delay time for a frame is encoded in the data
after the frame itself. So your timeout should be reinstalled after any
area_updated signal. A delay time of -1 is possible, indicating
"infinite."</p></div><div class="refsect1" title="Methods"><a name="id3074520"></a><h2>Methods</h2><div class="refsect2" title="gtk.gdk.PixbufAnimationIter.get_delay_time"><a name="method-gdkpixbufanimationiter--get-delay-time"></a><h3>gtk.gdk.PixbufAnimationIter.get_delay_time</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_delay_time</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 delay time in milliseconds (thousandths of
a second)</td></tr></tbody></table><p>The <code class="methodname">get_delay_time</code>() method returns the
number of milliseconds the current pixbuf should be displayed, or -1 if the
current pixbuf should be displayed forever. The <PYGTKDOCLINK HREF="function-gobject--timeout-add"><code class="methodname">gobject.timeout_add</code>()</PYGTKDOCLINK>()
function conveniently takes a timeout in milliseconds, so you can use a
timeout to schedule the next update.</p></div><div class="refsect2" title="gtk.gdk.PixbufAnimationIter.get_pixbuf"><a name="method-gdkpixbufanimationiter--get-pixbuf"></a><h3>gtk.gdk.PixbufAnimationIter.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 current <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a> to be
displayed</td></tr></tbody></table><p>The <code class="methodname">get_pixbuf</code>() method returns the
current <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a> that
should be displayed. The pixbuf will be the same size as the animation
itself (see the <a class="link" href="class-gdkpixbufanimation.html#method-gdkpixbufanimation--get-width" title="gtk.gdk.PixbufAnimation.get_width"><code class="methodname">gtk.gdk.PixbufAnimation.get_width</code>()</a>
and <a class="link" href="class-gdkpixbufanimation.html#method-gdkpixbufanimation--get-height" title="gtk.gdk.PixbufAnimation.get_height"><code class="methodname">gtk.gdk.PixbufAnimation.get_height</code>()</a>
methods). The <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a>
should be displayed for the number of milliseconds specified by the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-delay-time" title="gtk.gdk.PixbufAnimationIter.get_delay_time"><code class="methodname">get_delay_time</code>()</a>
method.</p></div><div class="refsect2" title="gtk.gdk.PixbufAnimationIter.on_currently_loading_frame"><a name="method-gdkpixbufanimationiter--on-currently-loading-frame"></a><h3>gtk.gdk.PixbufAnimationIter.on_currently_loading_frame</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">on_currently_loading_frame</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><code class="literal">True</code> if the frame we're on
is partially loaded, or the last frame</td></tr></tbody></table><p>The <code class="methodname">on_currently_loading_frame</code>() method
returns <code class="literal">True</code> if the frame currently pointed to by the
iterator is partially loaded or the last frame. This method is used to
determine how to respond to the "area_updated" signal on <a class="link" href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><code class="classname">gtk.gdk.PixbufLoader</code></a>
when loading an animation. The "area_updated" signal is emitted for an area
of the frame currently streaming in to the loader. So if you're on the
currently loading frame, you need to redraw the screen for the updated
area.</p></div><div class="refsect2" title="gtk.gdk.PixbufAnimationIter.advance"><a name="method-gdkpixbufanimationiter--advance"></a><h3>gtk.gdk.PixbufAnimationIter.advance</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">advance</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>current_time</code></strong></span><span class="initializer">=0.0</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>current_time</code></strong> :</span></p></td><td>the current time as a float or 0.0 to
automatically determine the current time</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 image may need
updating</td></tr></tbody></table><p>The <code class="methodname">advance</code>() method attempts to
advance an animation to a new frame. The frame is chosen based on the start
time passed to 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. <em class="parameter"><code>current_time</code></em> is normally the current time (as
specified by the Python time.time() function) and must be greater than or
equal to the time passed to 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, and must increase or remain unchanged each time the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-pixbuf" title="gtk.gdk.PixbufAnimationIter.get_pixbuf"><code class="methodname">get_pixbuf</code>()</a>
method is called. That is, you can't go backward in time; animations only
play forward. As a shortcut, pass 0.0 (the default) for the current time and
the current time will automatically be determined an used. So you only need
to explicitly pass <em class="parameter"><code>current_time</code></em> if you're doing
something odd like playing the animation at double speed.</p><p>If this method returns <code class="literal">False</code>, there's no need
to update the animation display, assuming the display had been rendered
prior to advancing; if <code class="literal">True</code>, you need to call the <a class="link" href="class-gdkpixbufanimationiter.html#method-gdkpixbufanimationiter--get-pixbuf" title="gtk.gdk.PixbufAnimationIter.get_pixbuf"><code class="methodname">get_pixbuf</code>()</a>
method and update the display with the new pixbuf.</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-gdkpixbufanimation.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-gdkpixbufloader.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.PixbufAnimation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.gdk.PixbufLoader</td></tr></table></div></body></html>
|