2000-01-02 03:59:22 +00:00
|
|
|
|
/* GdkPixbuf library - Simple animation support
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 1999 The Free Software Foundation
|
|
|
|
|
*
|
|
|
|
|
* Authors: Jonathan Blandford <jrb@redhat.com>
|
|
|
|
|
* Havoc Pennington <hp@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2000-01-02 03:59:22 +00:00
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
2000-01-02 03:59:22 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2000-01-02 03:59:22 +00:00
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
2000-10-18 18:42:54 +00:00
|
|
|
|
#include <errno.h>
|
2000-01-02 03:59:22 +00:00
|
|
|
|
#include "gdk-pixbuf-io.h"
|
2000-04-11 07:03:25 +00:00
|
|
|
|
#include "gdk-pixbuf-private.h"
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
2000-06-22 15:36:12 +00:00
|
|
|
|
static void gdk_pixbuf_animation_class_init (GdkPixbufAnimationClass *klass);
|
|
|
|
|
static void gdk_pixbuf_animation_finalize (GObject *object);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static gpointer parent_class;
|
|
|
|
|
|
|
|
|
|
GType
|
|
|
|
|
gdk_pixbuf_animation_get_type (void)
|
|
|
|
|
{
|
|
|
|
|
static GType object_type = 0;
|
|
|
|
|
|
|
|
|
|
if (!object_type) {
|
|
|
|
|
static const GTypeInfo object_info = {
|
|
|
|
|
sizeof (GdkPixbufAnimationClass),
|
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
|
(GClassInitFunc) gdk_pixbuf_animation_class_init,
|
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
|
NULL, /* class_data */
|
|
|
|
|
sizeof (GdkPixbufAnimation),
|
|
|
|
|
0, /* n_preallocs */
|
|
|
|
|
(GInstanceInitFunc) NULL,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
object_type = g_type_register_static (G_TYPE_OBJECT,
|
|
|
|
|
"GdkPixbufAnimation",
|
urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if
Wed Oct 25 20:47:41 2000 Tim Janik <timj@gtk.org>
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): urg, removed
implementation of gtk_marshal_VOID__INT_INT_INT_INT. if people do that,
couldn't they at least give it a non-standard name?
* gtk/gtktextlayout.c: arg! yet another implementation of
gtk_marshal_VOID__INT_INT_INT_INT(), is this a conspiracy?
* gtk/gtktextbuffer.c: gotcha! captured a vagabonding
gtk_marshal_VOID__INT_POINTER_INT() implementation, braught it back
home. now i know this _is_ a conspiracy.
* gtk/gtkwidget.c (gtk_widget_class_init): marshaller fixups for
::state-changed.
* gtk/gtkaccelgroup.c (gtk_accel_group_create_remove):
(gtk_accel_group_create_add): marshaller signature fixups.
* gtk/gtklistitem.c (gtk_list_item_class_init): signal creation fixups,
pass in GTK_TYPE_SCROLL_TYPE instead of GTK_TYPE_ENUM.
* gtk/gtkobject.[hc]: removed GTK_CONNECTED flag, it's not valid
anymore.
Tue Oct 24 23:59:21 2000 Tim Janik <timj@gtk.org>
* docs/reference/Makefile.am: disabled SUBDIRS for the moment, since
due to the signal system changes, it wouldn't build currently. to
be fixed soon.
* docs/Changes-2.0.txt: GtkSignal/GSignal updates.
* gtk/gtkwidget.c: ::direction_changed takes an enum as argument,
so it needs gtk_marshal_VOID__ENUM() instead of
gtk_marshal_NONE__UINT().
* gdk/gdk*.c: adapted type registration functions.
* gtk/gtkbindings.c:
* gtk/gtkaccelgroup.c: operate on GSignalQuery, GtkSignalQuery is
gone.
* gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType.
* gtk/gtkobject.c:
(gtk_object_destroy):
(gtk_object_shutdown): fixed recursion guards. basically we have to
catch the case where any of GObject.shutdown() or gtk_object_destroy()
is called during ::destroy, and avoid recursion there.
* gtk/gtktypeutils.c:
* gtk/maketypes.awk: awk-script hackup to provide gtk_type_init() with
boxed_copy/boxed_free. this needs a more general solution based on a
publically installed code-generator utility.
* gtk/gtktypeutils.[hc]: compat aliased GTK_TYPE_BOXED to G_TYPE_BOXED,
glib's gobject has support for that now.
define GtkSignalMarshaller in terms of GSignalCMarshaller.
Mon Oct 23 09:36:42 2000 Tim Janik <timj@gtk.org>
* gtk/gtksignal.[hc]:
* gtk/gtkmarshal.[hc]:
* gtk/Makefile.am: generate marshallers with glib-genmarshal and don't
compile gtkmarshal.c on its own anymore, just include it in gtksignal.c.
removed #include <gtkmarshal.h>s all over the place, gtksignal.h takes
care of that.
* *.c: marshaller name fixups.
* gtk/gtkmarshal.list: added a comment briefing the format.
Sun Oct 22 23:14:39 2000 Tim Janik <timj@gtk.org>
* gtk/gtksignal.[hc]: nuked old implementation. we mostly have
compatibility macros here now. more specifically, most of
the API is preserved (yes, _most_, nonwithstanding the
following exceptions listed, the API is stil lHUGE ;)
things that got removed completely:
GtkSignalQuery, gtk_signal_query(), gtk_signal_n_emissions(),
gtk_signal_n_emissions_by_name(), gtk_signal_handlers_destroy(),
gtk_signal_set_funcs(), gtk_signal_handler_pending_by_id(),
gtk_signal_add_emission_hook(), gtk_signal_add_emission_hook_full(),
gtk_signal_remove_emission_hook().
non-functional functions variants:
gtk_signal_add_emission_hook(), gtk_signal_remove_emission_hook().
the GtkCallbackMarshal argument to gtk_signal_connect_full() is
not supported anymore.
(gtk_signal_compat_matched): new internal function to aid
implementation of the compatibility macros, it provides
functionality to block/unblock/disconnect handlers based
on func/data.
* gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType,
* *.c: adaptions to new type registration API signatures.
Fri Oct 20 15:26:33 2000 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.[hc]: removed G_TYPE_GTK_POINTER cludge.
2000-10-25 22:34:14 +00:00
|
|
|
|
&object_info, 0);
|
2000-06-22 15:36:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return object_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdk_pixbuf_animation_class_init (GdkPixbufAnimationClass *klass)
|
|
|
|
|
{
|
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
|
|
|
|
|
object_class->finalize = gdk_pixbuf_animation_finalize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdk_pixbuf_animation_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GdkPixbufAnimation *animation = GDK_PIXBUF_ANIMATION (object);
|
|
|
|
|
|
|
|
|
|
GList *l;
|
|
|
|
|
GdkPixbufFrame *frame;
|
|
|
|
|
|
|
|
|
|
for (l = animation->frames; l; l = l->next) {
|
|
|
|
|
frame = l->data;
|
|
|
|
|
gdk_pixbuf_unref (frame->pixbuf);
|
|
|
|
|
g_free (frame);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_list_free (animation->frames);
|
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
|
}
|
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_new_from_file:
|
|
|
|
|
* @filename: Name of file to load.
|
2000-10-18 18:42:54 +00:00
|
|
|
|
* @error: return location for error
|
2000-01-02 03:59:22 +00:00
|
|
|
|
*
|
|
|
|
|
* Creates a new animation by loading it from a file. The file format is
|
|
|
|
|
* detected automatically. If the file's format does not support multi-frame
|
2000-10-18 18:42:54 +00:00
|
|
|
|
* images, then an animation with a single frame will be created. Possible errors
|
|
|
|
|
* are in the #GDK_PIXBUF_ERROR and #G_FILE_ERROR domains.
|
2000-01-02 03:59:22 +00:00
|
|
|
|
*
|
|
|
|
|
* Return value: A newly created animation with a reference count of 1, or NULL
|
|
|
|
|
* if any of several error conditions ocurred: the file could not be opened,
|
|
|
|
|
* there was no loader for the file's format, there was not enough memory to
|
|
|
|
|
* allocate the image buffer, or the image file contained invalid data.
|
|
|
|
|
**/
|
|
|
|
|
GdkPixbufAnimation *
|
2000-10-18 18:42:54 +00:00
|
|
|
|
gdk_pixbuf_animation_new_from_file (const char *filename,
|
|
|
|
|
GError **error)
|
2000-01-02 03:59:22 +00:00
|
|
|
|
{
|
|
|
|
|
GdkPixbufAnimation *animation;
|
|
|
|
|
int size;
|
|
|
|
|
FILE *f;
|
|
|
|
|
guchar buffer [128];
|
|
|
|
|
GdkPixbufModule *image_module;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (filename != NULL, NULL);
|
|
|
|
|
|
2000-07-22 23:50:19 +00:00
|
|
|
|
f = fopen (filename, "rb");
|
2000-10-18 18:42:54 +00:00
|
|
|
|
if (!f) {
|
|
|
|
|
g_set_error (error,
|
|
|
|
|
G_FILE_ERROR,
|
|
|
|
|
g_file_error_from_errno (errno),
|
|
|
|
|
_("Failed to open file '%s': %s"),
|
|
|
|
|
filename, g_strerror (errno));
|
2000-01-02 03:59:22 +00:00
|
|
|
|
return NULL;
|
2000-10-18 18:42:54 +00:00
|
|
|
|
}
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
|
|
|
|
size = fread (&buffer, 1, sizeof (buffer), f);
|
|
|
|
|
|
|
|
|
|
if (size == 0) {
|
2000-10-18 18:42:54 +00:00
|
|
|
|
g_set_error (error,
|
|
|
|
|
GDK_PIXBUF_ERROR,
|
|
|
|
|
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
|
|
|
|
_("Image file '%s' contains no data"),
|
|
|
|
|
filename);
|
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
fclose (f);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-18 18:42:54 +00:00
|
|
|
|
image_module = gdk_pixbuf_get_module (buffer, size, filename, error);
|
2000-01-02 03:59:22 +00:00
|
|
|
|
if (!image_module) {
|
|
|
|
|
fclose (f);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (image_module->module == NULL)
|
2000-10-18 18:42:54 +00:00
|
|
|
|
if (!gdk_pixbuf_load_module (image_module, error)) {
|
|
|
|
|
fclose (f);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
|
|
|
|
if (image_module->load_animation == NULL) {
|
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
|
GdkPixbufFrame *frame;
|
|
|
|
|
|
|
|
|
|
/* Keep this logic in sync with gdk_pixbuf_new_from_file() */
|
|
|
|
|
|
|
|
|
|
if (image_module->load == NULL) {
|
2000-10-18 18:42:54 +00:00
|
|
|
|
g_set_error (error,
|
|
|
|
|
GDK_PIXBUF_ERROR,
|
|
|
|
|
GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
|
|
|
|
|
_("Don't know how to load the animation in file '%s'"),
|
|
|
|
|
filename);
|
2000-01-02 03:59:22 +00:00
|
|
|
|
fclose (f);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fseek (f, 0, SEEK_SET);
|
2000-10-18 18:42:54 +00:00
|
|
|
|
pixbuf = (* image_module->load) (f, error);
|
2000-01-02 03:59:22 +00:00
|
|
|
|
fclose (f);
|
|
|
|
|
|
2000-10-18 18:42:54 +00:00
|
|
|
|
if (pixbuf == NULL && error != NULL && *error == NULL) {
|
|
|
|
|
/* I don't trust these crufty longjmp()'ing image libs
|
|
|
|
|
* to maintain proper error invariants, and I don't
|
|
|
|
|
* want user code to segfault as a result. We need to maintain
|
|
|
|
|
* the invariant that error gets set if NULL is returned.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.",
|
|
|
|
|
image_module->module_name);
|
|
|
|
|
g_set_error (error,
|
|
|
|
|
GDK_PIXBUF_ERROR,
|
|
|
|
|
GDK_PIXBUF_ERROR_FAILED,
|
|
|
|
|
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
|
|
|
|
filename);
|
|
|
|
|
}
|
|
|
|
|
|
2000-06-22 15:36:12 +00:00
|
|
|
|
if (pixbuf == NULL)
|
|
|
|
|
return NULL;
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
|
|
|
|
frame = g_new (GdkPixbufFrame, 1);
|
|
|
|
|
frame->pixbuf = pixbuf;
|
|
|
|
|
frame->x_offset = 0;
|
|
|
|
|
frame->y_offset = 0;
|
|
|
|
|
frame->delay_time = -1;
|
|
|
|
|
frame->action = GDK_PIXBUF_FRAME_RETAIN;
|
|
|
|
|
|
2000-07-11 04:46:11 +00:00
|
|
|
|
animation = g_object_new (GDK_TYPE_PIXBUF_ANIMATION, NULL);
|
2000-06-22 15:36:12 +00:00
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
animation->n_frames = 1;
|
|
|
|
|
animation->frames = g_list_prepend (NULL, frame);
|
2000-04-03 08:59:43 +00:00
|
|
|
|
animation->width = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
|
animation->height = gdk_pixbuf_get_height (pixbuf);
|
2000-01-02 03:59:22 +00:00
|
|
|
|
} else {
|
|
|
|
|
fseek (f, 0, SEEK_SET);
|
2000-10-18 18:42:54 +00:00
|
|
|
|
animation = (* image_module->load_animation) (f, error);
|
|
|
|
|
|
|
|
|
|
if (animation == NULL && error != NULL && *error == NULL) {
|
|
|
|
|
/* I don't trust these crufty longjmp()'ing
|
|
|
|
|
* image libs to maintain proper error
|
|
|
|
|
* invariants, and I don't want user code to
|
|
|
|
|
* segfault as a result. We need to maintain
|
|
|
|
|
* the invariant that error gets set if NULL
|
|
|
|
|
* is returned.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.",
|
|
|
|
|
image_module->module_name);
|
|
|
|
|
g_set_error (error,
|
|
|
|
|
GDK_PIXBUF_ERROR,
|
|
|
|
|
GDK_PIXBUF_ERROR_FAILED,
|
|
|
|
|
_("Failed to load animation '%s': reason not known, probably a corrupt animation file"),
|
|
|
|
|
filename);
|
|
|
|
|
}
|
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
fclose (f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return animation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_ref:
|
|
|
|
|
* @animation: An animation.
|
|
|
|
|
*
|
2000-06-22 15:36:12 +00:00
|
|
|
|
* Adds a reference to an animation. Deprecated; use
|
|
|
|
|
* g_object_ref(). The reference must be released afterwards using
|
|
|
|
|
* g_object_unref().
|
2000-01-21 22:54:44 +00:00
|
|
|
|
*
|
|
|
|
|
* Return value: The same as the @animation argument.
|
2000-01-02 03:59:22 +00:00
|
|
|
|
**/
|
2000-01-21 22:54:44 +00:00
|
|
|
|
GdkPixbufAnimation *
|
2000-01-02 03:59:22 +00:00
|
|
|
|
gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation)
|
|
|
|
|
{
|
2000-06-22 15:36:12 +00:00
|
|
|
|
return (GdkPixbufAnimation*) g_object_ref (G_OBJECT (animation));
|
2000-01-02 03:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_unref:
|
|
|
|
|
* @animation: An animation.
|
|
|
|
|
*
|
2000-06-22 15:36:12 +00:00
|
|
|
|
* Removes a reference from an animation. Deprecated; use g_object_unref().
|
2000-01-02 03:59:22 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation)
|
|
|
|
|
{
|
2000-06-22 15:36:12 +00:00
|
|
|
|
g_object_unref (G_OBJECT (animation));
|
2000-01-02 03:59:22 +00:00
|
|
|
|
}
|
2000-04-04 04:50:39 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_get_width:
|
|
|
|
|
* @animation: An animation.
|
2000-04-13 01:18:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Queries the width of the bounding box of a pixbuf animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
*
|
2000-04-13 01:18:41 +00:00
|
|
|
|
* Return value: Width of the bounding box of the animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
**/
|
|
|
|
|
int
|
|
|
|
|
gdk_pixbuf_animation_get_width (GdkPixbufAnimation *animation)
|
|
|
|
|
{
|
2000-04-13 01:18:41 +00:00
|
|
|
|
g_return_val_if_fail (animation != NULL, -1);
|
2000-04-04 04:50:39 +00:00
|
|
|
|
|
|
|
|
|
return animation->width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_get_height:
|
|
|
|
|
* @animation: An animation.
|
2000-04-13 01:18:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Queries the height of the bounding box of a pixbuf animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
*
|
2000-04-13 01:18:41 +00:00
|
|
|
|
* Return value: Height of the bounding box of the animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
**/
|
|
|
|
|
int
|
|
|
|
|
gdk_pixbuf_animation_get_height (GdkPixbufAnimation *animation)
|
|
|
|
|
{
|
2000-04-13 01:18:41 +00:00
|
|
|
|
g_return_val_if_fail (animation != NULL, -1);
|
2000-04-04 04:50:39 +00:00
|
|
|
|
|
|
|
|
|
return animation->height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_get_num_frames:
|
|
|
|
|
* @animation: An animation.
|
2000-04-13 01:18:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Queries the number of frames in a pixbuf animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
*
|
2000-04-13 01:18:41 +00:00
|
|
|
|
* Return value: Number of frames in the animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
**/
|
|
|
|
|
int
|
|
|
|
|
gdk_pixbuf_animation_get_num_frames (GdkPixbufAnimation *animation)
|
|
|
|
|
{
|
2000-04-13 01:18:41 +00:00
|
|
|
|
g_return_val_if_fail (animation != NULL, -1);
|
2000-04-04 04:50:39 +00:00
|
|
|
|
|
|
|
|
|
return animation->n_frames;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_animation_get_frames:
|
|
|
|
|
* @animation: An animation.
|
2000-04-13 01:18:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Queries the list of frames of an animation.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
*
|
2000-04-13 01:18:41 +00:00
|
|
|
|
* Return value: List of frames in the animation; this is a #GList of
|
|
|
|
|
* #GdkPixbufFrame structures.
|
2000-04-04 04:50:39 +00:00
|
|
|
|
**/
|
|
|
|
|
GList *
|
|
|
|
|
gdk_pixbuf_animation_get_frames (GdkPixbufAnimation *animation)
|
|
|
|
|
{
|
2000-04-13 01:18:41 +00:00
|
|
|
|
g_return_val_if_fail (animation != NULL, NULL);
|
2000-04-04 04:50:39 +00:00
|
|
|
|
|
|
|
|
|
return animation->frames;
|
|
|
|
|
}
|
2000-04-11 07:03:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_frame_get_pixbuf:
|
|
|
|
|
* @frame: A pixbuf animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Queries the pixbuf of an animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Return value: A pixbuf.
|
|
|
|
|
**/
|
|
|
|
|
GdkPixbuf *
|
|
|
|
|
gdk_pixbuf_frame_get_pixbuf (GdkPixbufFrame *frame)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (frame != NULL, NULL);
|
|
|
|
|
|
|
|
|
|
return frame->pixbuf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_frame_get_x_offset:
|
|
|
|
|
* @frame: A pixbuf animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Queries the X offset of an animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Return value: X offset from the top left corner of the animation.
|
|
|
|
|
**/
|
|
|
|
|
int
|
|
|
|
|
gdk_pixbuf_frame_get_x_offset (GdkPixbufFrame *frame)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (frame != NULL, -1);
|
|
|
|
|
|
|
|
|
|
return frame->x_offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_frame_get_y_offset:
|
|
|
|
|
* @frame: A pixbuf animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Queries the Y offset of an animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Return value: Y offset from the top left corner of the animation.
|
|
|
|
|
**/
|
|
|
|
|
int
|
|
|
|
|
gdk_pixbuf_frame_get_y_offset (GdkPixbufFrame *frame)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (frame != NULL, -1);
|
|
|
|
|
|
|
|
|
|
return frame->y_offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_frame_get_delay_time:
|
|
|
|
|
* @frame: A pixbuf animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Queries the delay time in milliseconds of an animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Return value: Delay time in milliseconds.
|
|
|
|
|
**/
|
|
|
|
|
int
|
|
|
|
|
gdk_pixbuf_frame_get_delay_time (GdkPixbufFrame *frame)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (frame != NULL, -1);
|
|
|
|
|
|
|
|
|
|
return frame->delay_time;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_pixbuf_frame_get_action:
|
|
|
|
|
* @frame: A pixbuf animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Queries the overlay action of an animation frame.
|
|
|
|
|
*
|
|
|
|
|
* Return value: Overlay action for this frame.
|
|
|
|
|
**/
|
|
|
|
|
GdkPixbufFrameAction
|
|
|
|
|
gdk_pixbuf_frame_get_action (GdkPixbufFrame *frame)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (frame != NULL, GDK_PIXBUF_FRAME_RETAIN);
|
|
|
|
|
|
|
|
|
|
return frame->action;
|
|
|
|
|
}
|