Commit c60db90f authored by Garry R. Osgood's avatar Garry R. Osgood Committed by Garry R. Osgood

Season's Greetings! app/clone.c app/paint_core.c app/paint_core.h Updated

1999-12-25 Garry R. Osgood <gosgood@idt.net>
Season's Greetings!
        * app/clone.c
        * app/paint_core.c
        * app/paint_core.h
        * MAINTAINERS
MAINTAINERS: Updated my entry (it wasn't there ;)
app/paint_core.[ch] supplied new PaintTool states to clone_paint_func() so that
writes of temporary markings made directly to the window are not
clobbered by buffered writes stemming from gdisplay_flush_xxx()
routines. clone_tool_paint_func() has been modified to take advantage
of these new states, retiring bug #2184 in a way that does not change
user interface semantics. There are small additions to the PaintCore
interface that do not affect clientele unaware of added semantics.
These changes are detailed at http://idt.net/~gosgood/gimp-patch/patch03.html.
parent c3f8c2ae
1999-12-25 Garry R. Osgood <gosgood@idt.net>
Season's Greetings!
* app/clone.c
* app/paint_core.c
* app/paint_core.h
* MAINTAINERS
MAINTAINERS: Updated my entry (it wasn't there ;)
app/paint_core.[ch] supplied new PaintTool states to clone_paint_func() so that
writes of temporary markings made directly to the window are not
clobbered by buffered writes stemming from gdisplay_flush_xxx()
routines. clone_tool_paint_func() has been modified to take advantage
of these new states, retiring bug #2184 in a way that does not change
user interface semantics. There are small additions to the PaintCore
interface that do not affect clientele unaware of added semantics.
These changes are detailed at http://idt.net/~gosgood/gimp-patch/patch03.html.
Sat Dec 25 04:14:03 CET 1999 Marc Lehmann <pcg@goof.com>
* gimp1_1_splash.ppm: Crappy it is, but at least temporary! Feel
......
......@@ -192,3 +192,12 @@ expertise: GUI, Help System, Context System
current work:
commit access: yes
Name: Garry R. Osgood
Email: gosgood@idt.net
url: http://idt.net/~gosgood/
ircnick:
expertise: Bug fixing.
current work: I fell into this rabbit hole by writing highly verbose patch documentation,
which just goes to show that succinctness is its own reward. My patch documentation
archive is http://idt.net/~gosgood/gimp-patch/
commit access: yes
......@@ -84,7 +84,6 @@ static int non_gui_offset_x;
static int non_gui_offset_y;
static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
......@@ -259,6 +258,9 @@ clone_paint_func (PaintCore *paint_core,
switch (state)
{
case PRETRACE_PAINT :
draw_core_pause (paint_core->core, active_tool);
break;
case MOTION_PAINT :
x1 = paint_core->curx;
y1 = paint_core->cury;
......@@ -298,7 +300,6 @@ clone_paint_func (PaintCore *paint_core,
clone_options->type, offset_x, offset_y);
}
draw_core_pause (paint_core->core, active_tool);
break;
case INIT_PAINT :
......@@ -343,17 +344,17 @@ clone_paint_func (PaintCore *paint_core,
src_gdisp = the_src_gdisp;
}
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
if (state == INIT_PAINT)
/* Initialize the tool drawing core */
draw_core_start (paint_core->core,
src_gdisp->canvas->window,
active_tool);
else if (state == MOTION_PAINT)
else if (state == POSTTRACE_PAINT)
{
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
draw_core_resume (paint_core->core, active_tool);
}
return NULL;
}
......@@ -427,6 +428,7 @@ tools_new_clone ()
private = (PaintCore *) tool->private;
private->paint_func = clone_paint_func;
private->core->draw_func = clone_draw;
private->flags |= TOOL_TRACES_ON_WINDOW;
return tool;
}
......
......@@ -84,7 +84,6 @@ static int non_gui_offset_x;
static int non_gui_offset_y;
static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
......@@ -259,6 +258,9 @@ clone_paint_func (PaintCore *paint_core,
switch (state)
{
case PRETRACE_PAINT :
draw_core_pause (paint_core->core, active_tool);
break;
case MOTION_PAINT :
x1 = paint_core->curx;
y1 = paint_core->cury;
......@@ -298,7 +300,6 @@ clone_paint_func (PaintCore *paint_core,
clone_options->type, offset_x, offset_y);
}
draw_core_pause (paint_core->core, active_tool);
break;
case INIT_PAINT :
......@@ -343,17 +344,17 @@ clone_paint_func (PaintCore *paint_core,
src_gdisp = the_src_gdisp;
}
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
if (state == INIT_PAINT)
/* Initialize the tool drawing core */
draw_core_start (paint_core->core,
src_gdisp->canvas->window,
active_tool);
else if (state == MOTION_PAINT)
else if (state == POSTTRACE_PAINT)
{
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
draw_core_resume (paint_core->core, active_tool);
}
return NULL;
}
......@@ -427,6 +428,7 @@ tools_new_clone ()
private = (PaintCore *) tool->private;
private->paint_func = clone_paint_func;
private->core->draw_func = clone_draw;
private->flags |= TOOL_TRACES_ON_WINDOW;
return tool;
}
......
......@@ -84,7 +84,6 @@ static int non_gui_offset_x;
static int non_gui_offset_y;
static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
......@@ -259,6 +258,9 @@ clone_paint_func (PaintCore *paint_core,
switch (state)
{
case PRETRACE_PAINT :
draw_core_pause (paint_core->core, active_tool);
break;
case MOTION_PAINT :
x1 = paint_core->curx;
y1 = paint_core->cury;
......@@ -298,7 +300,6 @@ clone_paint_func (PaintCore *paint_core,
clone_options->type, offset_x, offset_y);
}
draw_core_pause (paint_core->core, active_tool);
break;
case INIT_PAINT :
......@@ -343,17 +344,17 @@ clone_paint_func (PaintCore *paint_core,
src_gdisp = the_src_gdisp;
}
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
if (state == INIT_PAINT)
/* Initialize the tool drawing core */
draw_core_start (paint_core->core,
src_gdisp->canvas->window,
active_tool);
else if (state == MOTION_PAINT)
else if (state == POSTTRACE_PAINT)
{
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
draw_core_resume (paint_core->core, active_tool);
}
return NULL;
}
......@@ -427,6 +428,7 @@ tools_new_clone ()
private = (PaintCore *) tool->private;
private->paint_func = clone_paint_func;
private->core->draw_func = clone_draw;
private->flags |= TOOL_TRACES_ON_WINDOW;
return tool;
}
......
......@@ -336,8 +336,12 @@ paint_core_button_press (Tool *tool,
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
}
}
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, drawable, PRETRACE_PAINT);
gdisplay_flush_now (gdisp);
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, drawable, POSTTRACE_PAINT);
}
void
......@@ -403,7 +407,11 @@ paint_core_motion (Tool *tool,
paint_core_interpolate (paint_core, gimage_active_drawable (gdisp->gimage));
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, gimage_active_drawable, PRETRACE_PAINT);
gdisplay_flush_now (gdisp);
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, gimage_active_drawable, POSTTRACE_PAINT);
paint_core->lastx = paint_core->curx;
paint_core->lasty = paint_core->cury;
......
......@@ -25,18 +25,27 @@
#include "gimpdrawableF.h"
/* the different states that the painting function can be called with */
#define INIT_PAINT 0
#define MOTION_PAINT 1
#define PAUSE_PAINT 2
#define RESUME_PAINT 3
#define FINISH_PAINT 4
#define INIT_PAINT 0 /* Setup PaintFunc internals */
#define MOTION_PAINT 1 /* PaintFunc performs motion-related rendering */
#define PAUSE_PAINT 2 /* Unused. Reserved */
#define RESUME_PAINT 3 /* Unused. Reserved */
#define FINISH_PAINT 4 /* Cleanup and/or reset PaintFunc operation */
#define PRETRACE_PAINT 5 /* PaintFunc performs window tracing activity prior to rendering */
#define POSTTRACE_PAINT 6 /* PaintFunc performs window tracing activity following rendering */
typedef enum /*< skip >*/
{
TOOL_CAN_HANDLE_CHANGING_BRUSH = 0x0001 /* Set for tools that don't mind
* if the brush changes while
* painting.
*/
TOOL_CAN_HANDLE_CHANGING_BRUSH = 0x0001, /* Set for tools that don't mind
* if the brush changes while
* painting.
*/
TOOL_TRACES_ON_WINDOW /* Set for tools that perform temporary
* rendering directly to the window. These
* require sequencing with gdisplay_flush()
* routines. See clone.c for example.
*/
} ToolFlags;
typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int);
......
......@@ -84,7 +84,6 @@ static int non_gui_offset_x;
static int non_gui_offset_y;
static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
......@@ -259,6 +258,9 @@ clone_paint_func (PaintCore *paint_core,
switch (state)
{
case PRETRACE_PAINT :
draw_core_pause (paint_core->core, active_tool);
break;
case MOTION_PAINT :
x1 = paint_core->curx;
y1 = paint_core->cury;
......@@ -298,7 +300,6 @@ clone_paint_func (PaintCore *paint_core,
clone_options->type, offset_x, offset_y);
}
draw_core_pause (paint_core->core, active_tool);
break;
case INIT_PAINT :
......@@ -343,17 +344,17 @@ clone_paint_func (PaintCore *paint_core,
src_gdisp = the_src_gdisp;
}
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
if (state == INIT_PAINT)
/* Initialize the tool drawing core */
draw_core_start (paint_core->core,
src_gdisp->canvas->window,
active_tool);
else if (state == MOTION_PAINT)
else if (state == POSTTRACE_PAINT)
{
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
draw_core_resume (paint_core->core, active_tool);
}
return NULL;
}
......@@ -427,6 +428,7 @@ tools_new_clone ()
private = (PaintCore *) tool->private;
private->paint_func = clone_paint_func;
private->core->draw_func = clone_draw;
private->flags |= TOOL_TRACES_ON_WINDOW;
return tool;
}
......
......@@ -84,7 +84,6 @@ static int non_gui_offset_x;
static int non_gui_offset_y;
static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
......@@ -259,6 +258,9 @@ clone_paint_func (PaintCore *paint_core,
switch (state)
{
case PRETRACE_PAINT :
draw_core_pause (paint_core->core, active_tool);
break;
case MOTION_PAINT :
x1 = paint_core->curx;
y1 = paint_core->cury;
......@@ -298,7 +300,6 @@ clone_paint_func (PaintCore *paint_core,
clone_options->type, offset_x, offset_y);
}
draw_core_pause (paint_core->core, active_tool);
break;
case INIT_PAINT :
......@@ -343,17 +344,17 @@ clone_paint_func (PaintCore *paint_core,
src_gdisp = the_src_gdisp;
}
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
if (state == INIT_PAINT)
/* Initialize the tool drawing core */
draw_core_start (paint_core->core,
src_gdisp->canvas->window,
active_tool);
else if (state == MOTION_PAINT)
else if (state == POSTTRACE_PAINT)
{
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
draw_core_resume (paint_core->core, active_tool);
}
return NULL;
}
......@@ -427,6 +428,7 @@ tools_new_clone ()
private = (PaintCore *) tool->private;
private->paint_func = clone_paint_func;
private->core->draw_func = clone_draw;
private->flags |= TOOL_TRACES_ON_WINDOW;
return tool;
}
......
......@@ -84,7 +84,6 @@ static int non_gui_offset_x;
static int non_gui_offset_y;
static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
......@@ -259,6 +258,9 @@ clone_paint_func (PaintCore *paint_core,
switch (state)
{
case PRETRACE_PAINT :
draw_core_pause (paint_core->core, active_tool);
break;
case MOTION_PAINT :
x1 = paint_core->curx;
y1 = paint_core->cury;
......@@ -298,7 +300,6 @@ clone_paint_func (PaintCore *paint_core,
clone_options->type, offset_x, offset_y);
}
draw_core_pause (paint_core->core, active_tool);
break;
case INIT_PAINT :
......@@ -343,17 +344,17 @@ clone_paint_func (PaintCore *paint_core,
src_gdisp = the_src_gdisp;
}
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
if (state == INIT_PAINT)
/* Initialize the tool drawing core */
draw_core_start (paint_core->core,
src_gdisp->canvas->window,
active_tool);
else if (state == MOTION_PAINT)
else if (state == POSTTRACE_PAINT)
{
/* Find the target cursor's location onscreen */
gdisplay_transform_coords (src_gdisp, src_x, src_y, &trans_tx, &trans_ty, 1);
draw_core_resume (paint_core->core, active_tool);
}
return NULL;
}
......@@ -427,6 +428,7 @@ tools_new_clone ()
private = (PaintCore *) tool->private;
private->paint_func = clone_paint_func;
private->core->draw_func = clone_draw;
private->flags |= TOOL_TRACES_ON_WINDOW;
return tool;
}
......
......@@ -336,8 +336,12 @@ paint_core_button_press (Tool *tool,
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
}
}
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, drawable, PRETRACE_PAINT);
gdisplay_flush_now (gdisp);
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, drawable, POSTTRACE_PAINT);
}
void
......@@ -403,7 +407,11 @@ paint_core_motion (Tool *tool,
paint_core_interpolate (paint_core, gimage_active_drawable (gdisp->gimage));
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, gimage_active_drawable, PRETRACE_PAINT);
gdisplay_flush_now (gdisp);
if (paint_core->flags & TOOL_TRACES_ON_WINDOW)
(* paint_core->paint_func) (paint_core, gimage_active_drawable, POSTTRACE_PAINT);
paint_core->lastx = paint_core->curx;
paint_core->lasty = paint_core->cury;
......
......@@ -25,18 +25,27 @@
#include "gimpdrawableF.h"
/* the different states that the painting function can be called with */
#define INIT_PAINT 0
#define MOTION_PAINT 1
#define PAUSE_PAINT 2
#define RESUME_PAINT 3
#define FINISH_PAINT 4
#define INIT_PAINT 0 /* Setup PaintFunc internals */
#define MOTION_PAINT 1 /* PaintFunc performs motion-related rendering */
#define PAUSE_PAINT 2 /* Unused. Reserved */
#define RESUME_PAINT 3 /* Unused. Reserved */
#define FINISH_PAINT 4 /* Cleanup and/or reset PaintFunc operation */
#define PRETRACE_PAINT 5 /* PaintFunc performs window tracing activity prior to rendering */
#define POSTTRACE_PAINT 6 /* PaintFunc performs window tracing activity following rendering */
typedef enum /*< skip >*/
{
TOOL_CAN_HANDLE_CHANGING_BRUSH = 0x0001 /* Set for tools that don't mind
* if the brush changes while
* painting.
*/
TOOL_CAN_HANDLE_CHANGING_BRUSH = 0x0001, /* Set for tools that don't mind
* if the brush changes while
* painting.
*/
TOOL_TRACES_ON_WINDOW /* Set for tools that perform temporary
* rendering directly to the window. These
* require sequencing with gdisplay_flush()
* routines. See clone.c for example.
*/
} ToolFlags;
typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int);
......
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