From 85c2b2dd4f4200d1d216016c19c9eb2e38d08cb3 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 19 Jul 2004 14:37:40 +0000 Subject: [PATCH] removed enum GimpPaintCoreState. 2004-07-19 Michael Natterer * 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. --- ChangeLog | 22 ++++++++ app/paint/gimpairbrush.c | 48 ++++++++---------- app/paint/gimpbrushcore.c | 30 +++++------ app/paint/gimpclone.c | 76 ++++++++++++++-------------- app/paint/gimpconvolve.c | 46 ++++++++--------- app/paint/gimpdodgeburn.c | 21 ++++---- app/paint/gimperaser.c | 32 ++++++------ app/paint/gimpink.c | 87 +++++++++++++++----------------- app/paint/gimppaintbrush.c | 14 ++--- app/paint/gimppaintcore-stroke.c | 18 +++---- app/paint/gimppaintcore.c | 51 ++++++++++--------- app/paint/gimppaintcore.h | 64 ++++++++++------------- app/paint/gimpsmudge.c | 42 +++++++-------- app/paint/gimpsourcecore.c | 76 ++++++++++++++-------------- app/paint/paint-enums.h | 7 +++ app/tools/gimpbrushtool.c | 12 +++-- app/tools/gimpinktool.c | 2 - app/tools/gimppainttool.c | 12 +++-- 18 files changed, 335 insertions(+), 325 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8334cf7666..e70651146b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2004-07-19 Michael Natterer + + * 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 * app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse): diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index edb5cbe08b..3aaf137db4 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -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))); diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c index 559812dced..04cc96be26 100644 --- a/app/paint/gimpbrushcore.c +++ b/app/paint/gimpbrushcore.c @@ -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; diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c index 308ed2726b..d656f245c3 100644 --- a/app/paint/gimpclone.c +++ b/app/paint/gimpclone.c @@ -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_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_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_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_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; diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 87d28aaca2..069ba3c0e1 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -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_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_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 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; diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c index bc120edfaa..c1a83710ad 100644 --- a/app/paint/gimpdodgeburn.c +++ b/app/paint/gimpdodgeburn.c @@ -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; } } diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index ebd46c34d5..f40f203977 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -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; diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c index 4268739013..23f97edc1a 100644 --- a/app/paint/gimpink.c +++ b/app/paint/gimpink.c @@ -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_class_init (GimpInkClass *klass); +static void gimp_ink_init (GimpInk *ink); -static void gimp_ink_finalize (GObject *object); +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_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 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 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 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 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; } } diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c index 903cca0c9c..7f66c8406f 100644 --- a/app/paint/gimppaintbrush.c +++ b/app/paint/gimppaintbrush.c @@ -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; diff --git a/app/paint/gimppaintcore-stroke.c b/app/paint/gimppaintcore-stroke.c index 3a252809db..a4a7ea6268 100644 --- a/app/paint/gimppaintcore-stroke.c +++ b/app/paint/gimppaintcore-stroke.c @@ -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); + GIMP_PAINT_STATE_INIT, 0); gimp_paint_core_paint (core, drawable, paint_options, - MOTION_PAINT, 0); + GIMP_PAINT_STATE_MOTION, 0); for (i = 1; i < n_strokes; i++) { @@ -68,7 +68,7 @@ gimp_paint_core_stroke (GimpPaintCore *core, } gimp_paint_core_paint (core, drawable, paint_options, - FINISH_PAINT, 0); + GIMP_PAINT_STATE_FINISH, 0); gimp_paint_core_finish (core, drawable); @@ -169,10 +169,10 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, core->last_coords = coords[0]; gimp_paint_core_paint (core, drawable, paint_options, - INIT_PAINT, 0); + GIMP_PAINT_STATE_INIT, 0); gimp_paint_core_paint (core, drawable, paint_options, - MOTION_PAINT, 0); + GIMP_PAINT_STATE_MOTION, 0); for (i = 1; i < n_coords; i++) { @@ -182,7 +182,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, } gimp_paint_core_paint (core, drawable, paint_options, - FINISH_PAINT, 0); + GIMP_PAINT_STATE_FINISH, 0); } n_coords = 0; @@ -260,10 +260,10 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core, core->last_coords = g_array_index (coords, GimpCoords, 0); gimp_paint_core_paint (core, drawable, paint_options, - INIT_PAINT, 0); + GIMP_PAINT_STATE_INIT, 0); gimp_paint_core_paint (core, drawable, paint_options, - MOTION_PAINT, 0); + GIMP_PAINT_STATE_MOTION, 0); for (i = 1; i < coords->len; i++) { @@ -273,7 +273,7 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core, } gimp_paint_core_paint (core, drawable, paint_options, - FINISH_PAINT, 0); + GIMP_PAINT_STATE_FINISH, 0); } } diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index 347d3a85fe..0d86a80590 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -46,6 +46,7 @@ #include "gimp-intl.h" + /* local function prototypes */ static void gimp_paint_core_class_init (GimpPaintCoreClass *klass); @@ -60,17 +61,17 @@ static gboolean gimp_paint_core_real_start (GimpPaintCore *core, static gboolean gimp_paint_core_real_pre_paint (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *options, - GimpPaintCoreState paint_state, + GimpPaintState paint_state, guint32 time); static void gimp_paint_core_real_paint (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *options, - GimpPaintCoreState paint_state, + GimpPaintState paint_state, guint32 time); static void gimp_paint_core_real_post_paint (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *options, - GimpPaintCoreState paint_state, + GimpPaintState paint_state, guint32 time); static void gimp_paint_core_real_interpolate (GimpPaintCore *core, GimpDrawable *drawable, @@ -180,30 +181,30 @@ gimp_paint_core_real_start (GimpPaintCore *core, } static gboolean -gimp_paint_core_real_pre_paint (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time) +gimp_paint_core_real_pre_paint (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time) { return TRUE; } static void -gimp_paint_core_real_paint (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time) +gimp_paint_core_real_paint (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time) { } static void -gimp_paint_core_real_post_paint (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time) +gimp_paint_core_real_post_paint (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time) { } @@ -214,7 +215,7 @@ gimp_paint_core_real_interpolate (GimpPaintCore *core, guint32 time) { gimp_paint_core_paint (core, drawable, paint_options, - MOTION_PAINT, time); + GIMP_PAINT_STATE_MOTION, time); core->last_coords = core->cur_coords; } @@ -228,11 +229,11 @@ gimp_paint_core_real_get_paint_area (GimpPaintCore *core, } void -gimp_paint_core_paint (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time) +gimp_paint_core_paint (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time) { GimpPaintCoreClass *core_class; @@ -247,7 +248,7 @@ gimp_paint_core_paint (GimpPaintCore *core, paint_options, paint_state, time)) { - if (paint_state == MOTION_PAINT) + if (paint_state == GIMP_PAINT_STATE_MOTION) { /* Save coordinates for gimp_paint_core_interpolate() */ core->last_paint.x = core->cur_coords.x; diff --git a/app/paint/gimppaintcore.h b/app/paint/gimppaintcore.h index e3239ccd7d..93f6d9794d 100644 --- a/app/paint/gimppaintcore.h +++ b/app/paint/gimppaintcore.h @@ -23,16 +23,6 @@ #include "core/gimpobject.h" -/* the different states that the painting function can be called with */ - -typedef enum -{ - INIT_PAINT, /* Setup PaintFunc internals */ - MOTION_PAINT, /* PaintFunc performs motion-related rendering */ - FINISH_PAINT /* Cleanup and/or reset PaintFunc operation */ -} GimpPaintCoreState; - - #define GIMP_TYPE_PAINT_CORE (gimp_paint_core_get_type ()) #define GIMP_PAINT_CORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PAINT_CORE, GimpPaintCore)) #define GIMP_PAINT_CORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINT_CORE, GimpPaintCoreClass)) @@ -77,35 +67,35 @@ struct _GimpPaintCoreClass GimpObjectClass parent_class; /* virtual functions */ - gboolean (* start) (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpCoords *coords); + gboolean (* start) (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpCoords *coords); - gboolean (* pre_paint) (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time); - void (* paint) (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time); - void (* post_paint) (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time); + gboolean (* pre_paint) (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time); + void (* paint) (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time); + void (* post_paint) (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time); - void (* interpolate) (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - guint32 time); + void (* interpolate) (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + guint32 time); - TempBuf * (* get_paint_area) (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options); + TempBuf * (* get_paint_area) (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options); }; @@ -114,7 +104,7 @@ GType gimp_paint_core_get_type (void) G_GNUC_CONST; void gimp_paint_core_paint (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *paint_options, - GimpPaintCoreState state, + GimpPaintState state, guint32 time); gboolean gimp_paint_core_start (GimpPaintCore *core, diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c index 7b51022bb3..16454a47ab 100644 --- a/app/paint/gimpsmudge.c +++ b/app/paint/gimpsmudge.c @@ -41,22 +41,22 @@ #include "gimp-intl.h" -static void gimp_smudge_class_init (GimpSmudgeClass *klass); -static void gimp_smudge_init (GimpSmudge *smudge); +static void gimp_smudge_class_init (GimpSmudgeClass *klass); +static void gimp_smudge_init (GimpSmudge *smudge); -static void gimp_smudge_finalize (GObject *object); +static void gimp_smudge_finalize (GObject *object); -static void gimp_smudge_paint (GimpPaintCore *paint_core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time); -static gboolean gimp_smudge_start (GimpPaintCore *paint_core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options); -static void gimp_smudge_motion (GimpPaintCore *paint_core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options); +static void gimp_smudge_paint (GimpPaintCore *paint_core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time); +static gboolean gimp_smudge_start (GimpPaintCore *paint_core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options); +static void gimp_smudge_motion (GimpPaintCore *paint_core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options); static void gimp_smudge_nonclipped_painthit_coords (GimpPaintCore *paint_core, gint *x, @@ -144,17 +144,17 @@ gimp_smudge_finalize (GObject *object) } static void -gimp_smudge_paint (GimpPaintCore *paint_core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpPaintCoreState paint_state, - guint32 time) +gimp_smudge_paint (GimpPaintCore *paint_core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpPaintState paint_state, + guint32 time) { GimpSmudge *smudge = GIMP_SMUDGE (paint_core); switch (paint_state) { - case MOTION_PAINT: + case GIMP_PAINT_STATE_MOTION: /* initialization fails if the user starts outside the drawable */ if (! smudge->initialized) smudge->initialized = gimp_smudge_start (paint_core, drawable, @@ -164,7 +164,7 @@ gimp_smudge_paint (GimpPaintCore *paint_core, gimp_smudge_motion (paint_core, drawable, paint_options); break; - case FINISH_PAINT: + case GIMP_PAINT_STATE_FINISH: if (smudge->accum_data) { g_free (smudge->accum_data); diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c index 308ed2726b..d656f245c3 100644 --- a/app/paint/gimpsourcecore.c +++ b/app/paint/gimpsourcecore.c @@ -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_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_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_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_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; diff --git a/app/paint/paint-enums.h b/app/paint/paint-enums.h index 11f5684bbe..8057841900 100644 --- a/app/paint/paint-enums.h +++ b/app/paint/paint-enums.h @@ -115,5 +115,12 @@ typedef enum /*< skip >*/ GIMP_BRUSH_PRESSURE /*< pdb-skip, skip >*/ } GimpBrushApplicationMode; +typedef enum /*< skip, pdb-skip >*/ +{ + GIMP_PAINT_STATE_INIT, /* Setup PaintFunc internals */ + GIMP_PAINT_STATE_MOTION, /* PaintFunc performs motion-related rendering */ + GIMP_PAINT_STATE_FINISH /* Cleanup and/or reset PaintFunc operation */ +} GimpPaintState; + #endif /* __PAINT_ENUMS_H__ */ diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c index c34c8c7d3f..78db7e4e31 100644 --- a/app/tools/gimpbrushtool.c +++ b/app/tools/gimpbrushtool.c @@ -265,7 +265,6 @@ gimp_paint_tool_finalize (GObject *object) * set here is used to decide what cursor modifier to draw and if the * picked color goes to the foreground or background color. **/ - void gimp_paint_tool_enable_color_picker (GimpPaintTool *tool, GimpColorPickMode mode) @@ -294,7 +293,7 @@ gimp_paint_tool_control (GimpTool *tool, gimp_paint_core_paint (paint_tool->core, drawable, GIMP_PAINT_OPTIONS (tool->tool_info->tool_options), - FINISH_PAINT, 0); + GIMP_PAINT_STATE_FINISH, 0); gimp_paint_core_cleanup (paint_tool->core); #if 0 @@ -450,7 +449,8 @@ gimp_paint_tool_button_press (GimpTool *tool, gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE); /* Let the specific painting function initialize itself */ - gimp_paint_core_paint (core, drawable, paint_options, INIT_PAINT, time); + gimp_paint_core_paint (core, drawable, paint_options, + GIMP_PAINT_STATE_INIT, time); /* Paint to the image */ if (paint_tool->draw_line) @@ -459,7 +459,8 @@ gimp_paint_tool_button_press (GimpTool *tool, } else { - gimp_paint_core_paint (core, drawable, paint_options, MOTION_PAINT, time); + gimp_paint_core_paint (core, drawable, paint_options, + GIMP_PAINT_STATE_MOTION, time); } gimp_projection_flush_now (gdisp->gimage->projection); @@ -489,7 +490,8 @@ gimp_paint_tool_button_release (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); /* Let the specific painting function finish up */ - gimp_paint_core_paint (core, drawable, paint_options, FINISH_PAINT, time); + gimp_paint_core_paint (core, drawable, paint_options, + GIMP_PAINT_STATE_FINISH, time); /* resume the current selection */ gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME); diff --git a/app/tools/gimpinktool.c b/app/tools/gimpinktool.c index 7365fadc11..e904fde9bf 100644 --- a/app/tools/gimpinktool.c +++ b/app/tools/gimpinktool.c @@ -24,8 +24,6 @@ #include "tools-types.h" -#include "core/gimptoolinfo.h" - #include "paint/gimpinkoptions.h" #include "widgets/gimphelp-ids.h" diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index c34c8c7d3f..78db7e4e31 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -265,7 +265,6 @@ gimp_paint_tool_finalize (GObject *object) * set here is used to decide what cursor modifier to draw and if the * picked color goes to the foreground or background color. **/ - void gimp_paint_tool_enable_color_picker (GimpPaintTool *tool, GimpColorPickMode mode) @@ -294,7 +293,7 @@ gimp_paint_tool_control (GimpTool *tool, gimp_paint_core_paint (paint_tool->core, drawable, GIMP_PAINT_OPTIONS (tool->tool_info->tool_options), - FINISH_PAINT, 0); + GIMP_PAINT_STATE_FINISH, 0); gimp_paint_core_cleanup (paint_tool->core); #if 0 @@ -450,7 +449,8 @@ gimp_paint_tool_button_press (GimpTool *tool, gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE); /* Let the specific painting function initialize itself */ - gimp_paint_core_paint (core, drawable, paint_options, INIT_PAINT, time); + gimp_paint_core_paint (core, drawable, paint_options, + GIMP_PAINT_STATE_INIT, time); /* Paint to the image */ if (paint_tool->draw_line) @@ -459,7 +459,8 @@ gimp_paint_tool_button_press (GimpTool *tool, } else { - gimp_paint_core_paint (core, drawable, paint_options, MOTION_PAINT, time); + gimp_paint_core_paint (core, drawable, paint_options, + GIMP_PAINT_STATE_MOTION, time); } gimp_projection_flush_now (gdisp->gimage->projection); @@ -489,7 +490,8 @@ gimp_paint_tool_button_release (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); /* Let the specific painting function finish up */ - gimp_paint_core_paint (core, drawable, paint_options, FINISH_PAINT, time); + gimp_paint_core_paint (core, drawable, paint_options, + GIMP_PAINT_STATE_FINISH, time); /* resume the current selection */ gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME);