Commit 85c2b2dd authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed enum GimpPaintCoreState.

2004-07-19  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.h: removed enum GimpPaintCoreState.

	* app/paint/paint-enums.h: added enum GimpPaintState (with values
	that have a name space).

	* app/paint/gimppaintcore.[ch]
	* app/paint/gimpairbrush.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimpink.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimpsmudge.c
	* app/tools/gimppainttool.c: changed accordingly.

	* app/tools/gimpinktool.c: removed unused #include.
parent f26d1b8a
2004-07-19 Michael Natterer <mitch@gimp.org>
* app/paint/gimppaintcore.h: removed enum GimpPaintCoreState.
* app/paint/paint-enums.h: added enum GimpPaintState (with values
that have a name space).
* app/paint/gimppaintcore.[ch]
* app/paint/gimpairbrush.c
* app/paint/gimpbrushcore.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpink.c
* app/paint/gimppaintbrush.c
* app/paint/gimppaintcore-stroke.c
* app/paint/gimpsmudge.c
* app/tools/gimppainttool.c: changed accordingly.
* app/tools/gimpinktool.c: removed unused #include.
2004-07-19 Sven Neumann <sven@gimp.org>
* app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse):
......
......@@ -40,20 +40,20 @@
#include "gimp-intl.h"
static void gimp_airbrush_class_init (GimpAirbrushClass *klass);
static void gimp_airbrush_init (GimpAirbrush *airbrush);
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,
GimpPaintCoreState 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);
static GimpPaintbrushClass *parent_class = NULL;
......@@ -131,18 +131,18 @@ gimp_airbrush_finalize (GObject *object)
}
static void
gimp_airbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_airbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
GimpAirbrush *airbrush = GIMP_AIRBRUSH (paint_core);
GimpAirbrushOptions *options = GIMP_AIRBRUSH_OPTIONS (paint_options);
switch (paint_state)
{
case INIT_PAINT:
case GIMP_PAINT_STATE_INIT:
if (airbrush->timeout_id)
{
g_source_remove (airbrush->timeout_id);
......@@ -154,7 +154,7 @@ gimp_airbrush_paint (GimpPaintCore *paint_core,
paint_state, time);
break;
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
if (airbrush->timeout_id)
{
g_source_remove (airbrush->timeout_id);
......@@ -180,7 +180,7 @@ gimp_airbrush_paint (GimpPaintCore *paint_core,
}
break;
case FINISH_PAINT:
case GIMP_PAINT_STATE_FINISH:
if (airbrush->timeout_id)
{
g_source_remove (airbrush->timeout_id);
......@@ -191,12 +191,6 @@ gimp_airbrush_paint (GimpPaintCore *paint_core,
paint_options,
paint_state, time);
break;
default:
GIMP_PAINT_CORE_CLASS (parent_class)->paint (paint_core, drawable,
paint_options,
paint_state, time);
break;
}
}
......@@ -229,7 +223,7 @@ gimp_airbrush_timeout (gpointer data)
gimp_airbrush_paint (GIMP_PAINT_CORE (airbrush),
airbrush->drawable,
airbrush->paint_options,
MOTION_PAINT, 0);
GIMP_PAINT_STATE_MOTION, 0);
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (airbrush->drawable)));
......
......@@ -64,12 +64,12 @@ static gboolean gimp_brush_core_start (GimpPaintCore *core,
static gboolean gimp_brush_core_pre_paint (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
GimpPaintState paint_state,
guint32 time);
static void gimp_brush_core_post_paint (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
GimpPaintState paint_state,
guint32 time);
static void gimp_brush_core_interpolate (GimpPaintCore *core,
GimpDrawable *drawable,
......@@ -300,15 +300,15 @@ gimp_brush_core_finalize (GObject *object)
}
static gboolean
gimp_brush_core_pre_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_brush_core_pre_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
GimpBrushCore *core = GIMP_BRUSH_CORE (paint_core);
if (paint_state == MOTION_PAINT)
if (paint_state == GIMP_PAINT_STATE_MOTION)
{
/* If we current point == last point, check if the brush
* wants to be painted in that case. (Direction dependent
......@@ -336,15 +336,15 @@ gimp_brush_core_pre_paint (GimpPaintCore *paint_core,
}
static void
gimp_brush_core_post_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_brush_core_post_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
GimpBrushCore *core = GIMP_BRUSH_CORE (paint_core);
if (paint_state == MOTION_PAINT)
if (paint_state == GIMP_PAINT_STATE_MOTION)
{
core->brush = core->main_brush;
}
......@@ -628,7 +628,7 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core,
paint_core->pixel_dist = pixel_initial + t * pixel_dist;
gimp_paint_core_paint (paint_core, drawable, paint_options,
MOTION_PAINT, time);
GIMP_PAINT_STATE_MOTION, time);
}
paint_core->cur_coords.x = paint_core->last_coords.x + delta_vec.x;
......
......@@ -41,39 +41,39 @@
#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,
GimpPaintCoreState paint_state,
guint32 time);
static void gimp_clone_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_clone_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
static void gimp_clone_set_src_drawable (GimpClone *clone,
GimpDrawable *drawable);
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,
GimpPaintState paint_state,
guint32 time);
static void gimp_clone_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_clone_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
static void gimp_clone_set_src_drawable (GimpClone *clone,
GimpDrawable *drawable);
static GimpBrushCoreClass *parent_class = NULL;
......@@ -148,11 +148,11 @@ gimp_clone_init (GimpClone *clone)
}
static void
gimp_clone_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_clone_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
GimpClone *clone = GIMP_CLONE (paint_core);
GimpCloneOptions *options = GIMP_CLONE_OPTIONS (paint_options);
......@@ -160,7 +160,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
switch (paint_state)
{
case INIT_PAINT:
case GIMP_PAINT_STATE_INIT:
if (clone->set_source)
{
gimp_clone_set_src_drawable (clone, drawable);
......@@ -183,7 +183,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
g_message (_("No patterns available for this operation."));
break;
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
if (clone->set_source)
{
/* If the control key is down, move the src target and return */
......@@ -223,7 +223,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
}
break;
case FINISH_PAINT:
case GIMP_PAINT_STATE_FINISH:
if (options->align_mode == GIMP_CLONE_ALIGN_NO && ! clone->first_stroke)
{
clone->src_x = clone->orig_src_x;
......
......@@ -56,25 +56,25 @@ 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,
GimpPaintCoreState paint_state,
guint32 time);
static void gimp_convolve_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_convolve_calculate_matrix (GimpConvolveType type,
gdouble rate);
static void gimp_convolve_copy_matrix (const gfloat *src,
gfloat *dest,
gint size);
static gdouble gimp_convolve_sum_matrix (const gfloat *matrix,
gint size);
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,
GimpPaintState paint_state,
guint32 time);
static void gimp_convolve_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_convolve_calculate_matrix (GimpConvolveType type,
gdouble rate);
static void gimp_convolve_copy_matrix (const gfloat *src,
gfloat *dest,
gint size);
static gdouble gimp_convolve_sum_matrix (const gfloat *matrix,
gint size);
static gint matrix_size;
......@@ -165,15 +165,15 @@ gimp_convolve_init (GimpConvolve *convolve)
}
static void
gimp_convolve_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_convolve_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
switch (paint_state)
{
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
gimp_convolve_motion (paint_core, drawable, paint_options);
break;
......
......@@ -48,7 +48,7 @@ static void gimp_dodge_burn_finalize (GObject *object);
static void gimp_dodge_burn_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
GimpPaintState paint_state,
guint32 time);
static void gimp_dodge_burn_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
......@@ -151,18 +151,18 @@ gimp_dodge_burn_finalize (GObject *object)
}
static void
gimp_dodge_burn_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_dodge_burn_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
GimpDodgeBurn *dodgeburn = GIMP_DODGE_BURN (paint_core);
GimpDodgeBurnOptions *options = GIMP_DODGE_BURN_OPTIONS (paint_options);
switch (paint_state)
{
case INIT_PAINT:
case GIMP_PAINT_STATE_INIT:
dodgeburn->lut = gimp_lut_new ();
gimp_dodge_burn_make_luts (dodgeburn,
......@@ -172,20 +172,17 @@ gimp_dodge_burn_paint (GimpPaintCore *paint_core,
drawable);
break;
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
gimp_dodge_burn_motion (paint_core, drawable, paint_options);
break;
case FINISH_PAINT:
case GIMP_PAINT_STATE_FINISH:
if (dodgeburn->lut)
{
gimp_lut_free (dodgeburn->lut);
dodgeburn->lut = NULL;
}
break;
default:
break;
}
}
......
......@@ -38,17 +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_class_init (GimpEraserClass *klass);
static void gimp_eraser_init (GimpEraser *eraser);
static void gimp_eraser_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState 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;
......@@ -111,15 +111,15 @@ gimp_eraser_init (GimpEraser *eraser)
}
static void
gimp_eraser_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_eraser_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
switch (paint_state)
{
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
gimp_eraser_motion (paint_core, drawable, paint_options);
break;
......
......@@ -46,46 +46,46 @@
/* local function prototypes */
static void gimp_ink_class_init (GimpInkClass *klass);
static void gimp_ink_init (GimpInk *ink);
static void gimp_ink_finalize (GObject *object);
static void gimp_ink_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time);
static TempBuf * gimp_ink_get_paint_area (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_ink_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
guint32 time);
static Blob * ink_pen_ellipse (GimpInkOptions *options,
gdouble x_center,
gdouble y_center,
gdouble pressure,
gdouble xtilt,
gdouble ytilt,
gdouble velocity);
static void time_smoother_add (GimpInk *ink,
guint32 value);
static gdouble time_smoother_result (GimpInk *ink);
static void time_smoother_init (GimpInk *ink,
guint32 initval);
static void dist_smoother_add (GimpInk *ink,
gdouble value);
static gdouble dist_smoother_result (GimpInk *ink);
static void dist_smoother_init (GimpInk *ink,
gdouble initval);
static void render_blob (Blob *blob,
PixelRegion *dest);
static void gimp_ink_class_init (GimpInkClass *klass);
static void gimp_ink_init (GimpInk *ink);
static void gimp_ink_finalize (GObject *object);
static void gimp_ink_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time);
static TempBuf * gimp_ink_get_paint_area (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options);
static void gimp_ink_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
guint32 time);
static Blob * ink_pen_ellipse (GimpInkOptions *options,
gdouble x_center,
gdouble y_center,
gdouble pressure,
gdouble xtilt,
gdouble ytilt,
gdouble velocity);
static void time_smoother_add (GimpInk *ink,
guint32 value);
static gdouble time_smoother_result (GimpInk *ink);
static void time_smoother_init (GimpInk *ink,
guint32 initval);
static void dist_smoother_add (GimpInk *ink,
gdouble value);
static gdouble dist_smoother_result (GimpInk *ink);
static void dist_smoother_init (GimpInk *ink,
gdouble initval);
static void render_blob (Blob *blob,
PixelRegion *dest);
static GimpPaintCoreClass *parent_class = NULL;
......@@ -163,17 +163,17 @@ gimp_ink_finalize (GObject *object)
}
static void
gimp_ink_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_ink_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
GimpInk *ink = GIMP_INK (paint_core);
switch (paint_state)
{
case INIT_PAINT:
case GIMP_PAINT_STATE_INIT:
if (ink->last_blob &&
paint_core->cur_coords.x == paint_core->last_coords.x &&
paint_core->cur_coords.y == paint_core->last_coords.y)
......@@ -184,14 +184,11 @@ gimp_ink_paint (GimpPaintCore *paint_core,
}
break;
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
gimp_ink_motion (paint_core, drawable, paint_options, time);
break;
case FINISH_PAINT:
break;
default:
case GIMP_PAINT_STATE_FINISH:
break;
}
}
......
......@@ -48,7 +48,7 @@ static void gimp_paintbrush_init (GimpPaintbrush *paintbrush);
static void gimp_paintbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
GimpPaintState paint_state,
guint32 time);
......@@ -112,15 +112,15 @@ gimp_paintbrush_init (GimpPaintbrush *paintbrush)
}
static void
gimp_paintbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintCoreState paint_state,
guint32 time)
gimp_paintbrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
GimpPaintState paint_state,
guint32 time)
{
switch (paint_state)
{
case MOTION_PAINT:
case GIMP_PAINT_STATE_MOTION:
_gimp_paintbrush_motion (paint_core, drawable, paint_options,
GIMP_OPACITY_OPAQUE);
break;
......
......@@ -55,10 +55,10 @@ gimp_paint_core_stroke (GimpPaintCore *core,
core->last_coords = strokes[0];
gimp_paint_core_paint (core, drawable, paint_options,
INIT_PAINT, 0);