Commit 684fe95c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

use G_DEFINE_TYPE().

2005-12-07  Michael Natterer  <mitch@gimp.org>

	* app/paint/*: use G_DEFINE_TYPE().
parent f92880b6
2005-12-07 Michael Natterer <mitch@gimp.org>
* app/paint/*: use G_DEFINE_TYPE().
2005-12-07 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimphelpui.c: allow to cancel context sensitive
......
......@@ -40,23 +40,22 @@
#include "gimp-intl.h"
static void gimp_airbrush_class_init (GimpAirbrushClass *klass);
static void gimp_airbrush_init (GimpAirbrush *airbrush);
static void gimp_airbrush_finalize (GObject *object);
static void gimp_airbrush_finalize (GObject *object);
static void gimp_airbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_airbrush_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static gboolean gimp_airbrush_timeout (gpointer data);
static void gimp_airbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_airbrush_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static gboolean gimp_airbrush_timeout (gpointer data);
G_DEFINE_TYPE (GimpAirbrush, gimp_airbrush, GIMP_TYPE_PAINTBRUSH);
static GimpPaintbrushClass *parent_class = NULL;
#define parent_class gimp_airbrush_parent_class
void
......@@ -69,42 +68,12 @@ gimp_airbrush_register (Gimp *gimp,
_("Airbrush"));
}
GType
gimp_airbrush_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpAirbrushClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_airbrush_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpAirbrush),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_airbrush_init,
};
type = g_type_register_static (GIMP_TYPE_PAINTBRUSH,
"GimpAirbrush",
&info, 0);
}
return type;
}
static void
gimp_airbrush_class_init (GimpAirbrushClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_airbrush_finalize;
paint_core_class->paint = gimp_airbrush_paint;
......
......@@ -39,8 +39,6 @@ enum
};
static void gimp_airbrush_options_class_init (GimpAirbrushOptionsClass *klass);
static void gimp_airbrush_options_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -51,44 +49,15 @@ static void gimp_airbrush_options_get_property (GObject *object,
GParamSpec *pspec);
static GimpPaintOptionsClass *parent_class = NULL;
G_DEFINE_TYPE (GimpAirbrushOptions, gimp_airbrush_options,
GIMP_TYPE_PAINT_OPTIONS);
GType
gimp_airbrush_options_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpAirbrushOptionsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_airbrush_options_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpAirbrushOptions),
0, /* n_preallocs */
(GInstanceInitFunc) NULL
};
type = g_type_register_static (GIMP_TYPE_PAINT_OPTIONS,
"GimpAirbrushOptions",
&info, 0);
}
return type;
}
static void
gimp_airbrush_options_class_init (GimpAirbrushOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_airbrush_options_set_property;
object_class->get_property = gimp_airbrush_options_get_property;
......@@ -102,6 +71,11 @@ gimp_airbrush_options_class_init (GimpAirbrushOptionsClass *klass)
0);
}
static void
gimp_airbrush_options_init (GimpAirbrushOptions *options)
{
}
static void
gimp_airbrush_options_set_property (GObject *object,
guint property_id,
......
......@@ -52,36 +52,33 @@ enum
/* local function prototypes */
static void gimp_brush_core_class_init (GimpBrushCoreClass *klass);
static void gimp_brush_core_init (GimpBrushCore *core);
static void gimp_brush_core_finalize (GObject *object);
static gboolean gimp_brush_core_start (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpCoords *coords);
static gboolean gimp_brush_core_pre_paint (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_brush_core_post_paint (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_brush_core_interpolate (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
guint32 time);
static TempBuf *gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_brush_core_real_set_brush (GimpBrushCore *core,
GimpBrush *brush);
static void gimp_brush_core_finalize (GObject *object);
static gboolean gimp_brush_core_start (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpCoords *coords);
static gboolean gimp_brush_core_pre_paint (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_brush_core_post_paint (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_brush_core_interpolate (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
guint32 time);
static TempBuf *gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_brush_core_real_set_brush (GimpBrushCore *core,
GimpBrush *brush);
static void gimp_brush_core_calc_brush_size (GimpBrushCore *core,
MaskBuf *mask,
......@@ -130,38 +127,12 @@ static void paint_line_pixmap_mask (GimpImage *dest,
GimpBrushApplicationMode mode);
static GimpPaintCoreClass *parent_class = NULL;
static guint core_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (GimpBrushCore, gimp_brush_core, GIMP_TYPE_PAINT_CORE);
GType
gimp_brush_core_get_type (void)
{
static GType core_type = 0;
#define parent_class gimp_brush_core_parent_class
if (! core_type)
{
static const GTypeInfo core_info =
{
sizeof (GimpBrushCoreClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_brush_core_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpBrushCore),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_brush_core_init,
};
core_type = g_type_register_static (GIMP_TYPE_PAINT_CORE,
"GimpBrushCore",
&core_info, 0);
}
static guint core_signals[LAST_SIGNAL] = { 0, };
return core_type;
}
static void
gimp_brush_core_class_init (GimpBrushCoreClass *klass)
......@@ -169,8 +140,6 @@ gimp_brush_core_class_init (GimpBrushCoreClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
core_signals[SET_BRUSH] =
g_signal_new ("set-brush",
G_TYPE_FROM_CLASS (klass),
......
......@@ -44,9 +44,6 @@
#include "gimp-intl.h"
static void gimp_clone_class_init (GimpCloneClass *klass);
static void gimp_clone_init (GimpClone *clone);
static void gimp_clone_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
......@@ -78,7 +75,7 @@ static void gimp_clone_set_src_drawable (GimpClone *clone,
GimpDrawable *drawable);
static GimpBrushCoreClass *parent_class = NULL;
G_DEFINE_TYPE (GimpClone, gimp_clone, GIMP_TYPE_BRUSH_CORE);
void
......@@ -91,42 +88,12 @@ gimp_clone_register (Gimp *gimp,
_("Clone"));
}
GType
gimp_clone_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpCloneClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_clone_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpClone),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_clone_init,
};
type = g_type_register_static (GIMP_TYPE_BRUSH_CORE,
"GimpClone",
&info, 0);
}
return type;
}
static void
gimp_clone_class_init (GimpCloneClass *klass)
{
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
GimpBrushCoreClass *brush_core_class = GIMP_BRUSH_CORE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
paint_core_class->paint = gimp_clone_paint;
brush_core_class->handles_changing_brush = TRUE;
......
......@@ -41,8 +41,6 @@ enum
static void gimp_clone_options_class_init (GimpCloneOptionsClass *klass);
static void gimp_clone_options_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -53,44 +51,14 @@ static void gimp_clone_options_get_property (GObject *object,
GParamSpec *pspec);
static GimpPaintOptionsClass *parent_class = NULL;
G_DEFINE_TYPE (GimpCloneOptions, gimp_clone_options, GIMP_TYPE_PAINT_OPTIONS);
GType
gimp_clone_options_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpCloneOptionsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_clone_options_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpCloneOptions),
0, /* n_preallocs */
(GInstanceInitFunc) NULL
};
type = g_type_register_static (GIMP_TYPE_PAINT_OPTIONS,
"GimpCloneOptions",
&info, 0);
}
return type;
}
static void
gimp_clone_options_class_init (GimpCloneOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_clone_options_set_property;
object_class->get_property = gimp_clone_options_get_property;
......@@ -110,6 +78,11 @@ gimp_clone_options_class_init (GimpCloneOptionsClass *klass)
0);
}
static void
gimp_clone_options_init (GimpCloneOptions *options)
{
}
static void
gimp_clone_options_set_property (GObject *object,
guint property_id,
......
......@@ -56,9 +56,6 @@ typedef enum
} ConvolveClipType;
static void gimp_convolve_class_init (GimpConvolveClass *klass);
static void gimp_convolve_init (GimpConvolve *convolve);
static void gimp_convolve_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
......@@ -108,7 +105,7 @@ static gfloat sharpen_matrix[25] =
};
static GimpBrushCoreClass *parent_class;
G_DEFINE_TYPE (GimpConvolve, gimp_convolve, GIMP_TYPE_BRUSH_CORE);
void
......@@ -121,41 +118,11 @@ gimp_convolve_register (Gimp *gimp,
_("Convolve"));
}
GType
gimp_convolve_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpConvolveClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_convolve_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpConvolve),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_convolve_init,
};
type = g_type_register_static (GIMP_TYPE_BRUSH_CORE,
"GimpConvolve",
&info, 0);
}
return type;
}
static void
gimp_convolve_class_init (GimpConvolveClass *klass)
{
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
paint_core_class->paint = gimp_convolve_paint;
}
......
......@@ -39,8 +39,6 @@ enum
};
static void gimp_convolve_options_class_init (GimpConvolveOptionsClass *klass);
static void gimp_convolve_options_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -51,44 +49,15 @@ static void gimp_convolve_options_get_property (GObject *object,
GParamSpec *pspec);
static GimpPaintOptionsClass *parent_class = NULL;
G_DEFINE_TYPE (GimpConvolveOptions, gimp_convolve_options,
GIMP_TYPE_PAINT_OPTIONS);
GType
gimp_convolve_options_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpConvolveOptionsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_convolve_options_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpConvolveOptions),
0, /* n_preallocs */
(GInstanceInitFunc) NULL
};
type = g_type_register_static (GIMP_TYPE_PAINT_OPTIONS,
"GimpConvolveOptions",
&info, 0);
}
return type;
}
static void
gimp_convolve_options_class_init (GimpConvolveOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_convolve_options_set_property;
object_class->get_property = gimp_convolve_options_get_property;
......@@ -103,6 +72,11 @@ gimp_convolve_options_class_init (GimpConvolveOptionsClass *klass)
0);
}
static void
gimp_convolve_options_init (GimpConvolveOptions *options)
{
}
static void
gimp_convolve_options_set_property (GObject *object,
guint property_id,
......
......@@ -40,9 +40,6 @@
#include "gimp-intl.h"
static void gimp_dodge_burn_class_init (GimpDodgeBurnClass *klass);
static void gimp_dodge_burn_init (GimpDodgeBurn *dodgeburn);
static void gimp_dodge_burn_finalize (GObject *object);
static void gimp_dodge_burn_paint (GimpPaintCore *paint_core,
......@@ -74,7 +71,9 @@ static gfloat gimp_dodge_burn_shadows_lut_func (gpointer user_data,
gfloat value);
static GimpBrushCoreClass *parent_class = NULL;
G_DEFINE_TYPE (GimpDodgeBurn, gimp_dodge_burn, GIMP_TYPE_BRUSH_CORE);
#define parent_class gimp_dodge_burn_parent_class
void
......@@ -87,34 +86,6 @@ gimp_dodge_burn_register (Gimp *gimp,
_("Dodge/Burn"));
}
GType
gimp_dodge_burn_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpDodgeBurnClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_dodge_burn_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDodgeBurn),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_dodge_burn_init,
};
type = g_type_register_static (GIMP_TYPE_BRUSH_CORE,
"GimpDodgeBurn",
&info, 0);
}
return type;
}
static void
gimp_dodge_burn_class_init (GimpDodgeBurnClass *klass)
{
......@@ -122,8 +93,6 @@ gimp_dodge_burn_class_init (GimpDodgeBurnClass *klass)
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
GimpBrushCoreClass *brush_core_class = GIMP_BRUSH_CORE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_dodge_burn_finalize;
paint_core_class->paint = gimp_dodge_burn_paint;
......
......@@ -41,8 +41,6 @@ enum
};
static void gimp_dodge_burn_options_class_init (GimpDodgeBurnOptionsClass *klass);
static void gimp_dodge_burn_options_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -53,44 +51,15 @@ static void gimp_dodge_burn_options_get_property (GObject *object,
GParamSpec *pspec);
static GimpPaintOptionsClass *parent_class = NULL;
G_DEFINE_TYPE (GimpDodgeBurnOptions, gimp_dodge_burn_options,
GIMP_TYPE_PAINT_OPTIONS);
GType
gimp_dodge_burn_options_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpDodgeBurnOptionsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_dodge_burn_options_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDodgeBurnOptions),
0, /* n_preallocs */
(GInstanceInitFunc) NULL
};
type = g_type_register_static (GIMP_TYPE_PAINT_OPTIONS,
"GimpDodgeBurnOptions",
&info, 0);
}
return type;
}
static void
gimp_dodge_burn_options_class_init (GimpDodgeBurnOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_dodge_burn_options_set_property;
object_class->get_property = gimp_dodge_burn_options_get_property;
......@@ -110,6 +79,11 @@ gimp_dodge_burn_options_class_init (GimpDodgeBurnOptionsClass *klass)
0);
}
static void
gimp_dodge_burn_options_init (GimpDodgeBurnOptions *options)
{
}
static void
gimp_dodge_burn_options_set_property (GObject *object,
guint property_id,
......
......@@ -38,20 +38,17 @@
#include "gimp-intl.h"
static void gimp_eraser_class_init (GimpEraserClass *klass);
static void gimp_eraser_init (GimpEraser *eraser);
static void gimp_eraser_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_eraser_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_eraser_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static void gimp_eraser_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static GimpBrushCoreClass *parent_class = NULL;
G_DEFINE_TYPE (GimpEraser, gimp_eraser, GIMP_TYPE_BRUSH_CORE);
void
......@@ -64,42 +61,12 @@ gimp_eraser_register (Gimp *gimp,
_("Eraser"));
}
GType
gimp_eraser_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo info =
{
sizeof (GimpEraserClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_eraser_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpEraser),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_eraser_init,
};
type = g_type_register_static (GIMP_TYPE_BRUSH_CORE,
"GimpEraser",
&info, 0);
}
return type;
}
static void
gimp_eraser_class_init (GimpEraserClass *klass)
{
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
GimpBrushCoreClass *brush_core_class = GIMP_BRUSH_CORE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
paint_core_class->paint = gimp_eraser_paint;
brush_core_class->handles_changing_brush = TRUE;
......
......@@ -37,8 +37,6 @@ enum
};
static void gimp_eraser_options_class_init (GimpEraserOptionsClass *klass);
static void gimp_eraser_options_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -49,44 +47,15 @@ static void gimp_eraser_options_get_property (GObject *object,
GParamSpec *pspec);
static GimpPaintOptionsClass *parent_class = NULL;