GtkImageView Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
GtkAnimViewGtkAnimView — Subclass of GtkImageView capable of playing GIF animations. |
Synopsis
GtkAnimView; GtkWidget * gtk_anim_view_new (void); GdkPixbufAnimation * gtk_anim_view_get_anim (GtkAnimView *aview); void gtk_anim_view_set_anim (GtkAnimView *aview, GdkPixbufAnimation *anim); void gtk_anim_view_set_is_playing (GtkAnimView *aview, gboolean playing); gboolean gtk_anim_view_get_is_playing (GtkAnimView *aview); void gtk_anim_view_step (GtkAnimView *aview);
Object Hierarchy
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkImageView +----GtkAnimView
Description
GtkAnimView subclasses GtkImageView. It has the same look and feel as its parent but is also capable of displaying GIF animations.
Keybindings
GtkAnimView uses a few more keybindings in addition to those used by GtkImageView:
Keys | Corresponding function | Description |
---|---|---|
GDK_p |
gtk_anim_view_set_is_playing() |
Stops or resumes the running animation. |
GDK_j |
gtk_anim_view_step() |
Steps the animation one frame forward. |
Details
GtkAnimView
typedef struct _GtkAnimView GtkAnimView;
GtkAnimView is a subclass of GtkImageView that provies facilities for displaying and controlling an animation.
gtk_anim_view_new ()
GtkWidget * gtk_anim_view_new (void);
Creates a new GtkAnimView with default values. The default values are:
- anim :
NULL
- is_playing :
FALSE
Returns : |
A new GtkAnimView. |
gtk_anim_view_get_anim ()
GdkPixbufAnimation * gtk_anim_view_get_anim (GtkAnimView *aview);
Returns the current animation of the view.
|
a GtkAnimView. |
Returns : |
the current animation |
gtk_anim_view_set_anim ()
void gtk_anim_view_set_anim (GtkAnimView *aview, GdkPixbufAnimation *anim);
Sets the pixbuf animation to play, or NULL
to not play any
animation.
If the animation is a static image or only has one frame, then the static image will be displayed instead. If more frames are loaded into the animation, then GtkAnimView will automatically animate to those frames.
The effect of this method is analoguous to
gtk_image_view_set_pixbuf()
. Fit mode is reset to
GTK_FIT_SIZE_IF_LARGER
so that the whole area of the animation
fits in the view. Three signals are emitted, first the
GtkImageView will emit ::zoom-changed and then ::pixbuf-changed,
second, GtkAnimView itself will emit ::anim-changed.
The default pixbuf animation is NULL
.
|
A GtkAnimView. |
|
A pixbuf animation to play. |
gtk_anim_view_set_is_playing ()
void gtk_anim_view_set_is_playing (GtkAnimView *aview, gboolean playing);
Sets whether the animation should play or not. If there is no current animation this method does not have any effect.
|
a GtkImageView |
|
TRUE to play the animation, FALSE otherwise
|
gtk_anim_view_get_is_playing ()
gboolean gtk_anim_view_get_is_playing (GtkAnimView *aview);
Returns whether the animation is playing or not. If there is no
current animation, this method will always returns FALSE
.
|
A GtkImageView. |
Returns : |
TRUE if an animation is playing, FALSE otherwise.
|
gtk_anim_view_step ()
void gtk_anim_view_step (GtkAnimView *aview);
Steps the animation one frame forward. If the animation is playing it will be stopped. Will it wrap around if the animation is at its last frame?
|
A GtkImageView. |
Signal Details
The "step"
signal
void user_function (GtkAnimView *aview, gpointer user_data) : Run Last / Action
Steps the animation one frame forward. If the animation is
playing it will first be stopped. ::step is a keybinding signal
emitted when GDK_j
is pressed on the widget and should not be
used by clients of this library.
|
a GtkAnimView |
|
user data set when the signal handler was connected. |
The "toggle-running"
signal
void user_function (GtkAnimView *aview, gpointer user_data) : Run Last / Action
Stops the animation if it was playing or resumes it, if it was
playing. ::toggle-running is a keybinding signal emitted when
GDK_p
is pressed on the widget and should not be used by
clients of this library.
|
a GtkAnimView |
|
user data set when the signal handler was connected. |