app/Makefile.am removed. added.

2001-01-10  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/gimpsignal.[ch]: removed.
	* app/gimpmarshal.[ch]: added.

	* app/channel.[ch]
	* app/gimpbrush.[ch]
	* app/gimpbrushgenerated.c
	* app/gimpbrushlist.[ch]
	* app/gimpbrushpipe.[ch]
	* app/gimpcontext.c
	* app/gimpdrawable.c
	* app/gimpimage.c
	* app/gimplist.[ch]
	* app/gimpobject.[ch]
	* app/gimpset.[ch]
	* app/layer.c
	* app/layers_dialog.c
	* app/module_db.c
	* app/parasitelist.[ch]: removed gimp_signal_new() and
	GIMP_TYPE_INIT(). Fixed lots of object related uglyness.
This commit is contained in:
Michael Natterer 2001-01-10 00:36:54 +00:00 committed by Michael Natterer
parent c935ec8367
commit 92c45a90e6
66 changed files with 1793 additions and 1055 deletions

View File

@ -1,3 +1,26 @@
2001-01-10 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/gimpsignal.[ch]: removed.
* app/gimpmarshal.[ch]: added.
* app/channel.[ch]
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.c
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontext.c
* app/gimpdrawable.c
* app/gimpimage.c
* app/gimplist.[ch]
* app/gimpobject.[ch]
* app/gimpset.[ch]
* app/layer.c
* app/layers_dialog.c
* app/module_db.c
* app/parasitelist.[ch]: removed gimp_signal_new() and
GIMP_TYPE_INIT(). Fixed lots of object related uglyness.
2001-01-09 Sven Neumann <sven@gimp.org>
Merged fix from gimp-1-2:

View File

@ -16,14 +16,14 @@ libgimpim_a_SOURCES = \
gimpdrawable.h \
gimpimage.c \
gimpimage.h \
gimpmarshal.c \
gimpmarshal.h \
gimpobject.c \
gimpobject.h \
gimppreviewcache.h \
gimppreviewcache.c \
gimpset.c \
gimpset.h \
gimpsignal.c \
gimpsignal.h
gimpset.h
gimp_SOURCES = \
about_dialog.c \

View File

@ -32,7 +32,6 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
@ -95,20 +94,28 @@ gimp_channel_get_type (void)
}
static void
gimp_channel_class_init (GimpChannelClass *class)
gimp_channel_class_init (GimpChannelClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gimp_drawable_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
channel_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpChannelClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, channel_signals, LAST_SIGNAL);
object_class->destroy = gimp_channel_destroy;
klass->removed = NULL;
}
static void

View File

@ -63,6 +63,8 @@ struct _GimpChannel
struct _GimpChannelClass
{
GimpDrawableClass parent_class;
void (* removed) (GimpChannel *channel);
};

View File

@ -45,19 +45,17 @@
#include "apptypes.h"
#include "brush_header.h"
#include "patterns.h"
#include "pattern_header.h"
#include "gimpbrush.h"
#include "gimpbrushlist.h"
#include "gimpsignal.h"
#include "gimprc.h"
#include "patterns.h"
#include "pattern_header.h"
#include "paint_core.h"
#include "temp_buf.h"
#include "libgimp/gimpintl.h"
enum
{
DIRTY,
@ -68,9 +66,11 @@ enum
static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static guint gimp_brush_signals[LAST_SIGNAL];
static GimpObjectClass *parent_class;
static guint gimp_brush_signals[LAST_SIGNAL] = { 0 };
static GimpObjectClass *parent_class = NULL;
static void
gimp_brush_destroy (GtkObject *object)
@ -91,26 +91,38 @@ static void
gimp_brush_class_init (GimpBrushClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
type = object_class->type;
gimp_brush_signals[DIRTY] =
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpBrushClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_brush_signals[RENAME] =
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpBrushClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_brush_signals, LAST_SIGNAL);
object_class->destroy = gimp_brush_destroy;
klass->select_brush = gimp_brush_select_brush;
klass->dirty = NULL;
klass->rename = NULL;
klass->select_brush = gimp_brush_select_brush;
klass->want_null_motion = gimp_brush_want_null_motion;
gimp_brush_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0, gimp_sigtype_void);
gimp_brush_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0, gimp_sigtype_void);
gtk_object_class_add_signals (object_class, gimp_brush_signals, LAST_SIGNAL);
}
void

View File

@ -45,19 +45,17 @@
#include "apptypes.h"
#include "brush_header.h"
#include "patterns.h"
#include "pattern_header.h"
#include "gimpbrush.h"
#include "gimpbrushlist.h"
#include "gimpsignal.h"
#include "gimprc.h"
#include "patterns.h"
#include "pattern_header.h"
#include "paint_core.h"
#include "temp_buf.h"
#include "libgimp/gimpintl.h"
enum
{
DIRTY,
@ -68,9 +66,11 @@ enum
static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static guint gimp_brush_signals[LAST_SIGNAL];
static GimpObjectClass *parent_class;
static guint gimp_brush_signals[LAST_SIGNAL] = { 0 };
static GimpObjectClass *parent_class = NULL;
static void
gimp_brush_destroy (GtkObject *object)
@ -91,26 +91,38 @@ static void
gimp_brush_class_init (GimpBrushClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
type = object_class->type;
gimp_brush_signals[DIRTY] =
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpBrushClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_brush_signals[RENAME] =
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpBrushClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_brush_signals, LAST_SIGNAL);
object_class->destroy = gimp_brush_destroy;
klass->select_brush = gimp_brush_select_brush;
klass->dirty = NULL;
klass->rename = NULL;
klass->select_brush = gimp_brush_select_brush;
klass->want_null_motion = gimp_brush_want_null_motion;
gimp_brush_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0, gimp_sigtype_void);
gimp_brush_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0, gimp_sigtype_void);
gtk_object_class_add_signals (object_class, gimp_brush_signals, LAST_SIGNAL);
}
void

View File

@ -23,7 +23,13 @@
#include "gimpobject.h"
typedef struct _GimpBrushClass GimpBrushClass;
#define GIMP_TYPE_BRUSH (gimp_brush_get_type ())
#define GIMP_BRUSH(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH, GimpBrush))
#define GIMP_IS_BRUSH(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH))
#define GIMP_BRUSH_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), gimp_brush_get_type(), GimpBrushClass))
typedef struct _GimpBrushClass GimpBrushClass;
struct _GimpBrush
{
@ -42,14 +48,14 @@ struct _GimpBrushClass
{
GimpObjectClass parent_class;
void (* dirty) (GimpBrush *brush);
void (* rename) (GimpBrush *brush);
/* FIXME: these are no virtual function pointers but bad hacks: */
GimpBrush * (* select_brush) (PaintCore *paint_core);
gboolean (* want_null_motion) (PaintCore *paint_core);
};
#define GIMP_BRUSH_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_brush_get_type(), GimpBrushClass)
#define GIMP_TYPE_BRUSH (gimp_brush_get_type ())
#define GIMP_BRUSH(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH, GimpBrush))
#define GIMP_IS_BRUSH(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH))
GtkType gimp_brush_get_type (void);
GimpBrush * gimp_brush_load (gchar *filename);

View File

@ -47,14 +47,14 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass *parent_class = NULL;
static GimpBrushClass *parent_class = NULL;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
@ -62,7 +62,7 @@ gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);

View File

@ -47,14 +47,14 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass *parent_class = NULL;
static GimpBrushClass *parent_class = NULL;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
@ -62,7 +62,7 @@ gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);

View File

@ -47,14 +47,14 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass *parent_class = NULL;
static GimpBrushClass *parent_class = NULL;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
@ -62,7 +62,7 @@ gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);

View File

@ -56,14 +56,14 @@
#include "libgimp/gimpintl.h"
static GimpBrushClass *parent_class;
static GimpBrush * gimp_brush_pipe_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_pipe_want_null_motion (PaintCore *paint_core);
static void gimp_brush_pipe_destroy (GtkObject *object);
static GimpBrushClass *parent_class = NULL;
static GimpBrush *
gimp_brush_pipe_select_brush (PaintCore *paint_core)
{
@ -182,8 +182,8 @@ gimp_brush_pipe_class_init (GimpBrushPipeClass *klass)
GtkObjectClass *object_class;
GimpBrushClass *brush_class;
object_class = GTK_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
object_class = (GtkObjectClass *) klass;
brush_class = (GimpBrushClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);
@ -405,5 +405,3 @@ gimp_brush_pipe_load (gchar *filename)
return GIMP_BRUSH (pipe);
}

View File

@ -56,14 +56,14 @@
#include "libgimp/gimpintl.h"
static GimpBrushClass *parent_class;
static GimpBrush * gimp_brush_pipe_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_pipe_want_null_motion (PaintCore *paint_core);
static void gimp_brush_pipe_destroy (GtkObject *object);
static GimpBrushClass *parent_class = NULL;
static GimpBrush *
gimp_brush_pipe_select_brush (PaintCore *paint_core)
{
@ -182,8 +182,8 @@ gimp_brush_pipe_class_init (GimpBrushPipeClass *klass)
GtkObjectClass *object_class;
GimpBrushClass *brush_class;
object_class = GTK_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
object_class = (GtkObjectClass *) klass;
brush_class = (GimpBrushClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);
@ -405,5 +405,3 @@ gimp_brush_pipe_load (gchar *filename)
return GIMP_BRUSH (pipe);
}

View File

@ -67,7 +67,6 @@ struct _GimpBrushPipeClass
};
GtkType gimp_brush_pixmap_get_type (void);
GtkType gimp_brush_pipe_get_type (void);
GimpBrush * gimp_brush_pipe_load (gchar *filename);

View File

@ -32,7 +32,6 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
@ -95,20 +94,28 @@ gimp_channel_get_type (void)
}
static void
gimp_channel_class_init (GimpChannelClass *class)
gimp_channel_class_init (GimpChannelClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gimp_drawable_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
channel_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpChannelClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, channel_signals, LAST_SIGNAL);
object_class->destroy = gimp_channel_destroy;
klass->removed = NULL;
}
static void

View File

@ -63,6 +63,8 @@ struct _GimpChannel
struct _GimpChannelClass
{
GimpDrawableClass parent_class;
void (* removed) (GimpChannel *channel);
};

View File

@ -32,7 +32,6 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
@ -95,20 +94,28 @@ gimp_channel_get_type (void)
}
static void
gimp_channel_class_init (GimpChannelClass *class)
gimp_channel_class_init (GimpChannelClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gimp_drawable_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
channel_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpChannelClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, channel_signals, LAST_SIGNAL);
object_class->destroy = gimp_channel_destroy;
klass->removed = NULL;
}
static void

View File

@ -63,6 +63,8 @@ struct _GimpChannel
struct _GimpChannelClass
{
GimpDrawableClass parent_class;
void (* removed) (GimpChannel *channel);
};

View File

@ -29,8 +29,8 @@
#include "gimpbrush.h"
#include "gimpbrushlist.h"
#include "gimpcontext.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gradient_header.h"
#include "gradient.h"
#include "patterns.h"
@ -421,84 +421,108 @@ gimp_context_class_init (GimpContextClass *klass)
parent_class = gtk_type_class (gimp_object_get_type ());
gimp_context_signals[IMAGE_CHANGED] =
gimp_signal_new (gimp_context_signal_names[IMAGE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
image_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[IMAGE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
image_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[DISPLAY_CHANGED] =
gimp_signal_new (gimp_context_signal_names[DISPLAY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
display_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[DISPLAY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
display_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[TOOL_CHANGED] =
gimp_signal_new (gimp_context_signal_names[TOOL_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
tool_changed),
gimp_sigtype_int);
gtk_signal_new (gimp_context_signal_names[TOOL_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
tool_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_context_signals[FOREGROUND_CHANGED] =
gimp_signal_new (gimp_context_signal_names[FOREGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
foreground_changed),
gimp_sigtype_int_int_int);
gtk_signal_new (gimp_context_signal_names[FOREGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
foreground_changed),
gimp_marshal_NONE__INT_INT_INT,
GTK_TYPE_NONE, 3,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_context_signals[BACKGROUND_CHANGED] =
gimp_signal_new (gimp_context_signal_names[BACKGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
background_changed),
gimp_sigtype_int_int_int);
gtk_signal_new (gimp_context_signal_names[BACKGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
background_changed),
gimp_marshal_NONE__INT_INT_INT,
GTK_TYPE_NONE, 3,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_context_signals[OPACITY_CHANGED] =
gimp_signal_new (gimp_context_signal_names[OPACITY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
opacity_changed),
gimp_sigtype_double);
gtk_signal_new (gimp_context_signal_names[OPACITY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
opacity_changed),
gimp_marshal_NONE__DOUBLE,
GTK_TYPE_NONE, 1,
GTK_TYPE_DOUBLE);
gimp_context_signals[PAINT_MODE_CHANGED] =
gimp_signal_new (gimp_context_signal_names[PAINT_MODE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
paint_mode_changed),
gimp_sigtype_int);
gtk_signal_new (gimp_context_signal_names[PAINT_MODE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
paint_mode_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_context_signals[BRUSH_CHANGED] =
gimp_signal_new (gimp_context_signal_names[BRUSH_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
brush_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[BRUSH_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
brush_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[PATTERN_CHANGED] =
gimp_signal_new (gimp_context_signal_names[PATTERN_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
pattern_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[PATTERN_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
pattern_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[GRADIENT_CHANGED] =
gimp_signal_new (gimp_context_signal_names[GRADIENT_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
gradient_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[GRADIENT_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
gradient_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, gimp_context_signals,
LAST_SIGNAL);

View File

@ -57,6 +57,7 @@ static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_destroy (GtkObject *object);
static guint gimp_drawable_signals[LAST_SIGNAL] = { 0 };
static GimpDrawableClass *parent_class = NULL;
@ -91,16 +92,19 @@ static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
GtkObjectClass *object_class;
GtkType type = GIMP_TYPE_DRAWABLE;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_drawable_signals[INVALIDATE_PREVIEW] =
gimp_signal_new ("invalidate_pr", GTK_RUN_LAST, type,
GTK_SIGNAL_OFFSET (GimpDrawableClass,
invalidate_preview),
gimp_sigtype_void);
gtk_signal_new ("invalidate_preview",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpDrawableClass,
invalidate_preview),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_drawable_signals,
LAST_SIGNAL);

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -39,7 +39,6 @@
#include "temp_buf.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "tile_manager.h"
#include "tile.h"
@ -82,12 +81,13 @@ static guint layer_signals[LAST_SIGNAL] = { 0 };
static GimpDrawableClass *layer_parent_class = NULL;
static GimpChannelClass *layer_mask_parent_class = NULL;
GtkType
gimp_layer_get_type (void)
{
static GtkType layer_type = 0;
if (!layer_type)
if (! layer_type)
{
GtkTypeInfo layer_info =
{
@ -113,14 +113,19 @@ gimp_layer_class_init (GimpLayerClass *klass)
GtkObjectClass *object_class;
GimpDrawableClass *drawable_class;
object_class = (GtkObjectClass *) klass;
object_class = (GtkObjectClass *) klass;
drawable_class = (GimpDrawableClass *) klass;
layer_parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
layer_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpLayerClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, layer_signals, LAST_SIGNAL);
@ -141,7 +146,7 @@ gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;
if (!layer_mask_type)
if (! layer_mask_type)
{
GtkTypeInfo layer_mask_info =
{
@ -167,8 +172,9 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *class)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
layer_mask_parent_class = gtk_type_class (gimp_channel_get_type ());
object_class = (GtkObjectClass *) class;
layer_mask_parent_class = gtk_type_class (GIMP_TYPE_CHANNEL);
/*
gtk_object_class_add_signals (object_class, layer_mask_signals, LAST_SIGNAL);

View File

@ -25,7 +25,6 @@
#include "apptypes.h"
#include "gimpobject.h"
#include "gimpsignal.h"
#include "gimplist.h"
@ -74,23 +73,35 @@ gimp_list_init (GimpList *list)
static void
gimp_list_class_init (GimpListClass *klass)
{
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
GtkType type = object_class->type;
GtkObjectClass *object_class;
parent_class = gtk_type_parent_class (type);
object_class = (GtkObjectClass *) klass;
object_class->destroy = gimp_list_destroy;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_list_signals[ADD]=
gimp_signal_new ("add", GTK_RUN_FIRST, type, 0,
gimp_sigtype_pointer);
gimp_list_signals[REMOVE]=
gimp_signal_new ("remove", GTK_RUN_FIRST, type, 0,
gimp_sigtype_pointer);
gtk_signal_new ("add",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpListClass,
add),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class,
gimp_list_signals,
LAST_SIGNAL);
gimp_list_signals[REMOVE]=
gtk_signal_new ("remove",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpListClass,
remove),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, gimp_list_signals, LAST_SIGNAL);
object_class->destroy = gimp_list_destroy;
klass->add = gimp_list_add_func;
klass->remove = gimp_list_remove_func;
@ -99,16 +110,26 @@ gimp_list_class_init (GimpListClass *klass)
GtkType
gimp_list_get_type (void)
{
static GtkType type;
static GtkType list_type = 0;
GIMP_TYPE_INIT (type,
GimpList,
GimpListClass,
gimp_list_init,
gimp_list_class_init,
GIMP_TYPE_OBJECT);
if (! list_type)
{
GtkTypeInfo list_info =
{
"GimpList",
sizeof (GimpList),
sizeof (GimpListClass),
(GtkClassInitFunc) gimp_list_class_init,
(GtkObjectInitFunc) gimp_list_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL
};
return type;
list_type = gtk_type_unique (GIMP_TYPE_OBJECT, &list_info);
}
return list_type;
}
GimpList *
@ -117,7 +138,7 @@ gimp_list_new (GtkType type,
{
GimpList *list;
list = gtk_type_new (gimp_list_get_type ());
list = gtk_type_new (GIMP_TYPE_LIST);
list->type = type;
list->weak = weak;
@ -172,9 +193,7 @@ gimp_list_add (GimpList *list,
gtk_object_sink (GTK_OBJECT (object));
}
GIMP_LIST_CLASS (GTK_OBJECT (list)->klass)->add (list, object);
gtk_signal_emit (GTK_OBJECT(list), gimp_list_signals[ADD], object);
gtk_signal_emit (GTK_OBJECT (list), gimp_list_signals[ADD], object);
return TRUE;
}
@ -191,8 +210,6 @@ gimp_list_remove (GimpList *list,
return FALSE;
}
GIMP_LIST_CLASS (GTK_OBJECT (list)->klass)->remove (list, object);
gtk_signal_emit (GTK_OBJECT (list), gimp_list_signals[REMOVE], object);
if (list->weak)

View File

@ -22,6 +22,7 @@
#include "gimpobject.h"
/* GimpList - a typed list of objects with signals for adding and
* removing of stuff. If it is weak, destroyed objects get removed
* automatically. If it is not, it refs them so they won't be freed
@ -29,28 +30,32 @@
*/
#define GIMP_TYPE_LIST gimp_list_get_type ()
#define GIMP_LIST(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_LIST, GimpList)
#define GIMP_IS_LIST(obj) GTK_CHECK_TYPE (obj, gimp_list_get_type())
#define GIMP_LIST_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_list_get_type(), GimpListClass)
#define GIMP_TYPE_LIST (gimp_list_get_type ())
#define GIMP_LIST(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LIST, GimpList))
#define GIMP_IS_LIST(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LIST))
#define GIMP_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LIST, GimpListClass))
typedef struct _GimpListClass GimpListClass;
struct _GimpList
{
GimpObject gobject;
GtkType type;
GSList* list;
gboolean weak;
GtkType type;
GSList *list;
gboolean weak;
};
struct _GimpListClass
{
GimpObjectClass parent_class;
void (* add) (GimpList *list, void *data);
void (* remove) (GimpList *list, void *data);
};
typedef struct _GimpListClass GimpListClass;
void (* add) (GimpList *list,
gpointer object);
void (* remove) (GimpList *list,
gpointer object);
};
GtkType gimp_list_get_type (void);
@ -68,7 +73,6 @@ gboolean gimp_list_have (GimpList *list,
void gimp_list_foreach (GimpList *list,
GFunc func,
gpointer user_data);
gint gimp_list_size (GimpList *list);
#endif /* __GIMP_LIST_H__ */

81
app/core/gimpmarshal.c Normal file
View File

@ -0,0 +1,81 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gimpmarshal.h"
typedef void (* GimpSignal_NONE__INT_INT_INT_INT) (GtkObject *object,
gint arg1,
gint arg2,
gint arg3,
gint arg4,
gpointer user_data);
void
gimp_marshal_NONE__INT_INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpSignal_NONE__INT_INT_INT_INT) func) (object,
GTK_VALUE_INT (args[0]),
GTK_VALUE_INT (args[1]),
GTK_VALUE_INT (args[2]),
GTK_VALUE_INT (args[3]),
func_data);
}
typedef void (* GimpSignal_NONE__INT_INT_INT) (GtkObject *object,
gint arg1,
gint arg2,
gint arg3,
gpointer user_data);
void
gimp_marshal_NONE__INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpSignal_NONE__INT_INT_INT) func) (object,
GTK_VALUE_INT (args[0]),
GTK_VALUE_INT (args[1]),
GTK_VALUE_INT (args[2]),
func_data);
}
typedef void (* GimpSignal_NONE__DOUBLE) (GtkObject *object,
gdouble arg1,
gpointer user_data);
void
gimp_marshal_NONE__DOUBLE (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpSignal_NONE__DOUBLE) func) (object,
GTK_VALUE_DOUBLE (args[0]),
func_data);
}

39
app/core/gimpmarshal.h Normal file
View File

@ -0,0 +1,39 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_MARSHAL_H__
#define __GIMP_MARSHAL_H__
void gimp_marshal_NONE__INT_INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
void gimp_marshal_NONE__INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
void gimp_marshal_NONE__DOUBLE (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
#endif /* __GIMP_MARSHAL_H__ */

View File

@ -38,14 +38,24 @@ gimp_object_class_init (GimpObjectClass *klass)
GtkType
gimp_object_get_type (void)
{
static GtkType type = 0;
static GtkType object_type = 0;
GIMP_TYPE_INIT (type,
GimpObject,
GimpObjectClass,
gimp_object_init,
gimp_object_class_init,
GTK_TYPE_OBJECT);
if (! object_type)
{
GtkTypeInfo object_info =
{
"GimpObject",
sizeof (GimpObject),
sizeof (GimpObjectClass),
(GtkClassInitFunc) gimp_object_class_init,
(GtkObjectInitFunc) gimp_object_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
return type;
object_type = gtk_type_unique (GTK_TYPE_OBJECT, &object_info);
}
return object_type;
}

View File

@ -24,9 +24,9 @@
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
typedef struct _GimpObjectClass GimpObjectClass;
@ -42,19 +42,7 @@ struct _GimpObjectClass
};
#define GIMP_TYPE_INIT(typevar, obtype, classtype, obinit, classinit, parent) \
if(!typevar){ \
GtkTypeInfo _info={#obtype, \
sizeof(obtype), \
sizeof(classtype), \
(GtkClassInitFunc)classinit, \
(GtkObjectInitFunc)obinit, \
NULL, NULL, NULL}; \
typevar=gtk_type_unique(parent, &_info); \
}
GtkType gimp_object_get_type (void);
GtkType gimp_object_get_type (void);
#endif /* __GIMP_OBJECT_H__ */

View File

@ -23,7 +23,6 @@
#include "apptypes.h"
#include "gimpsignal.h"
#include "parasitelist.h"
#include "libgimp/gimpparasite.h"
@ -36,14 +35,17 @@ enum
LAST_SIGNAL
};
static guint parasite_list_signals[LAST_SIGNAL];
static void parasite_list_destroy (GtkObject *list);
static void parasite_list_init (ParasiteList *list);
static void parasite_list_class_init (ParasiteListClass *klass);
static int free_a_parasite (void *key,
void *parasite,
void *unused);
static int free_a_parasite (gpointer key,
gpointer parasite,
gpointer unused);
static guint parasite_list_signals[LAST_SIGNAL] = { 0 };
static void
parasite_list_init (ParasiteList *list)
@ -54,17 +56,37 @@ parasite_list_init (ParasiteList *list)
static void
parasite_list_class_init (ParasiteListClass *klass)
{
GtkObjectClass *class = GTK_OBJECT_CLASS (klass);
GtkType type = class->type;
GtkObjectClass *object_class;
class->destroy = parasite_list_destroy;
object_class = (GtkObjectClass *) klass;
parasite_list_signals[ADD] =
gimp_signal_new ("add", GTK_RUN_FIRST, type, 0, gimp_sigtype_pointer);
parasite_list_signals[REMOVE] =
gimp_signal_new ("remove", GTK_RUN_FIRST, type, 0, gimp_sigtype_pointer);
gtk_signal_new ("add",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ParasiteListClass,
add),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (class, parasite_list_signals, LAST_SIGNAL);
parasite_list_signals[REMOVE] =
gtk_signal_new ("remove",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ParasiteListClass,
remove),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, parasite_list_signals,
LAST_SIGNAL);
object_class->destroy = parasite_list_destroy;
klass->add = NULL;
klass->remove = NULL;
}
GtkType
@ -72,7 +94,7 @@ parasite_list_get_type (void)
{
static GtkType type = 0;
if (!type)
if (! type)
{
GtkTypeInfo info =
{
@ -85,8 +107,10 @@ parasite_list_get_type (void)
NULL,
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (GIMP_TYPE_OBJECT, &info);
}
return type;
}

View File

@ -27,6 +27,9 @@
#define GIMP_IS_PARASITE_LIST(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PARASITE_LIST))
#define PARASITE_LIST_CLASS(class) GIMP_CHECK_CLASS_CAST (class, parasite_list_get_type(), ParasiteListClass)
typedef struct _ParasiteListClass ParasiteListClass;
struct _ParasiteList
{
GimpObject object;
@ -34,7 +37,7 @@ struct _ParasiteList
GHashTable *table;
};
typedef struct _ParasiteListClass
struct _ParasiteListClass
{
GimpObjectClass parent_class;
@ -42,7 +45,7 @@ typedef struct _ParasiteListClass
GimpParasite *parasite);
void (* remove) (ParasiteList *list,
GimpParasite *parasite);
} ParasiteListClass;
};
/* function declarations */

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -37,7 +37,6 @@
#include "appenv.h"
#include "module_db.h"
#include "gimpsignal.h"
#include "gimprc.h"
#include "datafiles.h"
#include "gimpset.h"
@ -397,6 +396,8 @@ module_db_browser_new (void)
typedef struct
{
GtkObjectClass parent_class;
void (* modified) (ModuleInfo *module_info);
} ModuleInfoClass;
enum
@ -424,18 +425,23 @@ static void
module_info_class_init (ModuleInfoClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
type = object_class->type;
module_info_signals[MODIFIED] =
gtk_signal_new ("modified",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ModuleInfoClass,
modified),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL);
object_class->destroy = module_info_destroy;
module_info_signals[MODIFIED] =
gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void);
gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL);
klass->modified = NULL;
}
static void

View File

@ -45,19 +45,17 @@
#include "apptypes.h"
#include "brush_header.h"
#include "patterns.h"
#include "pattern_header.h"
#include "gimpbrush.h"
#include "gimpbrushlist.h"
#include "gimpsignal.h"
#include "gimprc.h"
#include "patterns.h"
#include "pattern_header.h"
#include "paint_core.h"
#include "temp_buf.h"
#include "libgimp/gimpintl.h"
enum
{
DIRTY,
@ -68,9 +66,11 @@ enum
static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static guint gimp_brush_signals[LAST_SIGNAL];
static GimpObjectClass *parent_class;
static guint gimp_brush_signals[LAST_SIGNAL] = { 0 };
static GimpObjectClass *parent_class = NULL;
static void
gimp_brush_destroy (GtkObject *object)
@ -91,26 +91,38 @@ static void
gimp_brush_class_init (GimpBrushClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
type = object_class->type;
gimp_brush_signals[DIRTY] =
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpBrushClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_brush_signals[RENAME] =
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpBrushClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_brush_signals, LAST_SIGNAL);
object_class->destroy = gimp_brush_destroy;
klass->select_brush = gimp_brush_select_brush;
klass->dirty = NULL;
klass->rename = NULL;
klass->select_brush = gimp_brush_select_brush;
klass->want_null_motion = gimp_brush_want_null_motion;
gimp_brush_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0, gimp_sigtype_void);
gimp_brush_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0, gimp_sigtype_void);
gtk_object_class_add_signals (object_class, gimp_brush_signals, LAST_SIGNAL);
}
void

View File

@ -23,7 +23,13 @@
#include "gimpobject.h"
typedef struct _GimpBrushClass GimpBrushClass;
#define GIMP_TYPE_BRUSH (gimp_brush_get_type ())
#define GIMP_BRUSH(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH, GimpBrush))
#define GIMP_IS_BRUSH(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH))
#define GIMP_BRUSH_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), gimp_brush_get_type(), GimpBrushClass))
typedef struct _GimpBrushClass GimpBrushClass;
struct _GimpBrush
{
@ -42,14 +48,14 @@ struct _GimpBrushClass
{
GimpObjectClass parent_class;
void (* dirty) (GimpBrush *brush);
void (* rename) (GimpBrush *brush);
/* FIXME: these are no virtual function pointers but bad hacks: */
GimpBrush * (* select_brush) (PaintCore *paint_core);
gboolean (* want_null_motion) (PaintCore *paint_core);
};
#define GIMP_BRUSH_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_brush_get_type(), GimpBrushClass)
#define GIMP_TYPE_BRUSH (gimp_brush_get_type ())
#define GIMP_BRUSH(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH, GimpBrush))
#define GIMP_IS_BRUSH(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH))
GtkType gimp_brush_get_type (void);
GimpBrush * gimp_brush_load (gchar *filename);

View File

@ -47,14 +47,14 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass *parent_class = NULL;
static GimpBrushClass *parent_class = NULL;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
@ -62,7 +62,7 @@ gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);

View File

@ -66,7 +66,7 @@ static gint brush_compare_func (gconstpointer first,
/* class functions */
static GimpObjectClass* parent_class = NULL;
static GimpListClass* parent_class = NULL;
static void
@ -91,11 +91,12 @@ gimp_brush_list_class_init (GimpBrushListClass *klass)
{
GimpListClass *gimp_list_class;
gimp_list_class = GIMP_LIST_CLASS (klass);
gimp_list_class = (GimpListClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_LIST);
gimp_list_class->add = gimp_brush_list_add_func;
gimp_list_class->remove = gimp_brush_list_remove_func;
parent_class = gtk_type_class (gimp_list_get_type ());
}
void
@ -123,7 +124,7 @@ gimp_brush_list_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (gimp_list_get_type (), &info);
type = gtk_type_unique (GIMP_TYPE_LIST, &info);
}
return type;
@ -134,7 +135,7 @@ gimp_brush_list_new (void)
{
GimpBrushList *list;
list = GIMP_BRUSH_LIST (gtk_type_new (gimp_brush_list_get_type ()));
list = GIMP_BRUSH_LIST (gtk_type_new (GIMP_TYPE_BRUSH_LIST));
GIMP_LIST (list)->type = GIMP_TYPE_BRUSH;
GIMP_LIST (list)->weak = FALSE;
@ -309,15 +310,6 @@ brushes_free (void)
g_free (vbr_dir);
}
#if 0
static GSList *
insert_brush_in_list (GSList *list,
GimpBrush *brush)
{
return g_slist_insert_sorted (list, brush, brush_compare_func);
}
#endif
gint
gimp_brush_list_get_brush_index (GimpBrushList *brush_list,
GimpBrush *brush)
@ -331,7 +323,7 @@ gimp_brush_list_get_brush_by_index (GimpBrushList *brush_list,
gint index)
{
GimpBrush *brush = NULL;
GSList *list;
GSList *list;
/* FIXME: make a gimp_list function that does this? */
list = g_slist_nth (GIMP_LIST (brush_list)->list, index);

View File

@ -26,7 +26,8 @@
#define GIMP_TYPE_BRUSH_LIST (gimp_brush_list_get_type ())
#define GIMP_BRUSH_LIST(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH_LIST, GimpBrushList))
#define GIMP_IS_BRUSH_LIST(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH_LIST))
#define GIMP_BRUSH_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gimp_brush_list_get_type(), GimpBrushListClass))
#define GIMP_BRUSH_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_BRUSH_LIST, GimpBrushListClass))
typedef struct _GimpBrushListClass GimpBrushListClass;

View File

@ -56,14 +56,14 @@
#include "libgimp/gimpintl.h"
static GimpBrushClass *parent_class;
static GimpBrush * gimp_brush_pipe_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_pipe_want_null_motion (PaintCore *paint_core);
static void gimp_brush_pipe_destroy (GtkObject *object);
static GimpBrushClass *parent_class = NULL;
static GimpBrush *
gimp_brush_pipe_select_brush (PaintCore *paint_core)
{
@ -182,8 +182,8 @@ gimp_brush_pipe_class_init (GimpBrushPipeClass *klass)
GtkObjectClass *object_class;
GimpBrushClass *brush_class;
object_class = GTK_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
object_class = (GtkObjectClass *) klass;
brush_class = (GimpBrushClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);
@ -405,5 +405,3 @@ gimp_brush_pipe_load (gchar *filename)
return GIMP_BRUSH (pipe);
}

View File

@ -67,7 +67,6 @@ struct _GimpBrushPipeClass
};
GtkType gimp_brush_pixmap_get_type (void);
GtkType gimp_brush_pipe_get_type (void);
GimpBrush * gimp_brush_pipe_load (gchar *filename);

View File

@ -32,7 +32,6 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
@ -95,20 +94,28 @@ gimp_channel_get_type (void)
}
static void
gimp_channel_class_init (GimpChannelClass *class)
gimp_channel_class_init (GimpChannelClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gimp_drawable_get_type ());
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
channel_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpChannelClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, channel_signals, LAST_SIGNAL);
object_class->destroy = gimp_channel_destroy;
klass->removed = NULL;
}
static void

View File

@ -63,6 +63,8 @@ struct _GimpChannel
struct _GimpChannelClass
{
GimpDrawableClass parent_class;
void (* removed) (GimpChannel *channel);
};

View File

@ -29,8 +29,8 @@
#include "gimpbrush.h"
#include "gimpbrushlist.h"
#include "gimpcontext.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gradient_header.h"
#include "gradient.h"
#include "patterns.h"
@ -421,84 +421,108 @@ gimp_context_class_init (GimpContextClass *klass)
parent_class = gtk_type_class (gimp_object_get_type ());
gimp_context_signals[IMAGE_CHANGED] =
gimp_signal_new (gimp_context_signal_names[IMAGE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
image_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[IMAGE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
image_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[DISPLAY_CHANGED] =
gimp_signal_new (gimp_context_signal_names[DISPLAY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
display_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[DISPLAY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
display_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[TOOL_CHANGED] =
gimp_signal_new (gimp_context_signal_names[TOOL_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
tool_changed),
gimp_sigtype_int);
gtk_signal_new (gimp_context_signal_names[TOOL_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
tool_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_context_signals[FOREGROUND_CHANGED] =
gimp_signal_new (gimp_context_signal_names[FOREGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
foreground_changed),
gimp_sigtype_int_int_int);
gtk_signal_new (gimp_context_signal_names[FOREGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
foreground_changed),
gimp_marshal_NONE__INT_INT_INT,
GTK_TYPE_NONE, 3,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_context_signals[BACKGROUND_CHANGED] =
gimp_signal_new (gimp_context_signal_names[BACKGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
background_changed),
gimp_sigtype_int_int_int);
gtk_signal_new (gimp_context_signal_names[BACKGROUND_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
background_changed),
gimp_marshal_NONE__INT_INT_INT,
GTK_TYPE_NONE, 3,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_context_signals[OPACITY_CHANGED] =
gimp_signal_new (gimp_context_signal_names[OPACITY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
opacity_changed),
gimp_sigtype_double);
gtk_signal_new (gimp_context_signal_names[OPACITY_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
opacity_changed),
gimp_marshal_NONE__DOUBLE,
GTK_TYPE_NONE, 1,
GTK_TYPE_DOUBLE);
gimp_context_signals[PAINT_MODE_CHANGED] =
gimp_signal_new (gimp_context_signal_names[PAINT_MODE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
paint_mode_changed),
gimp_sigtype_int);
gtk_signal_new (gimp_context_signal_names[PAINT_MODE_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
paint_mode_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_context_signals[BRUSH_CHANGED] =
gimp_signal_new (gimp_context_signal_names[BRUSH_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
brush_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[BRUSH_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
brush_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[PATTERN_CHANGED] =
gimp_signal_new (gimp_context_signal_names[PATTERN_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
pattern_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[PATTERN_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
pattern_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_context_signals[GRADIENT_CHANGED] =
gimp_signal_new (gimp_context_signal_names[GRADIENT_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
gradient_changed),
gimp_sigtype_pointer);
gtk_signal_new (gimp_context_signal_names[GRADIENT_CHANGED],
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpContextClass,
gradient_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, gimp_context_signals,
LAST_SIGNAL);

View File

@ -57,6 +57,7 @@ static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_destroy (GtkObject *object);
static guint gimp_drawable_signals[LAST_SIGNAL] = { 0 };
static GimpDrawableClass *parent_class = NULL;
@ -91,16 +92,19 @@ static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
GtkObjectClass *object_class;
GtkType type = GIMP_TYPE_DRAWABLE;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_drawable_signals[INVALIDATE_PREVIEW] =
gimp_signal_new ("invalidate_pr", GTK_RUN_LAST, type,
GTK_SIGNAL_OFFSET (GimpDrawableClass,
invalidate_preview),
gimp_sigtype_void);
gtk_signal_new ("invalidate_preview",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpDrawableClass,
invalidate_preview),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_drawable_signals,
LAST_SIGNAL);

View File

@ -32,8 +32,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
@ -162,37 +162,88 @@ static void
gimp_image_class_init (GimpImageClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
object_class = (GtkObjectClass *) klass;
type = object_class->type;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_image_signals[CLEAN] =
gimp_signal_new ("clean", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("clean",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
clean),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[DIRTY] =
gimp_signal_new ("dirty", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("dirty",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
dirty),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[REPAINT] =
gimp_signal_new ("repaint", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int_int_int_int);
gtk_signal_new ("repaint",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
repaint),
gimp_marshal_NONE__INT_INT_INT_INT,
GTK_TYPE_NONE, 4,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RENAME] =
gimp_signal_new ("rename", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("rename",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
rename),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESIZE] =
gimp_signal_new ("resize", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gimp_signal_new ("restructure", GTK_RUN_FIRST, type, 0,
gimp_sigtype_void);
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
restructure),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[COLORMAP_CHANGED] =
gimp_signal_new ("colormap_changed", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("colormap_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
colormap_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[UNDO_EVENT] =
gimp_signal_new ("undo_event", GTK_RUN_FIRST, type, 0,
gimp_sigtype_int);
gtk_signal_new ("undo_event",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
undo_event),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gtk_object_class_add_signals (object_class, gimp_image_signals, LAST_SIGNAL);
@ -250,15 +301,26 @@ gimp_image_init (GimpImage *gimage)
GtkType
gimp_image_get_type (void)
{
static GtkType type;
static GtkType image_type = 0;
GIMP_TYPE_INIT (type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
if (! image_type)
{
GtkTypeInfo image_info =
{
"GimpImage",
sizeof (GimpImage),
sizeof (GimpImageClass),
(GtkClassInitFunc) gimp_image_class_init,
(GtkObjectInitFunc) gimp_image_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
image_type = gtk_type_unique (GIMP_TYPE_OBJECT, &image_info);
}
return image_type;
}
static void

View File

@ -39,7 +39,6 @@
#include "temp_buf.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "tile_manager.h"
#include "tile.h"
@ -82,12 +81,13 @@ static guint layer_signals[LAST_SIGNAL] = { 0 };
static GimpDrawableClass *layer_parent_class = NULL;
static GimpChannelClass *layer_mask_parent_class = NULL;
GtkType
gimp_layer_get_type (void)
{
static GtkType layer_type = 0;
if (!layer_type)
if (! layer_type)
{
GtkTypeInfo layer_info =
{
@ -113,14 +113,19 @@ gimp_layer_class_init (GimpLayerClass *klass)
GtkObjectClass *object_class;
GimpDrawableClass *drawable_class;
object_class = (GtkObjectClass *) klass;
object_class = (GtkObjectClass *) klass;
drawable_class = (GimpDrawableClass *) klass;
layer_parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
layer_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpLayerClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, layer_signals, LAST_SIGNAL);
@ -141,7 +146,7 @@ gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;
if (!layer_mask_type)
if (! layer_mask_type)
{
GtkTypeInfo layer_mask_info =
{
@ -167,8 +172,9 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *class)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
layer_mask_parent_class = gtk_type_class (gimp_channel_get_type ());
object_class = (GtkObjectClass *) class;
layer_mask_parent_class = gtk_type_class (GIMP_TYPE_CHANNEL);
/*
gtk_object_class_add_signals (object_class, layer_mask_signals, LAST_SIGNAL);

View File

@ -25,7 +25,6 @@
#include "apptypes.h"
#include "gimpobject.h"
#include "gimpsignal.h"
#include "gimplist.h"
@ -74,23 +73,35 @@ gimp_list_init (GimpList *list)
static void
gimp_list_class_init (GimpListClass *klass)
{
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
GtkType type = object_class->type;
GtkObjectClass *object_class;
parent_class = gtk_type_parent_class (type);
object_class = (GtkObjectClass *) klass;
object_class->destroy = gimp_list_destroy;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_list_signals[ADD]=
gimp_signal_new ("add", GTK_RUN_FIRST, type, 0,
gimp_sigtype_pointer);
gimp_list_signals[REMOVE]=
gimp_signal_new ("remove", GTK_RUN_FIRST, type, 0,
gimp_sigtype_pointer);
gtk_signal_new ("add",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpListClass,
add),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class,
gimp_list_signals,
LAST_SIGNAL);
gimp_list_signals[REMOVE]=
gtk_signal_new ("remove",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpListClass,
remove),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, gimp_list_signals, LAST_SIGNAL);
object_class->destroy = gimp_list_destroy;
klass->add = gimp_list_add_func;
klass->remove = gimp_list_remove_func;
@ -99,16 +110,26 @@ gimp_list_class_init (GimpListClass *klass)
GtkType
gimp_list_get_type (void)
{
static GtkType type;
static GtkType list_type = 0;
GIMP_TYPE_INIT (type,
GimpList,
GimpListClass,
gimp_list_init,
gimp_list_class_init,
GIMP_TYPE_OBJECT);
if (! list_type)
{
GtkTypeInfo list_info =
{
"GimpList",
sizeof (GimpList),
sizeof (GimpListClass),
(GtkClassInitFunc) gimp_list_class_init,
(GtkObjectInitFunc) gimp_list_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL
};
return type;
list_type = gtk_type_unique (GIMP_TYPE_OBJECT, &list_info);
}
return list_type;
}
GimpList *
@ -117,7 +138,7 @@ gimp_list_new (GtkType type,
{
GimpList *list;
list = gtk_type_new (gimp_list_get_type ());
list = gtk_type_new (GIMP_TYPE_LIST);
list->type = type;
list->weak = weak;
@ -172,9 +193,7 @@ gimp_list_add (GimpList *list,
gtk_object_sink (GTK_OBJECT (object));
}
GIMP_LIST_CLASS (GTK_OBJECT (list)->klass)->add (list, object);
gtk_signal_emit (GTK_OBJECT(list), gimp_list_signals[ADD], object);
gtk_signal_emit (GTK_OBJECT (list), gimp_list_signals[ADD], object);
return TRUE;
}
@ -191,8 +210,6 @@ gimp_list_remove (GimpList *list,
return FALSE;
}
GIMP_LIST_CLASS (GTK_OBJECT (list)->klass)->remove (list, object);
gtk_signal_emit (GTK_OBJECT (list), gimp_list_signals[REMOVE], object);
if (list->weak)

View File

@ -22,6 +22,7 @@
#include "gimpobject.h"
/* GimpList - a typed list of objects with signals for adding and
* removing of stuff. If it is weak, destroyed objects get removed
* automatically. If it is not, it refs them so they won't be freed
@ -29,28 +30,32 @@
*/
#define GIMP_TYPE_LIST gimp_list_get_type ()
#define GIMP_LIST(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_LIST, GimpList)
#define GIMP_IS_LIST(obj) GTK_CHECK_TYPE (obj, gimp_list_get_type())
#define GIMP_LIST_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_list_get_type(), GimpListClass)
#define GIMP_TYPE_LIST (gimp_list_get_type ())
#define GIMP_LIST(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LIST, GimpList))
#define GIMP_IS_LIST(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LIST))
#define GIMP_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LIST, GimpListClass))
typedef struct _GimpListClass GimpListClass;
struct _GimpList
{
GimpObject gobject;
GtkType type;
GSList* list;
gboolean weak;
GtkType type;
GSList *list;
gboolean weak;
};
struct _GimpListClass
{
GimpObjectClass parent_class;
void (* add) (GimpList *list, void *data);
void (* remove) (GimpList *list, void *data);
};
typedef struct _GimpListClass GimpListClass;
void (* add) (GimpList *list,
gpointer object);
void (* remove) (GimpList *list,
gpointer object);
};
GtkType gimp_list_get_type (void);
@ -68,7 +73,6 @@ gboolean gimp_list_have (GimpList *list,
void gimp_list_foreach (GimpList *list,
GFunc func,
gpointer user_data);
gint gimp_list_size (GimpList *list);
#endif /* __GIMP_LIST_H__ */

81
app/gimpmarshal.c Normal file
View File

@ -0,0 +1,81 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gimpmarshal.h"
typedef void (* GimpSignal_NONE__INT_INT_INT_INT) (GtkObject *object,
gint arg1,
gint arg2,
gint arg3,
gint arg4,
gpointer user_data);
void
gimp_marshal_NONE__INT_INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpSignal_NONE__INT_INT_INT_INT) func) (object,
GTK_VALUE_INT (args[0]),
GTK_VALUE_INT (args[1]),
GTK_VALUE_INT (args[2]),
GTK_VALUE_INT (args[3]),
func_data);
}
typedef void (* GimpSignal_NONE__INT_INT_INT) (GtkObject *object,
gint arg1,
gint arg2,
gint arg3,
gpointer user_data);
void
gimp_marshal_NONE__INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpSignal_NONE__INT_INT_INT) func) (object,
GTK_VALUE_INT (args[0]),
GTK_VALUE_INT (args[1]),
GTK_VALUE_INT (args[2]),
func_data);
}
typedef void (* GimpSignal_NONE__DOUBLE) (GtkObject *object,
gdouble arg1,
gpointer user_data);
void
gimp_marshal_NONE__DOUBLE (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpSignal_NONE__DOUBLE) func) (object,
GTK_VALUE_DOUBLE (args[0]),
func_data);
}

39
app/gimpmarshal.h Normal file
View File

@ -0,0 +1,39 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_MARSHAL_H__
#define __GIMP_MARSHAL_H__
void gimp_marshal_NONE__INT_INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
void gimp_marshal_NONE__INT_INT_INT (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
void gimp_marshal_NONE__DOUBLE (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args);
#endif /* __GIMP_MARSHAL_H__ */

View File

@ -38,14 +38,24 @@ gimp_object_class_init (GimpObjectClass *klass)
GtkType
gimp_object_get_type (void)
{
static GtkType type = 0;
static GtkType object_type = 0;
GIMP_TYPE_INIT (type,
GimpObject,
GimpObjectClass,
gimp_object_init,
gimp_object_class_init,
GTK_TYPE_OBJECT);
if (! object_type)
{
GtkTypeInfo object_info =
{
"GimpObject",
sizeof (GimpObject),
sizeof (GimpObjectClass),
(GtkClassInitFunc) gimp_object_class_init,
(GtkObjectInitFunc) gimp_object_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
return type;
object_type = gtk_type_unique (GTK_TYPE_OBJECT, &object_info);
}
return object_type;
}

View File

@ -24,9 +24,9 @@
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
typedef struct _GimpObjectClass GimpObjectClass;
@ -42,19 +42,7 @@ struct _GimpObjectClass
};
#define GIMP_TYPE_INIT(typevar, obtype, classtype, obinit, classinit, parent) \
if(!typevar){ \
GtkTypeInfo _info={#obtype, \
sizeof(obtype), \
sizeof(classtype), \
(GtkClassInitFunc)classinit, \
(GtkObjectInitFunc)obinit, \
NULL, NULL, NULL}; \
typevar=gtk_type_unique(parent, &_info); \
}
GtkType gimp_object_get_type (void);
GtkType gimp_object_get_type (void);
#endif /* __GIMP_OBJECT_H__ */

View File

@ -22,7 +22,6 @@
#include "apptypes.h"
#include "gimpset.h"
#include "gimpsignal.h"
/* Yep, this can be optimized quite a lot */
@ -49,6 +48,7 @@ enum
LAST_SIGNAL
};
static Node * gimp_set_find_node (GimpSet *set,
gpointer object);
static Node * gimp_set_node_new (GimpSet *set,
@ -56,10 +56,12 @@ static Node * gimp_set_node_new (GimpSet *set,
static void gimp_set_node_free (GimpSet *set,
Node *node);
static guint gimp_set_signals[LAST_SIGNAL] = { 0 };
static GimpObjectClass *parent_class = NULL;
static void
gimp_set_destroy (GtkObject *object)
{
@ -90,33 +92,39 @@ gimp_set_class_init (GimpSetClass* klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (gimp_object_get_type ());
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_set_signals[ADD]=
gimp_signal_new ("add",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpSetClass,
add),
gimp_sigtype_pointer);
gtk_signal_new ("add",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpSetClass,
add),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_set_signals[REMOVE]=
gimp_signal_new ("remove",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpSetClass,
remove),
gimp_sigtype_pointer);
gtk_signal_new ("remove",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpSetClass,
remove),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gimp_set_signals[ACTIVE_CHANGED]=
gimp_signal_new ("active_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpSetClass,
active_changed),
gimp_sigtype_pointer);
gtk_signal_new ("active_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpSetClass,
active_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, gimp_set_signals, LAST_SIGNAL);
@ -130,16 +138,26 @@ gimp_set_class_init (GimpSetClass* klass)
GtkType
gimp_set_get_type (void)
{
static GtkType gimpset_type = 0;
static GtkType set_type = 0;
GIMP_TYPE_INIT (gimpset_type,
GimpSet,
GimpSetClass,
gimp_set_init,
gimp_set_class_init,
GIMP_TYPE_OBJECT);
if (! set_type)
{
GtkTypeInfo set_info =
{
"GimpSet",
sizeof (GimpSet),
sizeof (GimpSetClass),
(GtkClassInitFunc) gimp_set_class_init,
(GtkObjectInitFunc) gimp_set_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL
};
return gimpset_type;
set_type = gtk_type_unique (GIMP_TYPE_OBJECT, &set_info);
}
return set_type;
}

View File

@ -34,10 +34,10 @@
* is also illegal to ask for a weak untyped gimpset.
*/
#define GIMP_TYPE_SET gimp_set_get_type ()
#define GIMP_SET(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_SET, GimpSet)
#define GIMP_IS_SET(obj) GTK_CHECK_TYPE (obj, gimp_set_get_type())
#define GIMP_SET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_set_get_type(), GimpSetClass)
#define GIMP_TYPE_SET (gimp_set_get_type ())
#define GIMP_SET(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_SET, GimpSet))
#define GIMP_IS_SET(obj) (GTK_CHECK_TYPE ((obj), gimp_set_get_type()))
#define GIMP_SET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), gimp_set_get_type(), GimpSetClass))
typedef struct _GimpSetClass GimpSetClass;
@ -57,12 +57,12 @@ struct _GimpSetClass
{
GimpObjectClass parent_class;
void (* add) (GimpSet *gimpset,
gpointer object);
void (* remove) (GimpSet *gimpset,
gpointer object);
void (* active_changed) (GimpSet *gimpset,
gpointer object);
void (* add) (GimpSet *gimpset,
gpointer object);
void (* remove) (GimpSet *gimpset,
gpointer object);
void (* active_changed) (GimpSet *gimpset,
gpointer object);
};

View File

@ -1,216 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "gimpsignal.h"
struct _GimpSignalType
{
GtkSignalMarshaller marshaller;
GtkType return_type;
guint nparams;
const GtkType *param_types;
};
typedef const GtkType TypeArr[];
GimpSignalID
gimp_signal_new (const gchar *name,
GtkSignalRunType signal_flags,
GtkType object_type,
guint function_offset,
GimpSignalType *sig_type)
{
return gtk_signal_newv (name,
signal_flags,
object_type,
function_offset,
sig_type->marshaller,
sig_type->return_type,
sig_type->nparams,
/* Bah. We try to be const correct, but
gtk isn't.. */
(GtkType *) sig_type->param_types);
}
/* void__void */
static GimpSignalType sigtype_void =
{
gtk_signal_default_marshaller,
GTK_TYPE_NONE,
0,
NULL
};
GimpSignalType * const gimp_sigtype_void = &sigtype_void;
/* void__pointer */
static void
gimp_marshaller_pointer (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpHandlerPointer) func) (object,
GTK_VALUE_POINTER (args[0]),
func_data);
}
static TypeArr pointer_types =
{
GTK_TYPE_POINTER
};
static GimpSignalType sigtype_pointer =
{
gimp_marshaller_pointer,
GTK_TYPE_NONE,
1,
pointer_types
};
GimpSignalType * const gimp_sigtype_pointer = &sigtype_pointer;
/* void__int */
static void
gimp_marshaller_int (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpHandlerInt) func) (object,
GTK_VALUE_INT (args[0]),
func_data);
}
static TypeArr int_types =
{
GTK_TYPE_INT
};
static GimpSignalType sigtype_int =
{
gimp_marshaller_int,
GTK_TYPE_NONE,
1,
int_types
};
GimpSignalType* const gimp_sigtype_int = &sigtype_int;
/* void__double */
static void
gimp_marshaller_double (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpHandlerDouble) func) (object,
GTK_VALUE_DOUBLE (args[0]),
func_data);
}
static TypeArr double_types =
{
GTK_TYPE_DOUBLE
};
static GimpSignalType sigtype_double =
{
gimp_marshaller_double,
GTK_TYPE_NONE,
1,
double_types
};
GimpSignalType* const gimp_sigtype_double = &sigtype_double;
/* void__int_int_int */
static void
gimp_marshaller_int_int_int (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpHandlerIntIntInt) func) (object,
GTK_VALUE_INT (args[0]),
GTK_VALUE_INT (args[1]),
GTK_VALUE_INT (args[2]),
func_data);
}
static TypeArr int_int_int_types =
{
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT
};
static GimpSignalType sigtype_int_int_int =
{
gimp_marshaller_int_int_int,
GTK_TYPE_NONE,
3,
int_int_int_types
};
GimpSignalType* const gimp_sigtype_int_int_int = &sigtype_int_int_int;
/* void__int_int_int_int */
static void
gimp_marshaller_int_int_int_int (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
(* (GimpHandlerIntIntIntInt) func) (object,
GTK_VALUE_INT (args[0]),
GTK_VALUE_INT (args[1]),
GTK_VALUE_INT (args[2]),
GTK_VALUE_INT (args[3]),
func_data);
}
static TypeArr int_int_int_int_types =
{
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_INT
};
static GimpSignalType sigtype_int_int_int_int =
{
gimp_marshaller_int_int_int_int,
GTK_TYPE_NONE,
4,
int_int_int_int_types
};
GimpSignalType * const gimp_sigtype_int_int_int_int = &sigtype_int_int_int_int;

View File

@ -1,76 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_SIGNAL_H__
#define __GIMP_SIGNAL_H__
#include <gtk/gtksignal.h>
/* This is the gtk "signal id" */
typedef guint GimpSignalID;
typedef const struct _GimpSignalType GimpSignalType;
/* The arguments are encoded in the names.. */
extern GimpSignalType * const gimp_sigtype_void;
typedef void (* GimpHandlerVoid) (GtkObject *object,
gpointer data);
extern GimpSignalType * const gimp_sigtype_pointer;
typedef void (* GimpHandlerPointer) (GtkObject *object,
gpointer p,
gpointer data);
extern GimpSignalType * const gimp_sigtype_int;
typedef void (* GimpHandlerInt) (GtkObject *object,
gint i,
gpointer data);
extern GimpSignalType * const gimp_sigtype_double;
typedef void (* GimpHandlerDouble) (GtkObject *object,
gdouble d,
gpointer data);
extern GimpSignalType * const gimp_sigtype_int_int_int;
typedef void (* GimpHandlerIntIntInt) (GtkObject *object,
gint i1,
gint i2,
gint i3,
gpointer data);
extern GimpSignalType * const gimp_sigtype_int_int_int_int;
typedef void (* GimpHandlerIntIntIntInt) (GtkObject *object,
gint i1,
gint i2,
gint i3,
gint i4,
gpointer data);
GimpSignalID gimp_signal_new (const gchar *name,
GtkSignalRunType signal_flags,
GtkType object_type,
guint function_offset,
GimpSignalType *sig_type);
#endif /* __GIMP_SIGNAL_H__ */

View File

@ -2268,7 +2268,7 @@ layer_widget_create (GimpImage *gimage,
gtk_widget_ref (layer_widget->list_item);
gtk_signal_connect_while_alive (GTK_OBJECT (layer), "invalidate_pr",
gtk_signal_connect_while_alive (GTK_OBJECT (layer), "invalidate_preview",
GTK_SIGNAL_FUNC (invalidate_preview_callback),
(gpointer)layer_widget,
GTK_OBJECT (layer_widget->list_item));

View File

@ -37,7 +37,6 @@
#include "appenv.h"
#include "module_db.h"
#include "gimpsignal.h"
#include "gimprc.h"
#include "datafiles.h"
#include "gimpset.h"
@ -397,6 +396,8 @@ module_db_browser_new (void)
typedef struct
{
GtkObjectClass parent_class;
void (* modified) (ModuleInfo *module_info);
} ModuleInfoClass;
enum
@ -424,18 +425,23 @@ static void
module_info_class_init (ModuleInfoClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
type = object_class->type;
module_info_signals[MODIFIED] =
gtk_signal_new ("modified",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ModuleInfoClass,
modified),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL);
object_class->destroy = module_info_destroy;
module_info_signals[MODIFIED] =
gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void);
gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL);
klass->modified = NULL;
}
static void

View File

@ -39,7 +39,6 @@
#include "temp_buf.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimpsignal.h"
#include "gimppreviewcache.h"
#include "tile_manager.h"
#include "tile.h"
@ -82,12 +81,13 @@ static guint layer_signals[LAST_SIGNAL] = { 0 };
static GimpDrawableClass *layer_parent_class = NULL;
static GimpChannelClass *layer_mask_parent_class = NULL;
GtkType
gimp_layer_get_type (void)
{
static GtkType layer_type = 0;
if (!layer_type)
if (! layer_type)
{
GtkTypeInfo layer_info =
{
@ -113,14 +113,19 @@ gimp_layer_class_init (GimpLayerClass *klass)
GtkObjectClass *object_class;
GimpDrawableClass *drawable_class;
object_class = (GtkObjectClass *) klass;
object_class = (GtkObjectClass *) klass;
drawable_class = (GimpDrawableClass *) klass;
layer_parent_class = gtk_type_class (GIMP_TYPE_DRAWABLE);
layer_signals[REMOVED] =
gimp_signal_new ("removed",
0, object_class->type, 0, gimp_sigtype_void);
gtk_signal_new ("removed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpLayerClass,
removed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, layer_signals, LAST_SIGNAL);
@ -141,7 +146,7 @@ gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;
if (!layer_mask_type)
if (! layer_mask_type)
{
GtkTypeInfo layer_mask_info =
{
@ -167,8 +172,9 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *class)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
layer_mask_parent_class = gtk_type_class (gimp_channel_get_type ());
object_class = (GtkObjectClass *) class;
layer_mask_parent_class = gtk_type_class (GIMP_TYPE_CHANNEL);
/*
gtk_object_class_add_signals (object_class, layer_mask_signals, LAST_SIGNAL);

View File

@ -2268,7 +2268,7 @@ layer_widget_create (GimpImage *gimage,
gtk_widget_ref (layer_widget->list_item);
gtk_signal_connect_while_alive (GTK_OBJECT (layer), "invalidate_pr",
gtk_signal_connect_while_alive (GTK_OBJECT (layer), "invalidate_preview",
GTK_SIGNAL_FUNC (invalidate_preview_callback),
(gpointer)layer_widget,
GTK_OBJECT (layer_widget->list_item));

View File

@ -37,7 +37,6 @@
#include "appenv.h"
#include "module_db.h"
#include "gimpsignal.h"
#include "gimprc.h"
#include "datafiles.h"
#include "gimpset.h"
@ -397,6 +396,8 @@ module_db_browser_new (void)
typedef struct
{
GtkObjectClass parent_class;
void (* modified) (ModuleInfo *module_info);
} ModuleInfoClass;
enum
@ -424,18 +425,23 @@ static void
module_info_class_init (ModuleInfoClass *klass)
{
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS (klass);
object_class = (GtkObjectClass *) klass;
type = object_class->type;
module_info_signals[MODIFIED] =
gtk_signal_new ("modified",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ModuleInfoClass,
modified),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL);
object_class->destroy = module_info_destroy;
module_info_signals[MODIFIED] =
gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void);
gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL);
klass->modified = NULL;
}
static void

View File

@ -23,7 +23,6 @@
#include "apptypes.h"
#include "gimpsignal.h"
#include "parasitelist.h"
#include "libgimp/gimpparasite.h"
@ -36,14 +35,17 @@ enum
LAST_SIGNAL
};
static guint parasite_list_signals[LAST_SIGNAL];
static void parasite_list_destroy (GtkObject *list);
static void parasite_list_init (ParasiteList *list);
static void parasite_list_class_init (ParasiteListClass *klass);
static int free_a_parasite (void *key,
void *parasite,
void *unused);
static int free_a_parasite (gpointer key,
gpointer parasite,
gpointer unused);
static guint parasite_list_signals[LAST_SIGNAL] = { 0 };
static void
parasite_list_init (ParasiteList *list)
@ -54,17 +56,37 @@ parasite_list_init (ParasiteList *list)
static void
parasite_list_class_init (ParasiteListClass *klass)
{
GtkObjectClass *class = GTK_OBJECT_CLASS (klass);
GtkType type = class->type;
GtkObjectClass *object_class;
class->destroy = parasite_list_destroy;
object_class = (GtkObjectClass *) klass;
parasite_list_signals[ADD] =
gimp_signal_new ("add", GTK_RUN_FIRST, type, 0, gimp_sigtype_pointer);
parasite_list_signals[REMOVE] =
gimp_signal_new ("remove", GTK_RUN_FIRST, type, 0, gimp_sigtype_pointer);
gtk_signal_new ("add",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ParasiteListClass,
add),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (class, parasite_list_signals, LAST_SIGNAL);
parasite_list_signals[REMOVE] =
gtk_signal_new ("remove",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (ParasiteListClass,
remove),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, parasite_list_signals,
LAST_SIGNAL);
object_class->destroy = parasite_list_destroy;
klass->add = NULL;
klass->remove = NULL;
}
GtkType
@ -72,7 +94,7 @@ parasite_list_get_type (void)
{
static GtkType type = 0;
if (!type)
if (! type)
{
GtkTypeInfo info =
{
@ -85,8 +107,10 @@ parasite_list_get_type (void)
NULL,
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (GIMP_TYPE_OBJECT, &info);
}
return type;
}

View File

@ -27,6 +27,9 @@
#define GIMP_IS_PARASITE_LIST(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PARASITE_LIST))
#define PARASITE_LIST_CLASS(class) GIMP_CHECK_CLASS_CAST (class, parasite_list_get_type(), ParasiteListClass)
typedef struct _ParasiteListClass ParasiteListClass;
struct _ParasiteList
{
GimpObject object;
@ -34,7 +37,7 @@ struct _ParasiteList
GHashTable *table;
};
typedef struct _ParasiteListClass
struct _ParasiteListClass
{
GimpObjectClass parent_class;
@ -42,7 +45,7 @@ typedef struct _ParasiteListClass
GimpParasite *parasite);
void (* remove) (ParasiteList *list,
GimpParasite *parasite);
} ParasiteListClass;
};
/* function declarations */