Commit 387002c0 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

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.
parent f70e9a6a
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>
* app/gimpbrushpreview.c: #include gimpbrushpipe.h and gimpbrushpipeP.h
......
......@@ -184,6 +184,7 @@ tools_new_airbrush ()
private = (PaintCore *) tool->private;
private->paint_func = airbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -136,12 +136,14 @@ gimp_OBJECTS = \
gimpbrushgenerated.o \
gimpbrushlist.o \
gimpbrushpipe.o \
gimpbrushpreview.o \
gimpcontext.o \
gimpdnd.o \
gimphistogram.o \
gimplist.o \
gimplut.o \
gimpparasite.o \
gimppatternpreview.o \
gimpprogress.o \
gimprc.o \
gimprc_cmds.o \
......@@ -157,6 +159,7 @@ gimp_OBJECTS = \
histogram_tool.o \
hue_saturation.o \
image_map.o \
image_new.o \
image_render.o \
indicator_area.o \
info_dialog.o \
......
......@@ -143,12 +143,14 @@ gimp_OBJECTS = \
gimpbrushgenerated.obj \
gimpbrushlist.obj \
gimpbrushpipe.obj \
gimpbrushpreview.obj \
gimpcontext.obj \
gimpdnd.obj \
gimphistogram.obj \
gimplist.obj \
gimplut.obj \
gimpparasite.obj \
gimppatternpreview.obj \
gimpprogress.obj \
gimprc.obj \
gimprc_cmds.obj \
......@@ -164,6 +166,7 @@ gimp_OBJECTS = \
histogram_tool.obj \
hue_saturation.obj \
image_map.obj \
image_new.obj \
image_render.obj \
indicator_area.obj \
info_dialog.obj \
......
......@@ -184,6 +184,7 @@ tools_new_airbrush ()
private = (PaintCore *) tool->private;
private->paint_func = airbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -94,6 +94,7 @@ tools_new_pencil (void)
private = (PaintCore *) tool->private;
private->paint_func = pencil_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -273,6 +273,7 @@ paint_core_button_press (Tool *tool,
}
else
{
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
paint_core->brush =
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
->klass)->select_brush) (paint_core);
......@@ -532,6 +533,7 @@ paint_core_new (ToolType type)
private->core = draw_core_new (paint_core_draw);
private->pick_colors = FALSE;
private->flags = 0;
tool->private = (void *) private;
......@@ -755,6 +757,7 @@ paint_core_interpolate (PaintCore *paint_core,
paint_core->curpressure = paint_core->lastpressure + dpressure * t;
paint_core->curxtilt = paint_core->lastxtilt + dxtilt * t;
paint_core->curytilt = paint_core->lastytilt + dytilt * t;
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
paint_core->brush =
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
->klass)->select_brush) (paint_core);
......
......@@ -31,6 +31,13 @@
#define RESUME_PAINT 3
#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);
struct _paint_core
......@@ -69,6 +76,7 @@ struct _paint_core
int pick_colors; /* pick color if ctl or alt is pressed */
int pick_state; /* was ctl or alt pressed when clicked? */
int flags; /* tool flags, see ToolFlags above */
};
extern PaintCore non_gui_paint_core;
......
......@@ -350,6 +350,7 @@ tools_new_paintbrush ()
private = (PaintCore *) tool->private;
private->paint_func = paintbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -94,6 +94,7 @@ tools_new_pencil (void)
private = (PaintCore *) tool->private;
private->paint_func = pencil_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -184,6 +184,7 @@ tools_new_airbrush ()
private = (PaintCore *) tool->private;
private->paint_func = airbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -184,6 +184,7 @@ tools_new_airbrush ()
private = (PaintCore *) tool->private;
private->paint_func = airbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -94,6 +94,7 @@ tools_new_pencil (void)
private = (PaintCore *) tool->private;
private->paint_func = pencil_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -273,6 +273,7 @@ paint_core_button_press (Tool *tool,
}
else
{
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
paint_core->brush =
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
->klass)->select_brush) (paint_core);
......@@ -532,6 +533,7 @@ paint_core_new (ToolType type)
private->core = draw_core_new (paint_core_draw);
private->pick_colors = FALSE;
private->flags = 0;
tool->private = (void *) private;
......@@ -755,6 +757,7 @@ paint_core_interpolate (PaintCore *paint_core,
paint_core->curpressure = paint_core->lastpressure + dpressure * t;
paint_core->curxtilt = paint_core->lastxtilt + dxtilt * t;
paint_core->curytilt = paint_core->lastytilt + dytilt * t;
if (paint_core->flags & TOOL_CAN_HANDLE_CHANGING_BRUSH)
paint_core->brush =
(* GIMP_BRUSH_CLASS (GTK_OBJECT (paint_core->brush)
->klass)->select_brush) (paint_core);
......
......@@ -31,6 +31,13 @@
#define RESUME_PAINT 3
#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);
struct _paint_core
......@@ -69,6 +76,7 @@ struct _paint_core
int pick_colors; /* pick color if ctl or alt is pressed */
int pick_state; /* was ctl or alt pressed when clicked? */
int flags; /* tool flags, see ToolFlags above */
};
extern PaintCore non_gui_paint_core;
......
......@@ -350,6 +350,7 @@ tools_new_paintbrush ()
private = (PaintCore *) tool->private;
private->paint_func = paintbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -94,6 +94,7 @@ tools_new_pencil (void)
private = (PaintCore *) tool->private;
private->paint_func = pencil_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
......
......@@ -1501,7 +1501,7 @@ read_tube_block (FILE *f,
g_strdup_printf ("ncells:%d step:%d dim:%d cols:%d rows:%d "
"rank0:%d rank1:%d "
"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,
(placement_mode == tpmRandom ? "random" :
(placement_mode == tpmConstant ? "constant" :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment