Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gdk::PixbufAnimationIter Class Reference

A GdkPixbufAnimationIter C++ wrapper class. More...

#include <xfc/gdk-pixbuf/pixbuf-animation.hh>

Inheritance diagram for Xfc::Gdk::PixbufAnimationIter:

Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable List of all members.

Public Member Functions

Accessors
Methods

Detailed Description

A GdkPixbufAnimationIter C++ wrapper class.

PixbufAnimationIter provides the necessary functionality to display an animation by providing the frames that should be displayed at a given time.


Constructor & Destructor Documentation

Xfc::Gdk::PixbufAnimationIter::PixbufAnimationIter ( GdkPixbufAnimationIter *  iter,
bool  owns_reference = true 
) [explicit, protected]

Construct a new PixbufAnimationIter from an existing GdkPixbufAnimationIter.

Parameters:
iter A pointer to a GdkPixbufAnimationIter.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The iter can be a newly created GdkPixbufAnimationIter or an existing GdkPixbufAnimationIter. (see G::Object::Object).

Xfc::Gdk::PixbufAnimationIter::PixbufAnimationIter ( GdkPixbufAnimationIter *  iter,
bool  owns_reference = true 
) [explicit, protected]

Construct a new PixbufAnimationIter from an existing GdkPixbufAnimationIter.

Parameters:
iter A pointer to a GdkPixbufAnimationIter.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The iter can be a newly created GdkPixbufAnimationIter or an existing GdkPixbufAnimationIter. (see G::Object::Object).


Member Function Documentation

int Xfc::Gdk::PixbufAnimationIter::get_delay_time (  )  const

Gets the number of milliseconds the current pixbuf should be displayed, or -1 if the current pixbuf should be displayed forever.

Returns:
The delay time in milliseconds (thousandths of a second).
g_timeout_add() conveniently takes a timeout in milliseconds, so you can use a timeout to schedule the next update.

Pixbuf* Xfc::Gdk::PixbufAnimationIter::get_pixbuf (  )  const

Gets the current pixbuf which should be displayed; the pixbuf will be the same size as the animation itself (Gdk::PixbufAnimation::get_width(), Gdk::PixbufAnimation::get_height()).

Returns:
The pixbuf to be displayed.
This pixbuf should be displayed for Gdk::PixbufAnimation::get_delay_time() milliseconds. The caller of this function does not own a reference to the returned pixbuf; the returned pixbuf will become invalid when the iterator advances to the next frame, which may happen anytime you call advance(). Copy the pixbuf to keep it (don't just add a reference), as it may get recycled as you advance the iterator.

bool Xfc::Gdk::PixbufAnimationIter::on_currently_loading_frame (  )  const

Used to determine how to respond to the area_updated signal on PixbufLoader when loading an animation.

Returns:
true if the frame we're on is partially loaded, or the last frame.
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.

bool Xfc::Gdk::PixbufAnimationIter::advance ( const GTimeVal *  current_time = 0  ) 

Possibly advances an animation to a new frame.

Chooses the frame based on the start time passed to Gdk::PixbufAnimation::get_iter().

Parameters:
current_time The current time, or null to automatically use the result of g_get_current_time().
Returns:
true if the image may need updating.
The current_time would normally come from g_get_current_time(), and must be greater than or equal to the time passed to Gdk::PixbufAnimation::get_iter(), and must increase or remain unchanged each time get_pixbuf() is called. That is, you can't go backward in time; animations only play forward. As a shortcut, pass null for the current time and g_get_current_time() will be invoked on your behalf. So you only need to explicitly pass current_time if you're doing something odd like playing the animation at double speed.

If this method returns false, there's no need to update the animation display, assuming the display had been rendered prior to advancing; if true, you need to call get_pixbuf() and update the display with the new pixbuf.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3