make the current version number 1.3.1 (binary age 0, interface age 0).

Fri Jun 23 17:54:23 2000  Tim Janik  <timj@gtk.org>

        * configure.in: make the current version number 1.3.1 (binary age 0,
        interface age 0).

        * gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
        gtkcompat.h is all we want.

        * gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
        GLib primitive types. fixed g_type_register_fundamental() argument
        ordering.

        * gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
        compiles.

        * gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
        object code cleanup, comment trigraph fixes, etc...
This commit is contained in:
Tim Janik
2000-06-24 22:32:05 +00:00
committed by Tim Janik
parent 3ef478ecd7
commit 100c9594d6
19 changed files with 937 additions and 910 deletions

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -1,3 +1,21 @@
Fri Jun 23 17:54:23 2000 Tim Janik <timj@gtk.org>
* configure.in: make the current version number 1.3.1 (binary age 0,
interface age 0).
* gtkfeatures.h, gtkfeatures.h.in: dejavue, get rid of these *again*,
gtkcompat.h is all we want.
* gtk/gtktypeutils.[hc]: define most of the primitive types in terms of
GLib primitive types. fixed g_type_register_fundamental() argument
ordering.
* gtk-config.in (lib_gtk): add -lgdk_pixbuf so third party code
compiles.
* gdk-pixbuf-loader.[hc]: get rid of unistd.h include.
object code cleanup, comment trigraph fixes, etc...
2000-06-23 Havoc Pennington <hp@redhat.com> 2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark

View File

@ -29,7 +29,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
# #
GTK_MAJOR_VERSION=1 GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=3 GTK_MINOR_VERSION=3
GTK_MICRO_VERSION=0 GTK_MICRO_VERSION=1
GTK_INTERFACE_AGE=0 GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0 GTK_BINARY_AGE=0
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
@ -1001,7 +1001,6 @@ gdk/win32/Makefile
gdk/nanox/Makefile gdk/nanox/Makefile
gdk/linux-fb/Makefile gdk/linux-fb/Makefile
gtk/Makefile gtk/Makefile
gtk/gtkfeatures.h
gtk/gtkcompat.h gtk/gtkcompat.h
modules/Makefile modules/Makefile
modules/linux-fb/Makefile modules/linux-fb/Makefile

View File

@ -1,5 +1,3 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GdkPixbuf library - Main header file /* GdkPixbuf library - Main header file
* *
* Copyright (C) 1999 The Free Software Foundation * Copyright (C) 1999 The Free Software Foundation
@ -31,8 +29,6 @@
#include "gtksignal.h" #include "gtksignal.h"
enum { enum {
AREA_UPDATED, AREA_UPDATED,
AREA_PREPARED, AREA_PREPARED,
@ -42,22 +38,22 @@ enum {
LAST_SIGNAL LAST_SIGNAL
}; };
static GtkObjectClass *parent_class;
static void gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *klass); static void gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *klass);
static void gdk_pixbuf_loader_init (GdkPixbufLoader *loader); static void gdk_pixbuf_loader_init (GdkPixbufLoader *loader);
static void gdk_pixbuf_loader_destroy (GtkObject *loader); static void gdk_pixbuf_loader_destroy (GtkObject *loader);
static void gdk_pixbuf_loader_finalize (GObject *loader); static void gdk_pixbuf_loader_finalize (GObject *loader);
static gpointer parent_class = NULL;
static guint pixbuf_loader_signals[LAST_SIGNAL] = { 0 }; static guint pixbuf_loader_signals[LAST_SIGNAL] = { 0 };
/* Internal data */ /* Internal data */
#define LOADER_HEADER_SIZE 128 #define LOADER_HEADER_SIZE 128
typedef struct { typedef struct
{
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkPixbufAnimation *animation; GdkPixbufAnimation *animation;
gboolean closed; gboolean closed;
@ -67,10 +63,9 @@ typedef struct {
gpointer context; gpointer context;
} GdkPixbufLoaderPrivate; } GdkPixbufLoaderPrivate;
/* our marshaller */ /* our marshaller */
typedef void (* GtkSignal_NONE__INT_INT_INT_INT) (GtkObject *object, typedef void (*GtkSignal_NONE__INT_INT_INT_INT) (GtkObject *object,
gint arg1, gint arg2, gint arg3, gint arg4, gint arg1, gint arg2, gint arg3, gint arg4,
gpointer user_data); gpointer user_data);
static void static void
@ -88,7 +83,6 @@ gtk_marshal_NONE__INT_INT_INT_INT (GtkObject *object, GtkSignalFunc func, gpoint
func_data); func_data);
} }
/** /**
* gdk_pixbuf_loader_get_type: * gdk_pixbuf_loader_get_type:
@ -104,7 +98,8 @@ gdk_pixbuf_loader_get_type (void)
{ {
static GtkType loader_type = 0; static GtkType loader_type = 0;
if (!loader_type) { if (!loader_type)
{
static const GtkTypeInfo loader_info = { static const GtkTypeInfo loader_info = {
"GdkPixbufLoader", "GdkPixbufLoader",
sizeof (GdkPixbufLoader), sizeof (GdkPixbufLoader),
@ -131,7 +126,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
object_class = (GtkObjectClass *) class; object_class = (GtkObjectClass *) class;
gobject_class = (GObjectClass *) class; gobject_class = (GObjectClass *) class;
parent_class = gtk_type_class (gtk_object_get_type ()); parent_class = gtk_type_class (GTK_TYPE_OBJECT);
pixbuf_loader_signals[AREA_PREPARED] = pixbuf_loader_signals[AREA_PREPARED] =
gtk_signal_new ("area_prepared", gtk_signal_new ("area_prepared",
@ -214,7 +209,7 @@ gdk_pixbuf_loader_destroy (GtkObject *object)
gdk_pixbuf_unref (priv->pixbuf); gdk_pixbuf_unref (priv->pixbuf);
if (GTK_OBJECT_CLASS (parent_class)->destroy) if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object); GTK_OBJECT_CLASS (parent_class)->destroy (object);
} }
static void static void
@ -229,16 +224,18 @@ gdk_pixbuf_loader_finalize (GObject *object)
g_free (priv); g_free (priv);
if (G_OBJECT_CLASS (parent_class)->finalize) if (G_OBJECT_CLASS (parent_class)->finalize)
(* G_OBJECT_CLASS (parent_class)->finalize) (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }
static void static void
gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf, gpointer loader) gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
priv = GDK_PIXBUF_LOADER (loader)->private; priv = GDK_PIXBUF_LOADER (loader)->private;
gdk_pixbuf_ref (pixbuf); gdk_pixbuf_ref (pixbuf);
g_assert (priv->pixbuf == NULL); g_assert (priv->pixbuf == NULL);
priv->pixbuf = pixbuf; priv->pixbuf = pixbuf;
@ -246,7 +243,12 @@ gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf, gpointer loader)
} }
static void static void
gdk_pixbuf_loader_update (GdkPixbuf *pixbuf, guint x, guint y, guint width, guint height, gpointer loader) gdk_pixbuf_loader_update (GdkPixbuf *pixbuf,
guint x,
guint y,
guint width,
guint height,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
@ -261,7 +263,8 @@ gdk_pixbuf_loader_update (GdkPixbuf *pixbuf, guint x, guint y, guint width, guin
} }
static void static void
gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader) gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
@ -269,13 +272,16 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader)
priv->pixbuf = NULL; priv->pixbuf = NULL;
if (priv->animation == NULL) { if (priv->animation == NULL)
{
priv->animation = GDK_PIXBUF_ANIMATION (g_type_create_instance (GDK_TYPE_PIXBUF_ANIMATION)); priv->animation = GDK_PIXBUF_ANIMATION (g_type_create_instance (GDK_TYPE_PIXBUF_ANIMATION));
priv->animation->n_frames = 0; priv->animation->n_frames = 0;
priv->animation->width = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset; priv->animation->width = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset; priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
} else { }
else
{
int w, h; int w, h;
/* update bbox size */ /* update bbox size */
@ -291,14 +297,15 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader)
} }
priv->animation->frames = g_list_append (priv->animation->frames, frame); priv->animation->frames = g_list_append (priv->animation->frames, frame);
priv->animation->n_frames ++; priv->animation->n_frames++;
gtk_signal_emit (GTK_OBJECT (loader), gtk_signal_emit (GTK_OBJECT (loader),
pixbuf_loader_signals[FRAME_DONE], pixbuf_loader_signals[FRAME_DONE],
frame); frame);
} }
static void static void
gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf, gpointer loader) gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
GdkPixbufFrame *frame; GdkPixbufFrame *frame;
@ -310,28 +317,24 @@ gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf, gpointer loader)
current = gdk_pixbuf_animation_get_frames (priv->animation); current = gdk_pixbuf_animation_get_frames (priv->animation);
while (current) { while (current)
{
frame = (GdkPixbufFrame *) current->data; frame = (GdkPixbufFrame *) current->data;
/* update bbox size */ /* update bbox size */
w = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset; w = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
h = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset; h = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
if (w > priv->animation->width) { if (w > priv->animation->width)
priv->animation->width = w; priv->animation->width = w;
} if (h > priv->animation->height)
if (h > priv->animation->height) {
priv->animation->height = h; priv->animation->height = h;
}
current = current->next; current = current->next;
} }
gtk_signal_emit (GTK_OBJECT (loader), gtk_signal_emit (GTK_OBJECT (loader), pixbuf_loader_signals[ANIMATION_DONE]);
pixbuf_loader_signals[ANIMATION_DONE]);
} }
/** /**
* gdk_pixbuf_loader_new: * gdk_pixbuf_loader_new:
* *
@ -342,11 +345,11 @@ gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf, gpointer loader)
GdkPixbufLoader * GdkPixbufLoader *
gdk_pixbuf_loader_new (void) gdk_pixbuf_loader_new (void)
{ {
return gtk_type_new (gdk_pixbuf_loader_get_type ()); return g_object_new (GDK_TYPE_PIXBUF_LOADER, NULL);
} }
static int static gint
gdk_pixbuf_loader_load_module(GdkPixbufLoader *loader) gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader)
{ {
GdkPixbufLoaderPrivate *priv = loader->private; GdkPixbufLoaderPrivate *priv = loader->private;
@ -363,45 +366,51 @@ gdk_pixbuf_loader_load_module(GdkPixbufLoader *loader)
if ((priv->image_module->begin_load == NULL) || if ((priv->image_module->begin_load == NULL) ||
(priv->image_module->stop_load == NULL) || (priv->image_module->stop_load == NULL) ||
(priv->image_module->load_increment == NULL)) { (priv->image_module->load_increment == NULL))
g_warning ("module %s does not support incremental loading.\n", {
g_warning (G_STRLOC ": module %s does not support incremental loading.\n",
priv->image_module->module_name); priv->image_module->module_name);
return 0; return 0;
} }
priv->context = (*priv->image_module->begin_load) (gdk_pixbuf_loader_prepare, priv->context = priv->image_module->begin_load (gdk_pixbuf_loader_prepare,
gdk_pixbuf_loader_update, gdk_pixbuf_loader_update,
gdk_pixbuf_loader_frame_done, gdk_pixbuf_loader_frame_done,
gdk_pixbuf_loader_animation_done, gdk_pixbuf_loader_animation_done,
loader); loader);
if (priv->context == NULL) { if (priv->context == NULL)
g_warning("Failed to begin progressive load"); {
g_warning (G_STRLOC ": Failed to begin progressive load");
return 0; return 0;
} }
if( (* priv->image_module->load_increment) (priv->context, priv->header_buf, priv->header_buf_offset) ) if (priv->image_module->load_increment (priv->context, priv->header_buf, priv->header_buf_offset))
return priv->header_buf_offset; return priv->header_buf_offset;
return 0; return 0;
} }
static int static int
gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, const guchar *buf, size_t count) gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader,
const guchar *buf,
gsize count)
{ {
int nbytes; gint n_bytes;
GdkPixbufLoaderPrivate *priv = loader->private; GdkPixbufLoaderPrivate *priv = loader->private;
nbytes = MIN(LOADER_HEADER_SIZE - priv->header_buf_offset, count); n_bytes = MIN(LOADER_HEADER_SIZE - priv->header_buf_offset, count);
memcpy (priv->header_buf + priv->header_buf_offset, buf, nbytes); memcpy (priv->header_buf + priv->header_buf_offset, buf, n_bytes);
priv->header_buf_offset += nbytes; priv->header_buf_offset += n_bytes;
if(priv->header_buf_offset >= LOADER_HEADER_SIZE) { if (priv->header_buf_offset >= LOADER_HEADER_SIZE)
if (gdk_pixbuf_loader_load_module(loader) == 0) {
if (gdk_pixbuf_loader_load_module (loader) == 0)
return 0; return 0;
} }
return nbytes;
return n_bytes;
} }
/** /**
@ -419,7 +428,9 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, const guchar *buf,
* cannot parse the buffer. * cannot parse the buffer.
**/ **/
gboolean gboolean
gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, size_t count) gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
const guchar *buf,
gsize count)
{ {
GdkPixbufLoaderPrivate *priv; GdkPixbufLoaderPrivate *priv;
@ -434,8 +445,9 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, size_t coun
/* we expect it's not to be closed */ /* we expect it's not to be closed */
g_return_val_if_fail (priv->closed == FALSE, FALSE); g_return_val_if_fail (priv->closed == FALSE, FALSE);
if (priv->image_module == NULL) { if (priv->image_module == NULL)
int eaten; {
gint eaten;
eaten = gdk_pixbuf_loader_eat_header_write(loader, buf, count); eaten = gdk_pixbuf_loader_eat_header_write(loader, buf, count);
if (eaten <= 0) if (eaten <= 0)
@ -446,7 +458,7 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, size_t coun
} }
if (count > 0 && priv->image_module->load_increment) if (count > 0 && priv->image_module->load_increment)
return (* priv->image_module->load_increment) (priv->context, buf, count); return priv->image_module->load_increment (priv->context, buf, count);
return TRUE; return TRUE;
} }
@ -490,7 +502,7 @@ gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader)
* *
* Return value: The GdkPixbufAnimation that the loader is loading, or NULL if * Return value: The GdkPixbufAnimation that the loader is loading, or NULL if
not enough data has been read to determine the information. not enough data has been read to determine the information.
**/ **/
GdkPixbufAnimation * GdkPixbufAnimation *
gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader) gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader)
{ {
@ -529,11 +541,9 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
gdk_pixbuf_loader_load_module (loader); gdk_pixbuf_loader_load_module (loader);
if (priv->image_module && priv->image_module->stop_load) if (priv->image_module && priv->image_module->stop_load)
(* priv->image_module->stop_load) (priv->context); priv->image_module->stop_load (priv->context);
priv->closed = TRUE; priv->closed = TRUE;
gtk_signal_emit (GTK_OBJECT (loader), gtk_signal_emit (GTK_OBJECT (loader), pixbuf_loader_signals[CLOSED]);
pixbuf_loader_signals[CLOSED]);
} }

View File

@ -26,7 +26,6 @@
#ifndef GDK_PIXBUF_LOADER_H #ifndef GDK_PIXBUF_LOADER_H
#define GDK_PIXBUF_LOADER_H #define GDK_PIXBUF_LOADER_H
#include <unistd.h>
#include <gtk/gtkobject.h> #include <gtk/gtkobject.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
@ -34,13 +33,14 @@
extern "C" { extern "C" {
#endif #endif
#define GDK_TYPE_PIXBUF_LOADER (gdk_pixbuf_loader_get_type ()) #define GDK_TYPE_PIXBUF_LOADER (gdk_pixbuf_loader_get_type ())
#define GDK_PIXBUF_LOADER(obj) (GTK_CHECK_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader)) #define GDK_PIXBUF_LOADER(obj) (GTK_CHECK_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader))
#define GDK_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass)) #define GDK_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass))
#define GDK_IS_PIXBUF_LOADER(obj) (GTK_CHECK_TYPE ((obj), GDK_TYPE_PIXBUF_LOADER)) #define GDK_IS_PIXBUF_LOADER(obj) (GTK_CHECK_TYPE ((obj), GDK_TYPE_PIXBUF_LOADER))
#define GDK_IS_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_LOADER)) #define GDK_IS_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_LOADER))
#define GDK_PIXBUF_LOADER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass))
typedef struct _GdkPixbufLoader GdkPixbufLoader; typedef struct _GdkPixbufLoader GdkPixbufLoader;
@ -48,38 +48,37 @@ struct _GdkPixbufLoader
{ {
GtkObject object; GtkObject object;
/* < Private > */ /*< private >*/
gpointer private; gpointer private;
}; };
typedef struct _GdkPixbufLoaderClass GdkPixbufLoaderClass; typedef struct _GdkPixbufLoaderClass GdkPixbufLoaderClass;
struct _GdkPixbufLoaderClass { struct _GdkPixbufLoaderClass
{
GtkObjectClass parent_class; GtkObjectClass parent_class;
void (* area_prepared) (GdkPixbufLoader *loader); void (*area_prepared) (GdkPixbufLoader *loader);
void (*area_updated) (GdkPixbufLoader *loader,
void (* area_updated) (GdkPixbufLoader *loader, guint x,
guint x, guint y, guint width, guint height); guint y,
guint width,
void (* frame_done) (GdkPixbufLoader *loader, GdkPixbufFrame *frame); guint height);
void (*frame_done) (GdkPixbufLoader *loader,
void (* animation_done) (GdkPixbufLoader *loader); GdkPixbufFrame *frame);
void (*animation_done) (GdkPixbufLoader *loader);
void (* closed) (GdkPixbufLoader *loader); void (*closed) (GdkPixbufLoader *loader);
}; };
GtkType gdk_pixbuf_loader_get_type (void); GtkType gdk_pixbuf_loader_get_type (void);
GdkPixbufLoader *gdk_pixbuf_loader_new (void); GdkPixbufLoader * gdk_pixbuf_loader_new (void);
gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader, gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
const guchar *buf, const guchar *buf,
size_t count); gsize count);
GdkPixbuf *gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader); GdkPixbuf * gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader);
GdkPixbufAnimation *gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader); GdkPixbufAnimation * gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader);
void gdk_pixbuf_loader_close (GdkPixbufLoader *loader); void gdk_pixbuf_loader_close (GdkPixbufLoader *loader);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -120,6 +120,6 @@ if test "$echo_libs" = "yes"; then
fi fi
done done
echo $libdirs @more_ldflags@ -lgtk-$target -lgdk-$target $my_glib_libs @INTLLIBS@ @PANGO_LIBS@ @more_libs@ @GDK_WLIBS@ @MATH_LIB@ echo $libdirs @more_ldflags@ -lgtk-$target -lgdk_pixbuf -lgdk-$target $my_glib_libs @INTLLIBS@ @PANGO_LIBS@ @more_libs@ @GDK_WLIBS@ @MATH_LIB@
fi fi

View File

@ -80,7 +80,6 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkentry.h \ gtkentry.h \
gtkenums.h \ gtkenums.h \
gtkeventbox.h \ gtkeventbox.h \
gtkfeatures.h \
gtkfilesel.h \ gtkfilesel.h \
gtkfixed.h \ gtkfixed.h \
gtkfontsel.h \ gtkfontsel.h \

View File

@ -1,5 +1,3 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GdkPixbuf library - Main header file /* GdkPixbuf library - Main header file
* *
* Copyright (C) 1999 The Free Software Foundation * Copyright (C) 1999 The Free Software Foundation
@ -31,8 +29,6 @@
#include "gtksignal.h" #include "gtksignal.h"
enum { enum {
AREA_UPDATED, AREA_UPDATED,
AREA_PREPARED, AREA_PREPARED,
@ -42,22 +38,22 @@ enum {
LAST_SIGNAL LAST_SIGNAL
}; };
static GtkObjectClass *parent_class;
static void gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *klass); static void gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *klass);
static void gdk_pixbuf_loader_init (GdkPixbufLoader *loader); static void gdk_pixbuf_loader_init (GdkPixbufLoader *loader);
static void gdk_pixbuf_loader_destroy (GtkObject *loader); static void gdk_pixbuf_loader_destroy (GtkObject *loader);
static void gdk_pixbuf_loader_finalize (GObject *loader); static void gdk_pixbuf_loader_finalize (GObject *loader);
static gpointer parent_class = NULL;
static guint pixbuf_loader_signals[LAST_SIGNAL] = { 0 }; static guint pixbuf_loader_signals[LAST_SIGNAL] = { 0 };
/* Internal data */ /* Internal data */
#define LOADER_HEADER_SIZE 128 #define LOADER_HEADER_SIZE 128
typedef struct { typedef struct
{
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkPixbufAnimation *animation; GdkPixbufAnimation *animation;
gboolean closed; gboolean closed;
@ -67,10 +63,9 @@ typedef struct {
gpointer context; gpointer context;
} GdkPixbufLoaderPrivate; } GdkPixbufLoaderPrivate;
/* our marshaller */ /* our marshaller */
typedef void (* GtkSignal_NONE__INT_INT_INT_INT) (GtkObject *object, typedef void (*GtkSignal_NONE__INT_INT_INT_INT) (GtkObject *object,
gint arg1, gint arg2, gint arg3, gint arg4, gint arg1, gint arg2, gint arg3, gint arg4,
gpointer user_data); gpointer user_data);
static void static void
@ -88,7 +83,6 @@ gtk_marshal_NONE__INT_INT_INT_INT (GtkObject *object, GtkSignalFunc func, gpoint
func_data); func_data);
} }
/** /**
* gdk_pixbuf_loader_get_type: * gdk_pixbuf_loader_get_type:
@ -104,7 +98,8 @@ gdk_pixbuf_loader_get_type (void)
{ {
static GtkType loader_type = 0; static GtkType loader_type = 0;
if (!loader_type) { if (!loader_type)
{
static const GtkTypeInfo loader_info = { static const GtkTypeInfo loader_info = {
"GdkPixbufLoader", "GdkPixbufLoader",
sizeof (GdkPixbufLoader), sizeof (GdkPixbufLoader),
@ -131,7 +126,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
object_class = (GtkObjectClass *) class; object_class = (GtkObjectClass *) class;
gobject_class = (GObjectClass *) class; gobject_class = (GObjectClass *) class;
parent_class = gtk_type_class (gtk_object_get_type ()); parent_class = gtk_type_class (GTK_TYPE_OBJECT);
pixbuf_loader_signals[AREA_PREPARED] = pixbuf_loader_signals[AREA_PREPARED] =
gtk_signal_new ("area_prepared", gtk_signal_new ("area_prepared",
@ -214,7 +209,7 @@ gdk_pixbuf_loader_destroy (GtkObject *object)
gdk_pixbuf_unref (priv->pixbuf); gdk_pixbuf_unref (priv->pixbuf);
if (GTK_OBJECT_CLASS (parent_class)->destroy) if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object); GTK_OBJECT_CLASS (parent_class)->destroy (object);
} }
static void static void
@ -229,16 +224,18 @@ gdk_pixbuf_loader_finalize (GObject *object)
g_free (priv); g_free (priv);
if (G_OBJECT_CLASS (parent_class)->finalize) if (G_OBJECT_CLASS (parent_class)->finalize)
(* G_OBJECT_CLASS (parent_class)->finalize) (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }
static void static void
gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf, gpointer loader) gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
priv = GDK_PIXBUF_LOADER (loader)->private; priv = GDK_PIXBUF_LOADER (loader)->private;
gdk_pixbuf_ref (pixbuf); gdk_pixbuf_ref (pixbuf);
g_assert (priv->pixbuf == NULL); g_assert (priv->pixbuf == NULL);
priv->pixbuf = pixbuf; priv->pixbuf = pixbuf;
@ -246,7 +243,12 @@ gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf, gpointer loader)
} }
static void static void
gdk_pixbuf_loader_update (GdkPixbuf *pixbuf, guint x, guint y, guint width, guint height, gpointer loader) gdk_pixbuf_loader_update (GdkPixbuf *pixbuf,
guint x,
guint y,
guint width,
guint height,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
@ -261,7 +263,8 @@ gdk_pixbuf_loader_update (GdkPixbuf *pixbuf, guint x, guint y, guint width, guin
} }
static void static void
gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader) gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
@ -269,13 +272,16 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader)
priv->pixbuf = NULL; priv->pixbuf = NULL;
if (priv->animation == NULL) { if (priv->animation == NULL)
{
priv->animation = GDK_PIXBUF_ANIMATION (g_type_create_instance (GDK_TYPE_PIXBUF_ANIMATION)); priv->animation = GDK_PIXBUF_ANIMATION (g_type_create_instance (GDK_TYPE_PIXBUF_ANIMATION));
priv->animation->n_frames = 0; priv->animation->n_frames = 0;
priv->animation->width = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset; priv->animation->width = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset; priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
} else { }
else
{
int w, h; int w, h;
/* update bbox size */ /* update bbox size */
@ -291,14 +297,15 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader)
} }
priv->animation->frames = g_list_append (priv->animation->frames, frame); priv->animation->frames = g_list_append (priv->animation->frames, frame);
priv->animation->n_frames ++; priv->animation->n_frames++;
gtk_signal_emit (GTK_OBJECT (loader), gtk_signal_emit (GTK_OBJECT (loader),
pixbuf_loader_signals[FRAME_DONE], pixbuf_loader_signals[FRAME_DONE],
frame); frame);
} }
static void static void
gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf, gpointer loader) gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf,
gpointer loader)
{ {
GdkPixbufLoaderPrivate *priv = NULL; GdkPixbufLoaderPrivate *priv = NULL;
GdkPixbufFrame *frame; GdkPixbufFrame *frame;
@ -310,28 +317,24 @@ gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf, gpointer loader)
current = gdk_pixbuf_animation_get_frames (priv->animation); current = gdk_pixbuf_animation_get_frames (priv->animation);
while (current) { while (current)
{
frame = (GdkPixbufFrame *) current->data; frame = (GdkPixbufFrame *) current->data;
/* update bbox size */ /* update bbox size */
w = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset; w = gdk_pixbuf_get_width (frame->pixbuf) + frame->x_offset;
h = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset; h = gdk_pixbuf_get_height (frame->pixbuf) + frame->y_offset;
if (w > priv->animation->width) { if (w > priv->animation->width)
priv->animation->width = w; priv->animation->width = w;
} if (h > priv->animation->height)
if (h > priv->animation->height) {
priv->animation->height = h; priv->animation->height = h;
}
current = current->next; current = current->next;
} }
gtk_signal_emit (GTK_OBJECT (loader), gtk_signal_emit (GTK_OBJECT (loader), pixbuf_loader_signals[ANIMATION_DONE]);
pixbuf_loader_signals[ANIMATION_DONE]);
} }
/** /**
* gdk_pixbuf_loader_new: * gdk_pixbuf_loader_new:
* *
@ -342,11 +345,11 @@ gdk_pixbuf_loader_animation_done (GdkPixbuf *pixbuf, gpointer loader)
GdkPixbufLoader * GdkPixbufLoader *
gdk_pixbuf_loader_new (void) gdk_pixbuf_loader_new (void)
{ {
return gtk_type_new (gdk_pixbuf_loader_get_type ()); return g_object_new (GDK_TYPE_PIXBUF_LOADER, NULL);
} }
static int static gint
gdk_pixbuf_loader_load_module(GdkPixbufLoader *loader) gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader)
{ {
GdkPixbufLoaderPrivate *priv = loader->private; GdkPixbufLoaderPrivate *priv = loader->private;
@ -363,45 +366,51 @@ gdk_pixbuf_loader_load_module(GdkPixbufLoader *loader)
if ((priv->image_module->begin_load == NULL) || if ((priv->image_module->begin_load == NULL) ||
(priv->image_module->stop_load == NULL) || (priv->image_module->stop_load == NULL) ||
(priv->image_module->load_increment == NULL)) { (priv->image_module->load_increment == NULL))
g_warning ("module %s does not support incremental loading.\n", {
g_warning (G_STRLOC ": module %s does not support incremental loading.\n",
priv->image_module->module_name); priv->image_module->module_name);
return 0; return 0;
} }
priv->context = (*priv->image_module->begin_load) (gdk_pixbuf_loader_prepare, priv->context = priv->image_module->begin_load (gdk_pixbuf_loader_prepare,
gdk_pixbuf_loader_update, gdk_pixbuf_loader_update,
gdk_pixbuf_loader_frame_done, gdk_pixbuf_loader_frame_done,
gdk_pixbuf_loader_animation_done, gdk_pixbuf_loader_animation_done,
loader); loader);
if (priv->context == NULL) { if (priv->context == NULL)
g_warning("Failed to begin progressive load"); {
g_warning (G_STRLOC ": Failed to begin progressive load");
return 0; return 0;
} }
if( (* priv->image_module->load_increment) (priv->context, priv->header_buf, priv->header_buf_offset) ) if (priv->image_module->load_increment (priv->context, priv->header_buf, priv->header_buf_offset))
return priv->header_buf_offset; return priv->header_buf_offset;
return 0; return 0;
} }
static int static int
gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, const guchar *buf, size_t count) gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader,
const guchar *buf,
gsize count)
{ {
int nbytes; gint n_bytes;
GdkPixbufLoaderPrivate *priv = loader->private; GdkPixbufLoaderPrivate *priv = loader->private;
nbytes = MIN(LOADER_HEADER_SIZE - priv->header_buf_offset, count); n_bytes = MIN(LOADER_HEADER_SIZE - priv->header_buf_offset, count);
memcpy (priv->header_buf + priv->header_buf_offset, buf, nbytes); memcpy (priv->header_buf + priv->header_buf_offset, buf, n_bytes);
priv->header_buf_offset += nbytes; priv->header_buf_offset += n_bytes;
if(priv->header_buf_offset >= LOADER_HEADER_SIZE) { if (priv->header_buf_offset >= LOADER_HEADER_SIZE)
if (gdk_pixbuf_loader_load_module(loader) == 0) {
if (gdk_pixbuf_loader_load_module (loader) == 0)
return 0; return 0;
} }
return nbytes;
return n_bytes;
} }
/** /**
@ -419,7 +428,9 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, const guchar *buf,
* cannot parse the buffer. * cannot parse the buffer.
**/ **/
gboolean gboolean
gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, size_t count) gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
const guchar *buf,
gsize count)
{ {
GdkPixbufLoaderPrivate *priv; GdkPixbufLoaderPrivate *priv;
@ -434,8 +445,9 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, size_t coun
/* we expect it's not to be closed */ /* we expect it's not to be closed */
g_return_val_if_fail (priv->closed == FALSE, FALSE); g_return_val_if_fail (priv->closed == FALSE, FALSE);
if (priv->image_module == NULL) { if (priv->image_module == NULL)
int eaten; {
gint eaten;
eaten = gdk_pixbuf_loader_eat_header_write(loader, buf, count); eaten = gdk_pixbuf_loader_eat_header_write(loader, buf, count);
if (eaten <= 0) if (eaten <= 0)
@ -446,7 +458,7 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, size_t coun
} }
if (count > 0 && priv->image_module->load_increment) if (count > 0 && priv->image_module->load_increment)
return (* priv->image_module->load_increment) (priv->context, buf, count); return priv->image_module->load_increment (priv->context, buf, count);
return TRUE; return TRUE;
} }
@ -490,7 +502,7 @@ gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader)
* *
* Return value: The GdkPixbufAnimation that the loader is loading, or NULL if * Return value: The GdkPixbufAnimation that the loader is loading, or NULL if
not enough data has been read to determine the information. not enough data has been read to determine the information.
**/ **/
GdkPixbufAnimation * GdkPixbufAnimation *
gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader) gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader)
{ {
@ -529,11 +541,9 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
gdk_pixbuf_loader_load_module (loader); gdk_pixbuf_loader_load_module (loader);
if (priv->image_module && priv->image_module->stop_load) if (priv->image_module && priv->image_module->stop_load)
(* priv->image_module->stop_load) (priv->context); priv->image_module->stop_load (priv->context);
priv->closed = TRUE; priv->closed = TRUE;
gtk_signal_emit (GTK_OBJECT (loader), gtk_signal_emit (GTK_OBJECT (loader), pixbuf_loader_signals[CLOSED]);
pixbuf_loader_signals[CLOSED]);
} }

View File

@ -26,7 +26,6 @@
#ifndef GDK_PIXBUF_LOADER_H #ifndef GDK_PIXBUF_LOADER_H
#define GDK_PIXBUF_LOADER_H #define GDK_PIXBUF_LOADER_H
#include <unistd.h>
#include <gtk/gtkobject.h> #include <gtk/gtkobject.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
@ -34,13 +33,14 @@
extern "C" { extern "C" {
#endif #endif
#define GDK_TYPE_PIXBUF_LOADER (gdk_pixbuf_loader_get_type ()) #define GDK_TYPE_PIXBUF_LOADER (gdk_pixbuf_loader_get_type ())
#define GDK_PIXBUF_LOADER(obj) (GTK_CHECK_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader)) #define GDK_PIXBUF_LOADER(obj) (GTK_CHECK_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader))
#define GDK_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass)) #define GDK_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass))
#define GDK_IS_PIXBUF_LOADER(obj) (GTK_CHECK_TYPE ((obj), GDK_TYPE_PIXBUF_LOADER)) #define GDK_IS_PIXBUF_LOADER(obj) (GTK_CHECK_TYPE ((obj), GDK_TYPE_PIXBUF_LOADER))
#define GDK_IS_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_LOADER)) #define GDK_IS_PIXBUF_LOADER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_LOADER))
#define GDK_PIXBUF_LOADER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass))
typedef struct _GdkPixbufLoader GdkPixbufLoader; typedef struct _GdkPixbufLoader GdkPixbufLoader;
@ -48,38 +48,37 @@ struct _GdkPixbufLoader
{ {
GtkObject object; GtkObject object;
/* < Private > */ /*< private >*/
gpointer private; gpointer private;
}; };
typedef struct _GdkPixbufLoaderClass GdkPixbufLoaderClass; typedef struct _GdkPixbufLoaderClass GdkPixbufLoaderClass;
struct _GdkPixbufLoaderClass { struct _GdkPixbufLoaderClass
{
GtkObjectClass parent_class; GtkObjectClass parent_class;
void (* area_prepared) (GdkPixbufLoader *loader); void (*area_prepared) (GdkPixbufLoader *loader);
void (*area_updated) (GdkPixbufLoader *loader,
void (* area_updated) (GdkPixbufLoader *loader, guint x,
guint x, guint y, guint width, guint height); guint y,
guint width,
void (* frame_done) (GdkPixbufLoader *loader, GdkPixbufFrame *frame); guint height);
void (*frame_done) (GdkPixbufLoader *loader,
void (* animation_done) (GdkPixbufLoader *loader); GdkPixbufFrame *frame);
void (*animation_done) (GdkPixbufLoader *loader);
void (* closed) (GdkPixbufLoader *loader); void (*closed) (GdkPixbufLoader *loader);
}; };
GtkType gdk_pixbuf_loader_get_type (void); GtkType gdk_pixbuf_loader_get_type (void);
GdkPixbufLoader *gdk_pixbuf_loader_new (void); GdkPixbufLoader * gdk_pixbuf_loader_new (void);
gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader, gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
const guchar *buf, const guchar *buf,
size_t count); gsize count);
GdkPixbuf *gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader); GdkPixbuf * gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader);
GdkPixbufAnimation *gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader); GdkPixbufAnimation * gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader);
void gdk_pixbuf_loader_close (GdkPixbufLoader *loader); void gdk_pixbuf_loader_close (GdkPixbufLoader *loader);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -1,123 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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 __GTK_FEATURES_H__
#define __GTK_FEATURES_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* compile time version
*/
#define GTK_MAJOR_VERSION (@GTK_MAJOR_VERSION@)
#define GTK_MINOR_VERSION (@GTK_MINOR_VERSION@)
#define GTK_MICRO_VERSION (@GTK_MICRO_VERSION@)
#define GTK_BINARY_AGE (@GTK_BINARY_AGE@)
#define GTK_INTERFACE_AGE (@GTK_INTERFACE_AGE@)
#define GTK_CHECK_VERSION(major,minor,micro) \
(GTK_MAJOR_VERSION > (major) || \
(GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION > (minor)) || \
(GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION == (minor) && \
GTK_MICRO_VERSION >= (micro)))
/* new gtk_container_set_focus_[hv]adjustment()
*/
#define GTK_HAVE_CONTAINER_FOCUS_ADJUSTMENTS 1-0-1
/* newly exported gtk_signal_init()
* new gtk_signal_n_emissions*()
* "signal-name" is now an alias for "signal_name"
* new gtk_signal_emitv*()
*/
#define GTK_HAVE_SIGNAL_INIT 1-0-2
/* Gtk+ 1.1.0 version tag.
* - new gtk_rc_set_image_loader () to install custom image loaders for rc
* files.
* - GtkAccel groups replaced GtkAcceleratorTables
* - Gdk supports full crossing event now.
* - Buttons featur relief styles now.
* - gdk_rgb_*() functions are in place.
* - stringified enum values can be queried for enum types now.
* - new key binding system is in place (GtkBindingSet).
* - simple algorithm for pattern matching is exported now (GtkPatternSpec).
*/
#define GTK_HAVE_FEATURES_1_1_0 1-1-0
/* Gtk+ 1.1.2 version tag
* - ctree function name changes
*/
#define GTK_HAVE_FEATURES_1_1_2 1-1-2
/* Gtk+ 1.1.4 version tag
* - clist v/hscrollbar -> v/hadjustment changes
*/
#define GTK_HAVE_FEATURES_1_1_4 1-1-4
/* Gtk+ 1.1.5 version tag
*/
#define GTK_HAVE_FEATURES_1_1_5 1-1-5
/* Gtk+ 1.1.6 version tag
*/
#define GTK_HAVE_FEATURES_1_1_6 1-1-6
/* Gtk+ 1.1.7 version tag
*/
#define GTK_HAVE_FEATURES_1_1_7 1-1-7
/* Gtk+ 1.1.8 version tag
*/
#define GTK_HAVE_FEATURES_1_1_8 1-1-8
/* Gtk+ 1.1.9 version tag
*/
#define GTK_HAVE_FEATURES_1_1_9 1-1-9
/* Gtk+ 1.1.10 version tag
*/
#define GTK_HAVE_FEATURES_1_1_10 1-1-10
/* Gtk+ 1.1.11 version tag
*/
#define GTK_HAVE_FEATURES_1_1_11 1-1-11
/* Gtk+ 1.1.12 version tag
*/
#define GTK_HAVE_FEATURES_1_1_12 1-1-12
/* Gtk+ 1.1.13 version tag
* gtk_toggle_button_set_state name changes
*/
#define GTK_HAVE_FEATURES_1_1_13 1-1-13
/* Gtk+ 1.1.14 version tag
* working gtk layout, etc
*/
#define GTK_HAVE_FEATURES_1_1_14 1-1-14
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_FEATURES_H__ */

View File

@ -120,15 +120,6 @@ gtk_type_init (void)
GtkType type_id; GtkType type_id;
gchar *name; gchar *name;
} fundamental_info[] = { } fundamental_info[] = {
{ GTK_TYPE_CHAR, "gchar" },
{ GTK_TYPE_UCHAR, "guchar" },
{ GTK_TYPE_BOOL, "gboolean" },
{ GTK_TYPE_INT, "gint" },
{ GTK_TYPE_UINT, "guint" },
{ GTK_TYPE_LONG, "glong" },
{ GTK_TYPE_ULONG, "gulong" },
{ GTK_TYPE_FLOAT, "gfloat" },
{ GTK_TYPE_DOUBLE, "gdouble" },
{ GTK_TYPE_POINTER, "gpointer" }, { GTK_TYPE_POINTER, "gpointer" },
{ GTK_TYPE_SIGNAL, "GtkSignal" }, { GTK_TYPE_SIGNAL, "GtkSignal" },
}; };
@ -162,22 +153,19 @@ gtk_type_init (void)
{ {
type_id = g_type_register_fundamental (fundamental_info[i].type_id, type_id = g_type_register_fundamental (fundamental_info[i].type_id,
fundamental_info[i].name, fundamental_info[i].name,
&finfo, &tinfo,
&tinfo); &finfo);
g_assert (type_id == fundamental_info[i].type_id); g_assert (type_id == fundamental_info[i].type_id);
} }
/* GTK_TYPE_STRING & GTK_TYPE_IDENTIFIER /* GTK_TYPE_IDENTIFIER
*/ */
finfo.type_flags = G_TYPE_FLAG_DERIVABLE; GTK_TYPE_IDENTIFIER = g_type_register_static (G_TYPE_STRING, "GtkIdentifier", &tinfo);
type_id = g_type_register_fundamental (GTK_TYPE_STRING, "GtkString", &finfo, &tinfo);
g_assert (type_id == GTK_TYPE_STRING);
GTK_TYPE_IDENTIFIER = g_type_register_static (GTK_TYPE_STRING, "GtkIdentifier", &tinfo);
/* GTK_TYPE_BOXED /* GTK_TYPE_BOXED
*/ */
finfo.type_flags = G_TYPE_FLAG_DERIVABLE; finfo.type_flags = G_TYPE_FLAG_DERIVABLE;
type_id = g_type_register_fundamental (GTK_TYPE_BOXED, "GtkBoxed", &finfo, &tinfo); type_id = g_type_register_fundamental (GTK_TYPE_BOXED, "GtkBoxed", &tinfo, &finfo);
g_assert (type_id == GTK_TYPE_BOXED); g_assert (type_id == GTK_TYPE_BOXED);
/* enums and flags /* enums and flags

View File

@ -48,16 +48,16 @@ typedef enum /*< skip >*/
GTK_TYPE_FLAGS = G_TYPE_FLAGS, GTK_TYPE_FLAGS = G_TYPE_FLAGS,
/* GtkArg types */ /* GtkArg types */
GTK_TYPE_CHAR = G_TYPE_GTK_CHAR, GTK_TYPE_CHAR = G_TYPE_CHAR,
GTK_TYPE_UCHAR = G_TYPE_GTK_UCHAR, GTK_TYPE_UCHAR = G_TYPE_UCHAR,
GTK_TYPE_BOOL = G_TYPE_GTK_BOOL, GTK_TYPE_BOOL = G_TYPE_BOOLEAN,
GTK_TYPE_INT = G_TYPE_GTK_INT, GTK_TYPE_INT = G_TYPE_INT,
GTK_TYPE_UINT = G_TYPE_GTK_UINT, GTK_TYPE_UINT = G_TYPE_UINT,
GTK_TYPE_LONG = G_TYPE_GTK_LONG, GTK_TYPE_LONG = G_TYPE_LONG,
GTK_TYPE_ULONG = G_TYPE_GTK_ULONG, GTK_TYPE_ULONG = G_TYPE_ULONG,
GTK_TYPE_FLOAT = G_TYPE_GTK_FLOAT, GTK_TYPE_FLOAT = G_TYPE_FLOAT,
GTK_TYPE_DOUBLE = G_TYPE_GTK_DOUBLE, GTK_TYPE_DOUBLE = G_TYPE_DOUBLE,
GTK_TYPE_STRING = G_TYPE_GTK_STRING, GTK_TYPE_STRING = G_TYPE_STRING,
GTK_TYPE_BOXED = G_TYPE_GTK_BOXED, GTK_TYPE_BOXED = G_TYPE_GTK_BOXED,
GTK_TYPE_POINTER = G_TYPE_GTK_POINTER, GTK_TYPE_POINTER = G_TYPE_GTK_POINTER,
GTK_TYPE_SIGNAL = G_TYPE_GTK_SIGNAL GTK_TYPE_SIGNAL = G_TYPE_GTK_SIGNAL

View File

@ -8679,5 +8679,15 @@ main (int argc, char *argv[])
gtk_main (); gtk_main ();
if (0)
{
sleep (1);
while (g_main_pending ())
g_main_iteration (FALSE);
sleep (1);
while (g_main_pending ())
g_main_iteration (FALSE);
}
return 0; return 0;
} }

View File

@ -8679,5 +8679,15 @@ main (int argc, char *argv[])
gtk_main (); gtk_main ();
if (0)
{
sleep (1);
while (g_main_pending ())
g_main_iteration (FALSE);
sleep (1);
while (g_main_pending ())
g_main_iteration (FALSE);
}
return 0; return 0;
} }