mirror of https://github.com/GNOME/gimp.git
Add a flags field and corresponding type ToolFlags to PaintCore. The only
1999-08-27 Tor Lillqvist <tml@iki.fi> * app/paint_core.h: Add a flags field and corresponding type ToolFlags to PaintCore. The only flag bit defined so far is TOOL_CAN_HANDLE_CHANGING_BRUSH, which those tools who don't mind if the brush changes while painting (as in the case of pixmap pipe brushes). * app/paint_core.c: Test above flag before calling the brush's select_brush method. * app/airbrush.c * app/paintbrush.c * app/pencil.c: Set above flag. * app/makefile.{cygwin,msc}: Add latest additions.
This commit is contained in:
parent
f70e9a6aab
commit
387002c04b
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
1999-08-27 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* app/paint_core.h: Add a flags field and corresponding type
|
||||||
|
ToolFlags to PaintCore. The only flag bit defined so far is
|
||||||
|
TOOL_CAN_HANDLE_CHANGING_BRUSH, which those tools who don't mind
|
||||||
|
if the brush changes while painting (as in the case of pixmap pipe
|
||||||
|
brushes).
|
||||||
|
|
||||||
|
* app/paint_core.c: Test above flag before calling the brush's
|
||||||
|
select_brush method.
|
||||||
|
|
||||||
|
* app/airbrush.c
|
||||||
|
* app/paintbrush.c
|
||||||
|
* app/pencil.c: Set above flag.
|
||||||
|
|
||||||
|
* app/makefile.{cygwin,msc}: Add latest additions.
|
||||||
|
|
||||||
Thu Aug 26 14:16:12 PDT 1999 Manish Singh <yosh@gimp.org>
|
Thu Aug 26 14:16:12 PDT 1999 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* app/gimpbrushpreview.c: #include gimpbrushpipe.h and gimpbrushpipeP.h
|
* app/gimpbrushpreview.c: #include gimpbrushpipe.h and gimpbrushpipeP.h
|
||||||
|
|
|
@ -184,6 +184,7 @@ tools_new_airbrush ()
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = airbrush_paint_func;
|
private->paint_func = airbrush_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,12 +136,14 @@ gimp_OBJECTS = \
|
||||||
gimpbrushgenerated.o \
|
gimpbrushgenerated.o \
|
||||||
gimpbrushlist.o \
|
gimpbrushlist.o \
|
||||||
gimpbrushpipe.o \
|
gimpbrushpipe.o \
|
||||||
|
gimpbrushpreview.o \
|
||||||
gimpcontext.o \
|
gimpcontext.o \
|
||||||
gimpdnd.o \
|
gimpdnd.o \
|
||||||
gimphistogram.o \
|
gimphistogram.o \
|
||||||
gimplist.o \
|
gimplist.o \
|
||||||
gimplut.o \
|
gimplut.o \
|
||||||
gimpparasite.o \
|
gimpparasite.o \
|
||||||
|
gimppatternpreview.o \
|
||||||
gimpprogress.o \
|
gimpprogress.o \
|
||||||
gimprc.o \
|
gimprc.o \
|
||||||
gimprc_cmds.o \
|
gimprc_cmds.o \
|
||||||
|
@ -157,6 +159,7 @@ gimp_OBJECTS = \
|
||||||
histogram_tool.o \
|
histogram_tool.o \
|
||||||
hue_saturation.o \
|
hue_saturation.o \
|
||||||
image_map.o \
|
image_map.o \
|
||||||
|
image_new.o \
|
||||||
image_render.o \
|
image_render.o \
|
||||||
indicator_area.o \
|
indicator_area.o \
|
||||||
info_dialog.o \
|
info_dialog.o \
|
||||||
|
|
|
@ -143,12 +143,14 @@ gimp_OBJECTS = \
|
||||||
gimpbrushgenerated.obj \
|
gimpbrushgenerated.obj \
|
||||||
gimpbrushlist.obj \
|
gimpbrushlist.obj \
|
||||||
gimpbrushpipe.obj \
|
gimpbrushpipe.obj \
|
||||||
|
gimpbrushpreview.obj \
|
||||||
gimpcontext.obj \
|
gimpcontext.obj \
|
||||||
gimpdnd.obj \
|
gimpdnd.obj \
|
||||||
gimphistogram.obj \
|
gimphistogram.obj \
|
||||||
gimplist.obj \
|
gimplist.obj \
|
||||||
gimplut.obj \
|
gimplut.obj \
|
||||||
gimpparasite.obj \
|
gimpparasite.obj \
|
||||||
|
gimppatternpreview.obj \
|
||||||
gimpprogress.obj \
|
gimpprogress.obj \
|
||||||
gimprc.obj \
|
gimprc.obj \
|
||||||
gimprc_cmds.obj \
|
gimprc_cmds.obj \
|
||||||
|
@ -164,6 +166,7 @@ gimp_OBJECTS = \
|
||||||
histogram_tool.obj \
|
histogram_tool.obj \
|
||||||
hue_saturation.obj \
|
hue_saturation.obj \
|
||||||
image_map.obj \
|
image_map.obj \
|
||||||
|
image_new.obj \
|
||||||
image_render.obj \
|
image_render.obj \
|
||||||
indicator_area.obj \
|
indicator_area.obj \
|
||||||
info_dialog.obj \
|
info_dialog.obj \
|
||||||
|
|
|
@ -184,6 +184,7 @@ tools_new_airbrush ()
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = airbrush_paint_func;
|
private->paint_func = airbrush_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ tools_new_pencil (void)
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = pencil_paint_func;
|
private->paint_func = pencil_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,9 +273,10 @@ paint_core_button_press (Tool *tool,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
paint_core->brush =
|
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
|
||||||
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
paint_core->brush =
|
||||||
->klass)->select_brush) (paint_core);
|
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
||||||
|
->klass)->select_brush) (paint_core);
|
||||||
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,7 +533,8 @@ paint_core_new (ToolType type)
|
||||||
private->core = draw_core_new (paint_core_draw);
|
private->core = draw_core_new (paint_core_draw);
|
||||||
|
|
||||||
private->pick_colors = FALSE;
|
private->pick_colors = FALSE;
|
||||||
|
private->flags = 0;
|
||||||
|
|
||||||
tool->private = (void *) private;
|
tool->private = (void *) private;
|
||||||
|
|
||||||
tool->button_press_func = paint_core_button_press;
|
tool->button_press_func = paint_core_button_press;
|
||||||
|
@ -755,9 +757,10 @@ paint_core_interpolate (PaintCore *paint_core,
|
||||||
paint_core->curpressure = paint_core->lastpressure + dpressure * t;
|
paint_core->curpressure = paint_core->lastpressure + dpressure * t;
|
||||||
paint_core->curxtilt = paint_core->lastxtilt + dxtilt * t;
|
paint_core->curxtilt = paint_core->lastxtilt + dxtilt * t;
|
||||||
paint_core->curytilt = paint_core->lastytilt + dytilt * t;
|
paint_core->curytilt = paint_core->lastytilt + dytilt * t;
|
||||||
paint_core->brush =
|
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
|
||||||
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
paint_core->brush =
|
||||||
->klass)->select_brush) (paint_core);
|
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
||||||
|
->klass)->select_brush) (paint_core);
|
||||||
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,13 @@
|
||||||
#define RESUME_PAINT 3
|
#define RESUME_PAINT 3
|
||||||
#define FINISH_PAINT 4
|
#define FINISH_PAINT 4
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TOOL_CAN_HANDLE_CHANGING_BRUSH = 0x0001 /* Set for tools that don't mind
|
||||||
|
* if the brush changes while
|
||||||
|
* painting.
|
||||||
|
*/
|
||||||
|
} ToolFlags;
|
||||||
|
|
||||||
typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int);
|
typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int);
|
||||||
struct _paint_core
|
struct _paint_core
|
||||||
|
@ -69,6 +76,7 @@ struct _paint_core
|
||||||
|
|
||||||
int pick_colors; /* pick color if ctl or alt is pressed */
|
int pick_colors; /* pick color if ctl or alt is pressed */
|
||||||
int pick_state; /* was ctl or alt pressed when clicked? */
|
int pick_state; /* was ctl or alt pressed when clicked? */
|
||||||
|
int flags; /* tool flags, see ToolFlags above */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern PaintCore non_gui_paint_core;
|
extern PaintCore non_gui_paint_core;
|
||||||
|
|
|
@ -350,6 +350,7 @@ tools_new_paintbrush ()
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = paintbrush_paint_func;
|
private->paint_func = paintbrush_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ tools_new_pencil (void)
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = pencil_paint_func;
|
private->paint_func = pencil_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,6 +184,7 @@ tools_new_airbrush ()
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = airbrush_paint_func;
|
private->paint_func = airbrush_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,6 +184,7 @@ tools_new_airbrush ()
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = airbrush_paint_func;
|
private->paint_func = airbrush_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ tools_new_pencil (void)
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = pencil_paint_func;
|
private->paint_func = pencil_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,9 +273,10 @@ paint_core_button_press (Tool *tool,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
paint_core->brush =
|
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
|
||||||
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
paint_core->brush =
|
||||||
->klass)->select_brush) (paint_core);
|
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
||||||
|
->klass)->select_brush) (paint_core);
|
||||||
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,7 +533,8 @@ paint_core_new (ToolType type)
|
||||||
private->core = draw_core_new (paint_core_draw);
|
private->core = draw_core_new (paint_core_draw);
|
||||||
|
|
||||||
private->pick_colors = FALSE;
|
private->pick_colors = FALSE;
|
||||||
|
private->flags = 0;
|
||||||
|
|
||||||
tool->private = (void *) private;
|
tool->private = (void *) private;
|
||||||
|
|
||||||
tool->button_press_func = paint_core_button_press;
|
tool->button_press_func = paint_core_button_press;
|
||||||
|
@ -755,9 +757,10 @@ paint_core_interpolate (PaintCore *paint_core,
|
||||||
paint_core->curpressure = paint_core->lastpressure + dpressure * t;
|
paint_core->curpressure = paint_core->lastpressure + dpressure * t;
|
||||||
paint_core->curxtilt = paint_core->lastxtilt + dxtilt * t;
|
paint_core->curxtilt = paint_core->lastxtilt + dxtilt * t;
|
||||||
paint_core->curytilt = paint_core->lastytilt + dytilt * t;
|
paint_core->curytilt = paint_core->lastytilt + dytilt * t;
|
||||||
paint_core->brush =
|
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
|
||||||
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
paint_core->brush =
|
||||||
->klass)->select_brush) (paint_core);
|
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
|
||||||
|
->klass)->select_brush) (paint_core);
|
||||||
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,13 @@
|
||||||
#define RESUME_PAINT 3
|
#define RESUME_PAINT 3
|
||||||
#define FINISH_PAINT 4
|
#define FINISH_PAINT 4
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TOOL_CAN_HANDLE_CHANGING_BRUSH = 0x0001 /* Set for tools that don't mind
|
||||||
|
* if the brush changes while
|
||||||
|
* painting.
|
||||||
|
*/
|
||||||
|
} ToolFlags;
|
||||||
|
|
||||||
typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int);
|
typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int);
|
||||||
struct _paint_core
|
struct _paint_core
|
||||||
|
@ -69,6 +76,7 @@ struct _paint_core
|
||||||
|
|
||||||
int pick_colors; /* pick color if ctl or alt is pressed */
|
int pick_colors; /* pick color if ctl or alt is pressed */
|
||||||
int pick_state; /* was ctl or alt pressed when clicked? */
|
int pick_state; /* was ctl or alt pressed when clicked? */
|
||||||
|
int flags; /* tool flags, see ToolFlags above */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern PaintCore non_gui_paint_core;
|
extern PaintCore non_gui_paint_core;
|
||||||
|
|
|
@ -350,6 +350,7 @@ tools_new_paintbrush ()
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = paintbrush_paint_func;
|
private->paint_func = paintbrush_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ tools_new_pencil (void)
|
||||||
private = (PaintCore *) tool->private;
|
private = (PaintCore *) tool->private;
|
||||||
private->paint_func = pencil_paint_func;
|
private->paint_func = pencil_paint_func;
|
||||||
private->pick_colors = TRUE;
|
private->pick_colors = TRUE;
|
||||||
|
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
||||||
|
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1501,7 +1501,7 @@ read_tube_block (FILE *f,
|
||||||
g_strdup_printf ("ncells:%d step:%d dim:%d cols:%d rows:%d "
|
g_strdup_printf ("ncells:%d step:%d dim:%d cols:%d rows:%d "
|
||||||
"rank0:%d rank1:%d "
|
"rank0:%d rank1:%d "
|
||||||
"placement:%s selection:%s",
|
"placement:%s selection:%s",
|
||||||
cell_count, step_size, 2, column_count, row_count,
|
cell_count, step_size, 1, column_count, row_count,
|
||||||
column_count, row_count,
|
column_count, row_count,
|
||||||
(placement_mode == tpmRandom ? "random" :
|
(placement_mode == tpmRandom ? "random" :
|
||||||
(placement_mode == tpmConstant ? "constant" :
|
(placement_mode == tpmConstant ? "constant" :
|
||||||
|
|
Loading…
Reference in New Issue