gtkmm: Gdk::PixbufAnimationIter Class Reference

An iterator which points to a certain position in a PixbufAnimation. More...

#include <gdkmm/pixbufanimationiter.h>

Inheritance diagram for Gdk::PixbufAnimationIter:

Public Member Functions

 PixbufAnimationIter (PixbufAnimationIter&& src) noexcept
 
PixbufAnimationIteroperator= (PixbufAnimationIter&& src) noexcept
 
 ~PixbufAnimationIter () noexcept override
 
GdkPixbufAnimationIter* gobj ()
 Provides access to the underlying C GObject. More...

 
const GdkPixbufAnimationIter* gobj () const
 Provides access to the underlying C GObject. More...

 
GdkPixbufAnimationIter* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...

 
int 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. More...

 
Glib::RefPtr< Gdk::Pixbufget_pixbuf ()
 Gets the current pixbuf which should be displayed; the pixbuf will be the same size as the animation itself (Gdk::Pixbuf::get_width(), Gdk::Pixbuf:get_height()). More...

 
Glib::RefPtr< const Gdk::Pixbufget_pixbuf () const
 Gets the current pixbuf which should be displayed; the pixbuf will be the same size as the animation itself (Gdk::Pixbuf::get_width(), Gdk::Pixbuf:get_height()). More...

 
bool on_currently_loading_frame () const
 Used to determine how to respond to the area_updated signal on Gdk::PixbufLoader when loading an animation. More...

 
bool advance (gint64 current_time=g_get_real_time())
 Possibly advances an animation to a new frame. More...

 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&src) noexcept
 
Objectoperator= (Object &&src) noexcept
 
void * get_data (const QueryQuark &key)
 
void set_data (const Quark &key, void *data)
 
void set_data (const Quark &key, void *data, DestroyNotify notify)
 
void remove_data (const QueryQuark &quark)
 
void * steal_data (const QueryQuark &quark)
 
Glib::RefPtr< Glib::Objectwrap (GObject *object, bool take_copy=false)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
 
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
 
void set_property (const Glib::ustring &property_name, const PropertyType &value)
 
void get_property (const Glib::ustring &property_name, PropertyType &value) const
 
PropertyType get_property (const Glib::ustring &property_name) const
 
sigc::connection connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot)
 
sigc::connection connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot)
 
void freeze_notify ()
 
void thaw_notify ()
 
virtual void reference () const
 
virtual void unreference () const
 
GObject * gobj ()
 
const GObject * gobj () const
 
GObject * gobj_copy () const
 
- Public Member Functions inherited from sigc::trackable
 trackable () noexcept
 
 trackable (const trackable &src) noexcept
 
 trackable (trackable &&src) noexcept
 
 ~trackable ()
 
void add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const
 
void notify_callbacks ()
 
trackableoperator= (const trackable &src)
 
trackableoperator= (trackable &&src) noexcept
 
void remove_destroy_notify_callback (notifiable *data) const
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...

 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::PixbufAnimationIterwrap (GdkPixbufAnimationIter* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...

 

Additional Inherited Members

- Public Types inherited from Glib::Object
typedef void(*)(gpointer data DestroyNotify)
 
- Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify func_destroy_notify
 
- Public Types inherited from sigc::notifiable
typedef internal::func_destroy_notify func_destroy_notify
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams &construct_params)
 
 Object (GObject *castitem)
 
 ~Object () noexcept override
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 
 ObjectBase (const char *custom_type_name)
 
 ObjectBase (const std::type_info &custom_type_info)
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Detailed Description

An iterator which points to a certain position in a PixbufAnimation.

Constructor & Destructor Documentation

Gdk::PixbufAnimationIter::PixbufAnimationIter ( PixbufAnimationIter&&  src)
noexcept
Gdk::PixbufAnimationIter::~PixbufAnimationIter ( )
overridenoexcept

Member Function Documentation

bool Gdk::PixbufAnimationIter::advance ( gint64  current_time = g_get_real_time())

Possibly advances an animation to a new frame.

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

current_time would normally come from g_get_real_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, the default value of current_time is g_get_real_time(). So you only need to explicitly pass current_time if you're doing something odd like playing the animation at double speed.

If this function 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.

Parameters
current_timeCurrent time.
Returns
true if the image may need updating.
int 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.

Glib::signal_timeout.connect() conveniently takes a timeout in milliseconds, so you can use a timeout to schedule the next update.

Since gtkmm 2.14:
Returns
Delay time in milliseconds (thousandths of a second).
Glib::RefPtr<Gdk::Pixbuf> Gdk::PixbufAnimationIter::get_pixbuf ( )

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

This pixbuf should be displayed for get_delay_time() milliseconds. 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, with Gdk::Pixbuf::copy() as it may get recycled as you advance the iterator.

Since gtkmm 2.14:
Returns
The pixbuf to be displayed.
Glib::RefPtr<const Gdk::Pixbuf> 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::Pixbuf::get_width(), Gdk::Pixbuf:get_height()).

This pixbuf should be displayed for get_delay_time() milliseconds. 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, with Gdk::Pixbuf::copy() as it may get recycled as you advance the iterator.

Since gtkmm 2.14:
Returns
The pixbuf to be displayed.
static GType Gdk::PixbufAnimationIter::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

GdkPixbufAnimationIter* Gdk::PixbufAnimationIter::gobj ( )
inline

Provides access to the underlying C GObject.

const GdkPixbufAnimationIter* Gdk::PixbufAnimationIter::gobj ( ) const
inline

Provides access to the underlying C GObject.

GdkPixbufAnimationIter* Gdk::PixbufAnimationIter::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gdk::PixbufAnimationIter::on_currently_loading_frame ( ) const

Used to determine how to respond to the area_updated signal on Gdk::PixbufLoader 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.

Since gtkmm 2.14:
Returns
true if the frame we're on is partially loaded, or the last frame.
PixbufAnimationIter& Gdk::PixbufAnimationIter::operator= ( PixbufAnimationIter&&  src)
noexcept

Friends And Related Function Documentation

Glib::RefPtr< Gdk::PixbufAnimationIter > wrap ( GdkPixbufAnimationIter *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.