mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
f26d1b8a8c
commit
85c2b2dd4f
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
|||
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):
|
||||
|
|
|
@ -48,7 +48,7 @@ static void gimp_airbrush_finalize (GObject *object);
|
|||
static void gimp_airbrush_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static void gimp_airbrush_motion (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -134,7 +134,7 @@ static void
|
|||
gimp_airbrush_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time)
|
||||
{
|
||||
GimpAirbrush *airbrush = GIMP_AIRBRUSH (paint_core);
|
||||
|
@ -142,7 +142,7 @@ gimp_airbrush_paint (GimpPaintCore *paint_core,
|
|||
|
||||
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,
|
||||
|
@ -303,12 +303,12 @@ static gboolean
|
|||
gimp_brush_core_pre_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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
|
||||
|
@ -339,12 +339,12 @@ static void
|
|||
gimp_brush_core_post_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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;
|
||||
|
|
|
@ -47,7 +47,7 @@ static void gimp_clone_init (GimpClone *clone);
|
|||
static void gimp_clone_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static void gimp_clone_motion (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -151,7 +151,7 @@ static void
|
|||
gimp_clone_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time)
|
||||
{
|
||||
GimpClone *clone = GIMP_CLONE (paint_core);
|
||||
|
@ -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;
|
||||
|
|
|
@ -62,7 +62,7 @@ static void gimp_convolve_init (GimpConvolve *convolve);
|
|||
static void gimp_convolve_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static void gimp_convolve_motion (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -168,12 +168,12 @@ static void
|
|||
gimp_convolve_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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,
|
||||
|
@ -154,7 +154,7 @@ static void
|
|||
gimp_dodge_burn_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time)
|
||||
{
|
||||
GimpDodgeBurn *dodgeburn = GIMP_DODGE_BURN (paint_core);
|
||||
|
@ -162,7 +162,7 @@ gimp_dodge_burn_paint (GimpPaintCore *paint_core,
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ static void gimp_eraser_init (GimpEraser *eraser);
|
|||
static void gimp_eraser_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static void gimp_eraser_motion (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -114,12 +114,12 @@ static void
|
|||
gimp_eraser_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ static void gimp_ink_finalize (GObject *object);
|
|||
static void gimp_ink_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static TempBuf * gimp_ink_get_paint_area (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -166,14 +166,14 @@ static void
|
|||
gimp_ink_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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);
|
||||
|
||||
|
||||
|
@ -115,12 +115,12 @@ static void
|
|||
gimp_paintbrush_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
@ -183,7 +184,7 @@ static gboolean
|
|||
gimp_paint_core_real_pre_paint (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time)
|
||||
{
|
||||
return TRUE;
|
||||
|
@ -193,7 +194,7 @@ static void
|
|||
gimp_paint_core_real_paint (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time)
|
||||
{
|
||||
}
|
||||
|
@ -202,7 +203,7 @@ static void
|
|||
gimp_paint_core_real_post_paint (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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;
|
||||
}
|
||||
|
@ -231,7 +232,7 @@ void
|
|||
gimp_paint_core_paint (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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;
|
||||
|
|
|
@ -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))
|
||||
|
@ -85,17 +75,17 @@ struct _GimpPaintCoreClass
|
|||
gboolean (* pre_paint) (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
void (* paint) (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
void (* post_paint) (GimpPaintCore *core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
|
||||
void (* interpolate) (GimpPaintCore *core,
|
||||
|
@ -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,
|
||||
|
|
|
@ -49,7 +49,7 @@ static void gimp_smudge_finalize (GObject *object);
|
|||
static void gimp_smudge_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static gboolean gimp_smudge_start (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -147,14 +147,14 @@ static void
|
|||
gimp_smudge_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
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);
|
||||
|
|
|
@ -47,7 +47,7 @@ static void gimp_clone_init (GimpClone *clone);
|
|||
static void gimp_clone_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time);
|
||||
static void gimp_clone_motion (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -151,7 +151,7 @@ static void
|
|||
gimp_clone_paint (GimpPaintCore *paint_core,
|
||||
GimpDrawable *drawable,
|
||||
GimpPaintOptions *paint_options,
|
||||
GimpPaintCoreState paint_state,
|
||||
GimpPaintState paint_state,
|
||||
guint32 time)
|
||||
{
|
||||
GimpClone *clone = GIMP_CLONE (paint_core);
|
||||
|
@ -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;
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
#include "tools-types.h"
|
||||
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "paint/gimpinkoptions.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue