Commit 4607c8e9 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

fix some shell typos

2001-05-04  Havoc Pennington  <hp@redhat.com>

	* configure.in: fix some shell typos

	* gtk/gtkcolorsel.c (gtk_color_selection_destroy): warning fix

	* gtk/gtkimage.c: handle animations

	* gtk/gtkcheckbutton.c (gtk_check_button_size_request): request
	border_width * 2, not just border_width

	* gtk/gtkscale.c: add "format_value" signal to allow people
	to override the way values are drawn.
	(gtk_scale_get_value_size): fix width/height mistake,
	and compute size from actual displayed text, not
	from made-up text.

	* gtk/gtktexttag.c (gtk_text_tag_class_init): fix return type in
	signal registration

	* tests/testtext.c: Add "Remove all tags" menu item for testing

	* gtk/gtktextbuffer.c (gtk_text_buffer_remove_all_tags): implement

	* demos/gtk-demo/main.c (main): add hack so we can find modules
	without installing gtk

	* demos/gtk-demo/textview.c (insert_text): demo font scaling

	* gtk/gtkcellrenderertext.c: Add "scale" property (font scaling
	factor)
	(gtk_cell_renderer_text_set_property): remove some bogus
	g_object_notify

	* gtk/gtktexttag.c: add "scale" property which is a font scaling
	factor

	* gtk/gtktextlayout.c (add_text_attrs): add font scale attribute
	to layout

	* gtk/gtktextiter.c (gtk_text_iter_is_start): rename from
	gtk_text_iter_is_first

2001-05-04  Havoc Pennington  <hp@redhat.com>

	* pixops/pixops.c (pixops_process): merge fix from stable: Patch
	 from hoshem@mel.comcen.com.au to fix nonzero X offsets.  Fixes
	 bug #50371.

        * gdk-pixbuf/pixops/pixops.c (pixops_composite_nearest): merge
	from stable: Patch from OKADA Mitsuru <m-okada@fjb.co.jp> to fix
	confusion of using "src" instead of "p".
        (pixops_composite_color_nearest): Use a more accurate (and
	correct, to begin with) compositing method.  This cures checks
	showing through on images with no alpha.

	* gdk-pixbuf.c (gdk_pixbuf_fill): fix bug that left some trailing
	bytes unfilled.

	* gdk-pixbuf-io.h: fix UpdatedNotifyFunc to use signed ints

	* gdk-pixbuf-loader.h (struct _GdkPixbufLoaderClass): Change
	area_updated signal to use signed ints.  Removed animation-related
	signals.

	* io-gif.c, io-gif-animation.h, io-gif-animation.c: Massive
	rewrite action

	* gdk-pixbuf-animation.c: Add GdkPixbufAnimationIter to abstract
	all the pesky details. Remove old frame-based API. Make
	GdkPixbufAnimation an abstract base class, derived by the loaders.
parent e585458a
......@@ -32,8 +32,8 @@ libpixbufloader_xpm_la_LIBADD =
#
# The GIF loader
#
libpixbufloader_static_gif_la_SOURCES = io-gif.c
libpixbufloader_gif_la_SOURCES = io-gif.c
libpixbufloader_static_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
libpixbufloader_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
libpixbufloader_gif_la_LDFLAGS = -avoid-version -module
libpixbufloader_gif_la_LIBADD =
......
This diff is collapsed.
......@@ -39,16 +39,15 @@ extern "C" {
typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf *pixbuf, gpointer user_data);
typedef void (* ModuleUpdatedNotifyFunc) (GdkPixbuf *pixbuf,
guint x, guint y,
guint width, guint height,
gpointer user_data);
/* Needed only for animated images. */
typedef void (* ModuleFrameDoneNotifyFunc) (GdkPixbufFrame *frame,
gpointer user_data);
typedef void (* ModuleAnimationDoneNotifyFunc) (GdkPixbuf *pixbuf,
gpointer user_data);
typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf *pixbuf,
GdkPixbufAnimation *anim,
gpointer user_data);
typedef void (* ModuleUpdatedNotifyFunc) (GdkPixbuf *pixbuf,
int x,
int y,
int width,
int height,
gpointer user_data);
typedef struct _GdkPixbufModule GdkPixbufModule;
struct _GdkPixbufModule {
......@@ -63,8 +62,6 @@ struct _GdkPixbufModule {
gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
ModuleFrameDoneNotifyFunc frame_done_func,
ModuleAnimationDoneNotifyFunc anim_done_func,
gpointer user_data,
GError **error);
gboolean (* stop_load) (gpointer context,
......
......@@ -35,8 +35,6 @@
enum {
AREA_UPDATED,
AREA_PREPARED,
FRAME_DONE,
ANIMATION_DONE,
CLOSED,
LAST_SIGNAL
};
......@@ -56,7 +54,6 @@ static guint pixbuf_loader_signals[LAST_SIGNAL] = { 0 };
typedef struct
{
GdkPixbuf *pixbuf;
GdkPixbufAnimation *animation;
gboolean closed;
guchar header_buf[LOADER_HEADER_SIZE];
......@@ -136,25 +133,6 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
G_TYPE_INT,
G_TYPE_INT);
pixbuf_loader_signals[FRAME_DONE] =
g_signal_newc ("frame_done",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, frame_done),
NULL, NULL,
gdk_pixbuf_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
GDK_TYPE_PIXBUF_FRAME);
pixbuf_loader_signals[ANIMATION_DONE] =
g_signal_newc ("animation_done",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, animation_done),
NULL, NULL,
gdk_pixbuf_marshal_VOID__VOID,
G_TYPE_NONE, 0);
pixbuf_loader_signals[CLOSED] =
g_signal_newc ("closed",
G_TYPE_FROM_CLASS (object_class),
......@@ -188,9 +166,6 @@ gdk_pixbuf_loader_finalize (GObject *object)
if (priv->animation)
gdk_pixbuf_animation_unref (priv->animation);
if (priv->pixbuf)
gdk_pixbuf_unref (priv->pixbuf);
g_free (priv);
......@@ -198,26 +173,30 @@ gdk_pixbuf_loader_finalize (GObject *object)
}
static void
gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf,
gpointer loader)
gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf,
GdkPixbufAnimation *anim,
gpointer loader)
{
GdkPixbufLoaderPrivate *priv = NULL;
priv = GDK_PIXBUF_LOADER (loader)->priv;
gdk_pixbuf_ref (pixbuf);
g_assert (priv->pixbuf == NULL);
if (anim)
g_object_ref (G_OBJECT (anim));
else
anim = gdk_pixbuf_non_anim_new (pixbuf);
priv->animation = anim;
priv->pixbuf = pixbuf;
g_signal_emit (G_OBJECT (loader), pixbuf_loader_signals[AREA_PREPARED], 0);
}
static void
gdk_pixbuf_loader_update (GdkPixbuf *pixbuf,
guint x,
guint y,
guint width,
guint height,
gint x,
gint y,
gint width,
gint height,
gpointer loader)
{
GdkPixbufLoaderPrivate *priv = NULL;
......@@ -229,82 +208,8 @@ gdk_pixbuf_loader_update (GdkPixbuf *pixbuf,
0,
x, y,
/* sanity check in here. Defend against an errant loader */
MIN (width, gdk_pixbuf_get_width (priv->pixbuf)),
MIN (height, gdk_pixbuf_get_height (priv->pixbuf)));
}
static void
gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame,
gpointer loader)
{
GdkPixbufLoaderPrivate *priv = NULL;
priv = GDK_PIXBUF_LOADER (loader)->priv;
priv->pixbuf = NULL;
if (priv->animation == NULL)
{
priv->animation = g_object_new (GDK_TYPE_PIXBUF_ANIMATION, NULL);
priv->animation->n_frames = 0;
priv->animation->width = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
}
else
{
int w, h;
/* update bbox size */
w = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
h = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
if (w > priv->animation->width) {
priv->animation->width = w;
}
if (h > priv->animation->height) {
priv->animation->height = h;
}
}
priv->animation->frames = g_list_append (priv->animation->frames, frame);
priv->animation->n_frames++;
g_signal_emit (G_OBJECT (loader),
pixbuf_loader_signals[FRAME_DONE],
0,
frame);
}
static void
gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf,
gpointer loader)
{
GdkPixbufLoaderPrivate *priv = NULL;
GdkPixbufFrame *frame;
GList *current = NULL;
gint h, w;
priv = GDK_PIXBUF_LOADER (loader)->priv;
priv->pixbuf = NULL;
current = gdk_pixbuf_animation_get_frames (priv->animation);
while (current)
{
frame = (GdkPixbufFrame *) current->data;
/* update bbox size */
w = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
h = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
if (w > priv->animation->width)
priv->animation->width = w;
if (h > priv->animation->height)
priv->animation->height = h;
current = current->next;
}
g_signal_emit (G_OBJECT (loader), pixbuf_loader_signals[ANIMATION_DONE], 0);
MIN (width, gdk_pixbuf_animation_get_width (priv->animation)),
MIN (height, gdk_pixbuf_animation_get_height (priv->animation)));
}
static gint
......@@ -353,8 +258,6 @@ gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader,
priv->context = priv->image_module->begin_load (gdk_pixbuf_loader_prepare,
gdk_pixbuf_loader_update,
gdk_pixbuf_loader_frame_done,
gdk_pixbuf_loader_animation_done,
loader,
error);
......@@ -450,7 +353,7 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
{
gint eaten;
eaten = gdk_pixbuf_loader_eat_header_write(loader, buf, count, error);
eaten = gdk_pixbuf_loader_eat_header_write (loader, buf, count, error);
if (eaten <= 0)
return FALSE;
......@@ -540,13 +443,14 @@ gdk_pixbuf_loader_new_with_type (const char *image_type,
* "area_prepared" signal has been emitted by the loader; this means
* that enough data has been read to know the size of the image that
* will be allocated. If the loader has not received enough data via
* gdk_pixbuf_loader_write(), then this function returns NULL. The
* gdk_pixbuf_loader_write(), then this function returns %NULL. The
* returned pixbuf will be the same in all future calls to the loader,
* so simply calling gdk_pixbuf_ref() should be sufficient to continue
* using it. Additionally, if the loader is an animation, it will
* return the first frame of the animation.
* return the "static image" of the animation
* (see gdk_pixbuf_animation_get_static_image()).
*
* Return value: The GdkPixbuf that the loader is creating, or NULL if not
* Return value: The #GdkPixbuf that the loader is creating, or %NULL if not
* enough data has been read to determine how to create the image buffer.
**/
GdkPixbuf *
......@@ -560,19 +464,9 @@ gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader)
priv = loader->priv;
if (priv->animation)
{
GList *list;
list = gdk_pixbuf_animation_get_frames (priv->animation);
if (list != NULL)
{
GdkPixbufFrame *frame = list->data;
return gdk_pixbuf_frame_get_pixbuf (frame);
}
}
return priv->pixbuf;
return gdk_pixbuf_animation_get_static_image (priv->animation);
else
return NULL;
}
/**
......@@ -581,8 +475,9 @@ gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader)
*
* Queries the GdkPixbufAnimation that a pixbuf loader is currently creating.
* In general it only makes sense to call this function afer the "area_prepared"
* signal has been emitted by the loader. If the image is not an animation,
* then it will return NULL.
* signal has been emitted by the loader. If the loader doesn't have enough
* bytes yet (hasn't emitted the area_prepared signal) this function will return
* %NULL.
*
* Return value: The GdkPixbufAnimation that the loader is loading, or NULL if
not enough data has been read to determine the information.
......
......@@ -51,21 +51,21 @@ typedef struct _GdkPixbufLoaderClass GdkPixbufLoaderClass;
struct _GdkPixbufLoaderClass
{
GObjectClass parent_class;
void (*area_prepared) (GdkPixbufLoader *loader);
void (*area_updated) (GdkPixbufLoader *loader,
guint x,
guint y,
guint width,
guint height);
void (*frame_done) (GdkPixbufLoader *loader,
GdkPixbufFrame *frame);
void (*animation_done) (GdkPixbufLoader *loader);
void (*closed) (GdkPixbufLoader *loader);
void (*area_prepared) (GdkPixbufLoader *loader);
/* Last known frame needs a redraw for x, y, width, height */
void (*area_updated) (GdkPixbufLoader *loader,
int x,
int y,
int width,
int height);
void (*closed) (GdkPixbufLoader *loader);
};
GType gdk_pixbuf_loader_get_type (void) G_GNUC_CONST;
GType gdk_pixbuf_loader_get_type (void) G_GNUC_CONST;
GdkPixbufLoader * gdk_pixbuf_loader_new (void);
GdkPixbufLoader * gdk_pixbuf_loader_new_with_type (const char *image_type,
GError **error);
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/* GdkPixbuf library - Private declarations
*
* Copyright (C) 1999 The Free Software Foundation
......@@ -73,22 +74,6 @@ struct _GdkPixbufClass {
};
/* Private part of the GdkPixbufFrame structure */
struct _GdkPixbufFrame {
/* The pixbuf with this frame's image data */
GdkPixbuf *pixbuf;
/* Offsets for overlaying onto the animation's area */
int x_offset;
int y_offset;
/* Frame duration in ms */
int delay_time;
/* Overlay mode */
GdkPixbufFrameAction action;
};
typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
#define GDK_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
......@@ -99,22 +84,50 @@ typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
struct _GdkPixbufAnimation {
GObject parent_instance;
/* Number of frames */
int n_frames;
/* List of GdkPixbufFrame structures */
GList *frames;
/* bounding box size */
int width, height;
};
struct _GdkPixbufAnimationClass {
GObjectClass parent_class;
gboolean (*is_static_image) (GdkPixbufAnimation *anim);
GdkPixbuf* (*get_static_image) (GdkPixbufAnimation *anim);
void (*get_size) (GdkPixbufAnimation *anim,
int *width,
int *height);
GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
const GTimeVal *start_time);
};
typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
#define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
#define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
#define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
struct _GdkPixbufAnimationIter {
GObject parent_instance;
};
struct _GdkPixbufAnimationIterClass {
GObjectClass parent_class;
int (*get_delay_time) (GdkPixbufAnimationIter *iter);
GdkPixbuf* (*get_pixbuf) (GdkPixbufAnimationIter *iter);
gboolean (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
gboolean (*advance) (GdkPixbufAnimationIter *iter,
const GTimeVal *current_time);
};
#define GDK_PIXBUF_INLINE_MAGIC_NUMBER 0x47646B50 /* 'GdkP' */
......@@ -125,6 +138,8 @@ typedef enum
GDK_PIXBUF_INLINE_RLE = 1
} GdkPixbufInlineFormat;
GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
#endif
......@@ -121,6 +121,8 @@ gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf,
g_return_if_fail (dest_x >= 0 && dest_x + width <= dest_pixbuf->width);
g_return_if_fail (dest_y >= 0 && dest_y + height <= dest_pixbuf->height);
g_return_if_fail (!(gdk_pixbuf_get_has_alpha (src_pixbuf) && !gdk_pixbuf_get_has_alpha (dest_pixbuf)));
/* This will perform format conversions automatically */
gdk_pixbuf_scale (src_pixbuf,
......
......@@ -412,7 +412,7 @@ gdk_pixbuf_error_quark (void)
/**
* gdk_pixbuf_fill:
* @pixbuf: a #GdkPixbuf
* @pixel: RGBA pixel to clear to (0xffffff00 is opaque white, 0x000000ff transparent black)
* @pixel: RGBA pixel to clear to (0xffffffff is opaque white, 0x00000000 transparent black)
*
* Clears a pixbuf to the given RGBA value, converting the RGBA value into
* the pixbuf's pixel format. The alpha will be ignored if the pixbuf
......@@ -454,7 +454,7 @@ gdk_pixbuf_fill (GdkPixbuf *pixbuf,
p = pixels;
end = pixels + pixbuf->rowstride * pixbuf->height;
end -= (pixbuf->rowstride - pixbuf->width);
end -= (pixbuf->rowstride - pixbuf->width * pixbuf->n_channels);
while (p < end) {
*p++ = r;
......
......@@ -54,6 +54,7 @@ typedef enum {
/* All of these are opaque structures */
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
typedef struct _GdkPixbufFrame GdkPixbufFrame;
#define GDK_TYPE_PIXBUF (gdk_pixbuf_get_type ())
......@@ -64,6 +65,9 @@ typedef struct _GdkPixbufFrame GdkPixbufFrame;
#define GDK_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimation))
#define GDK_IS_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION))
#define GDK_TYPE_PIXBUF_ANIMATION_ITER (gdk_pixbuf_animation_iter_get_type ())
#define GDK_PIXBUF_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIter))
#define GDK_IS_PIXBUF_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER))
/* Handler that must free the pixel array */
typedef void (* GdkPixbufDestroyNotify) (guchar *pixels, gpointer data);
......@@ -255,13 +259,6 @@ GdkPixbuf *gdk_pixbuf_composite_color_simple (const GdkPixbuf *src,
/* Animation support */
/* GIF-like animation overlay modes for frames */
typedef enum {
GDK_PIXBUF_FRAME_RETAIN,
GDK_PIXBUF_FRAME_DISPOSE,
GDK_PIXBUF_FRAME_REVERT
} GdkPixbufFrameAction;
GType gdk_pixbuf_animation_get_type (void) G_GNUC_CONST;
GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file (const char *filename,
......@@ -272,21 +269,20 @@ void gdk_pixbuf_animation_unref (GdkPixbufAnimation *an
int gdk_pixbuf_animation_get_width (GdkPixbufAnimation *animation);
int gdk_pixbuf_animation_get_height (GdkPixbufAnimation *animation);
GList *gdk_pixbuf_animation_get_frames (GdkPixbufAnimation *animation);
int gdk_pixbuf_animation_get_num_frames (GdkPixbufAnimation *animation);
gboolean gdk_pixbuf_animation_is_static_image (GdkPixbufAnimation *animation);
GdkPixbuf *gdk_pixbuf_animation_get_static_image (GdkPixbufAnimation *animation);
/* Frame accessors */
GdkPixbufAnimationIter *gdk_pixbuf_animation_get_iter (GdkPixbufAnimation *animation,
const GTimeVal *start_time);
GType gdk_pixbuf_animation_iter_get_type (void) G_GNUC_CONST;
int gdk_pixbuf_animation_iter_get_delay_time (GdkPixbufAnimationIter *iter);
GdkPixbuf *gdk_pixbuf_animation_iter_get_pixbuf (GdkPixbufAnimationIter *iter);
gboolean gdk_pixbuf_animation_iter_on_currently_loading_frame (GdkPixbufAnimationIter *iter);
gboolean gdk_pixbuf_animation_iter_advance (GdkPixbufAnimationIter *iter,
const GTimeVal *current_time);
GdkPixbuf *gdk_pixbuf_frame_get_pixbuf (GdkPixbufFrame *frame);
int gdk_pixbuf_frame_get_x_offset (GdkPixbufFrame *frame);
int gdk_pixbuf_frame_get_y_offset (GdkPixbufFrame *frame);
int gdk_pixbuf_frame_get_delay_time (GdkPixbufFrame *frame);
GdkPixbufFrameAction gdk_pixbuf_frame_get_action (GdkPixbufFrame *frame);
GdkPixbufFrame *gdk_pixbuf_frame_copy (GdkPixbufFrame *src);
void gdk_pixbuf_frame_free (GdkPixbufFrame *frame);
GType gdk_pixbuf_frame_get_type (void) G_GNUC_CONST;
#define GDK_TYPE_PIXBUF_FRAME gdk_pixbuf_frame_get_type ()
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
......
......@@ -174,9 +174,7 @@ struct bmp_progressive_state {
static gpointer
gdk_pixbuf__bmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
ModuleFrameDoneNotifyFunc frame_done_func,
ModuleAnimationDoneNotifyFunc
anim_done_func, gpointer user_data,
gpointer user_data,
GError **error);
static gboolean gdk_pixbuf__bmp_image_stop_load(gpointer data, GError **error);
......@@ -198,7 +196,7 @@ static GdkPixbuf *gdk_pixbuf__bmp_image_load(FILE * f, GError **error)
GdkPixbuf *pb;
State =
gdk_pixbuf__bmp_image_begin_load(NULL, NULL, NULL, NULL, NULL,
gdk_pixbuf__bmp_image_begin_load(NULL, NULL, NULL,
error);
if (State == NULL)
......@@ -312,7 +310,7 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
if (State->prepared_func != NULL)
/* Notify the client that we are ready to go */
(*State->prepared_func) (State->pixbuf, State->user_data);
(*State->prepared_func) (State->pixbuf, NULL, State->user_data);
}
......@@ -328,9 +326,7 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
static gpointer
gdk_pixbuf__bmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
ModuleFrameDoneNotifyFunc frame_done_func,
ModuleAnimationDoneNotifyFunc
anim_done_func, gpointer user_data,
gpointer user_data,
GError **error)
{
struct bmp_progressive_state *context;
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/* GdkPixbuf library - GIF loader declarations
*
* Copyright (C) 1999 The Free Software Foundation
*
* Authors: Mark Crichton <crichton@gimp.org>
* Miguel de Icaza <miguel@gnu.org>
* Federico Mena-Quintero <federico@gimp.org>
* Havoc Pennington <hp@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef GDK_PIXBUF_GIF_H
#define GDK_PIXBUF_GIF_H
#include "gdk-pixbuf-private.h"
typedef enum {
/* Keep this frame and composite next frame over it */
/* (GIF disposal method 1) */
GDK_PIXBUF_FRAME_RETAIN,
/* Revert to background color before compositing next frame */
/* (GIF disposal method 2) */
GDK_PIXBUF_FRAME_DISPOSE,
/* Revert to previously-displayed composite image after
* displaying this frame
*/
/* (GIF disposal method 3) */
GDK_PIXBUF_FRAME_REVERT
} GdkPixbufFrameAction;
typedef struct _GdkPixbufGifAnim GdkPixbufGifAnim;
typedef struct _GdkPixbufGifAnimClass GdkPixbufGifAnimClass;
#define GDK_TYPE_PIXBUF_GIF_ANIM (gdk_pixbuf_gif_anim_get_type ())
#define GDK_PIXBUF_GIF_ANIM(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_GIF_ANIM, GdkPixbufGifAnim))
#define GDK_IS_PIXBUF_GIF_ANIM(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_GIF_ANIM))
#define GDK_PIXBUF_GIF_ANIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_GIF_ANIM, GdkPixbufGifAnimClass))
#define GDK_IS_PIXBUF_GIF_ANIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_GIF_ANIM))
#define GDK_PIXBUF_GIF_ANIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_GIF_ANIM, GdkPixbufGifAnimClass))
/* Private part of the GdkPixbufGifAnim structure */
struct _GdkPixbufGifAnim {
GdkPixbufAnimation parent_instance;
/* Number of frames */
int n_frames;
/* Total length of animation */
int total_time;
/* List of GdkPixbufFrame structures */
GList *frames;
/* bounding box size */
int width, height;
guchar bg_red;
guchar bg_green;
guchar bg_blue;
};
struct _GdkPixbufGifAnimClass {
GdkPixbufAnimationClass parent_class;
};
GType gdk_pixbuf_gif_anim_get_type (void) G_GNUC_CONST;
typedef struct _GdkPixbufGifAnimIter GdkPixbufGifAnimIter;
typedef struct _GdkPixbufGifAnimIterClass GdkPixbufGifAnimIterClass;
#define GDK_TYPE_PIXBUF_GIF_ANIM_ITER (gdk_pixbuf_gif_anim_iter_get_type ())
#define GDK_PIXBUF_GIF_ANIM_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_GIF_ANIM_ITER, GdkPixbufGifAnimIter))
#define GDK_IS_PIXBUF_GIF_ANIM_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_GIF_ANIM_ITER))
#define GDK_PIXBUF_GIF_ANIM_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_GIF_ANIM_ITER, GdkPixbufGifAnimIterClass))
#define GDK_IS_PIXBUF_GIF_ANIM_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_GIF_ANIM_ITER))
#define GDK_PIXBUF_GIF_ANIM_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_GIF_ANIM_ITER, GdkPixbufGifAnimIterClass))
struct _GdkPixbufGifAnimIter {
GdkPixbufAnimationIter parent_instance;
GdkPixbufGifAnim *gif_anim;
GTimeVal start_time;
GTimeVal current_time;
/* Time in milliseconds into this run of the animation */
gint position;
GList *current_frame;
};
struct _GdkPixbufGifAnimIterClass {
GdkPixbufAnimationIterClass parent_class;
};
GType gdk_pixbuf_gif_anim_iter_get_type (void) G_GNUC_CONST;
struct _GdkPixbufFrame {
/* The pixbuf with this frame's image data */
GdkPixbuf *pixbuf;
/* Offsets for overlaying onto the GIF graphic area */
int x_offset;
int y_offset;
/* Frame duration in ms */
int delay_time;
/* Sum of preceding delay times */
int elapsed;
/* Overlay mode */
GdkPixbufFrameAction action;
/* TRUE if the pixbuf has been modified since
* the last frame composite operation
*/
gboolean need_recomposite;
/* TRUE if the background for this frame is transparent */
gboolean bg_transparent;
/* The below reflects the "use hell of a lot of RAM"
* philosophy of coding
*/
/* Cached composite image (the image you actually display
* for this frame)
*/
GdkPixbuf *composited;
/* Cached revert image (the contents of the area
* covered by the frame prior to compositing;
* same size as pixbuf, not as the composite image; only
* used for FRAME_REVERT frames)
*/
GdkPixbuf *revert;
};
void gdk_pixbuf_gif_anim_frame_composite (GdkPixbufGifAnim *gif_anim,
GdkPixbufFrame *frame);
#endif
This diff is collapsed.
......@@ -156,8 +156,6 @@ struct ico_progressive_state {
static gpointer
gdk_pixbuf__ico_image_begin_load(ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,