Commit 2824801f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

made undo_pop_paint() work again.

2001-03-31  Michael Natterer  <mitch@gimp.org>

	* app/undo.c: made undo_pop_paint() work again.

	* app/tools/gimppainttool.[ch]: store the tool ID and the tool
	type in the PaintUndo struct.

	* app/tools/gimppenciltool.c: removed unused variable.

	* app/tools/gimptool.c: removed and reordered STUB()s and cruft.
parent fe51906b
2001-03-31 Michael Natterer <mitch@gimp.org>
* app/undo.c: made undo_pop_paint() work again.
* app/tools/gimppainttool.[ch]: store the tool ID and the tool
type in the PaintUndo struct.
* app/tools/gimppenciltool.c: removed unused variable.
* app/tools/gimptool.c: removed and reordered STUB()s and cruft.
2001-03-31 Michael Natterer <mitch@gimp.org>
* app/tools/Makefile.am
......
......@@ -1349,25 +1349,21 @@ undo_push_paint (GimpImage *gimage,
}
}
#ifdef __GNUC__
#warning super bogosity error
#endif
static gboolean
undo_pop_paint (GimpImage *gimage,
UndoState state,
UndoType type,
gpointer pu_ptr)
{
#if 0
PaintCore *pc;
PaintUndo *pu;
gdouble tmp;
GimpPaintTool *pt;
PaintUndo *pu;
gdouble tmp;
/* Can't have ANY tool selected - maybe a plugin running */
if (active_tool == NULL)
return TRUE;
pc = (PaintCore *) active_tool->private;
pt = (GimpPaintTool *) active_tool;
pu = (PaintUndo *) pu_ptr;
/* only pop if the active tool is the tool that pushed this undo */
......@@ -1375,30 +1371,27 @@ undo_pop_paint (GimpImage *gimage,
return TRUE;
/* swap the paint core information */
tmp = pc->lastx;
pc->lastx = pu->lastx;
tmp = pt->lastx;
pt->lastx = pu->lastx;
pu->lastx = tmp;
tmp = pc->lasty;
pc->lasty = pu->lasty;
tmp = pt->lasty;
pt->lasty = pu->lasty;
pu->lasty = tmp;
tmp = pc->lastpressure;
pc->lastpressure = pu->lastpressure;
tmp = pt->lastpressure;
pt->lastpressure = pu->lastpressure;
pu->lastpressure = tmp;
tmp = pc->lastxtilt;
pc->lastxtilt = pu->lastxtilt;
tmp = pt->lastxtilt;
pt->lastxtilt = pu->lastxtilt;
pu->lastxtilt = tmp;
tmp = pc->lastytilt;
pc->lastytilt = pu->lastytilt;
tmp = pt->lastytilt;
pt->lastytilt = pu->lastytilt;
pu->lastytilt = tmp;
return TRUE;
#else
return FALSE;
#endif
}
static void
......
......@@ -1041,8 +1041,9 @@ gimp_paint_tool_finish (GimpPaintTool *paint_tool,
undo_push_group_start (gimage, PAINT_CORE_UNDO);
pu = g_new (PaintUndo, 1);
pu->tool = paint_tool;
pu = g_new0 (PaintUndo, 1);
pu->tool_ID = GIMP_TOOL (paint_tool)->ID;
pu->tool_type = GTK_OBJECT (paint_tool)->klass->type;
pu->lastx = paint_tool->startx;
pu->lasty = paint_tool->starty;
pu->lastpressure = paint_tool->startpressure;
......
......@@ -115,7 +115,8 @@ typedef struct _PaintUndo PaintUndo;
struct _PaintUndo
{
GimpPaintTool *tool;
gint tool_ID;
GtkType tool_type;
gdouble lastx;
gdouble lasty;
......
......@@ -159,7 +159,6 @@ gimp_pencil_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state)
{
GimpImage *gimage;
PaintPressureOptions *pressure_options;
gboolean incremental;
......
......@@ -1041,8 +1041,9 @@ gimp_paint_tool_finish (GimpPaintTool *paint_tool,
undo_push_group_start (gimage, PAINT_CORE_UNDO);
pu = g_new (PaintUndo, 1);
pu->tool = paint_tool;
pu = g_new0 (PaintUndo, 1);
pu->tool_ID = GIMP_TOOL (paint_tool)->ID;
pu->tool_type = GTK_OBJECT (paint_tool)->klass->type;
pu->lastx = paint_tool->startx;
pu->lasty = paint_tool->starty;
pu->lastpressure = paint_tool->startpressure;
......
......@@ -115,7 +115,8 @@ typedef struct _PaintUndo PaintUndo;
struct _PaintUndo
{
GimpPaintTool *tool;
gint tool_ID;
GtkType tool_type;
gdouble lastx;
gdouble lasty;
......
......@@ -1041,8 +1041,9 @@ gimp_paint_tool_finish (GimpPaintTool *paint_tool,
undo_push_group_start (gimage, PAINT_CORE_UNDO);
pu = g_new (PaintUndo, 1);
pu->tool = paint_tool;
pu = g_new0 (PaintUndo, 1);
pu->tool_ID = GIMP_TOOL (paint_tool)->ID;
pu->tool_type = GTK_OBJECT (paint_tool)->klass->type;
pu->lastx = paint_tool->startx;
pu->lasty = paint_tool->starty;
pu->lastpressure = paint_tool->startpressure;
......
......@@ -115,7 +115,8 @@ typedef struct _PaintUndo PaintUndo;
struct _PaintUndo
{
GimpPaintTool *tool;
gint tool_ID;
GtkType tool_type;
gdouble lastx;
gdouble lasty;
......
......@@ -159,7 +159,6 @@ gimp_pencil_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state)
{
GimpImage *gimage;
PaintPressureOptions *pressure_options;
gboolean incremental;
......
......@@ -482,7 +482,20 @@ gimp_tool_help_func (const gchar *help_data)
#define STUB(x) void * x (void){g_message ("stub function %s called",#x); return NULL;}
#define QUIET_STUB(x) void * x (void){return NULL;}
STUB(airbrush_non_gui)
STUB(airbrush_non_gui_default)
STUB(by_color_select_initialize_by_image)
STUB(by_color_select)
STUB(perspective_find_transform)
STUB(perspective_tool_perspective)
STUB(rotate_tool_rotate)
STUB(shear_tool_shear)
STUB(smudge_non_gui)
STUB(smudge_non_gui_default)
STUB(clone_non_gui)
STUB(clone_non_gui_default)
STUB(convolve_non_gui)
STUB(convolve_non_gui_default)
STUB(curves_free)
STUB(hue_saturation_free)
......@@ -501,22 +514,7 @@ STUB(threshold_dialog_hide)
STUB(levels_dialog_hide)
STUB(curves_dialog_hide)
STUB(posterize_dialog_hide)
STUB(by_color_select_initialize_by_image)
STUB(undo_pop_paint)
STUB(histogram_tool_histogram_range)
STUB(perspective_find_transform)
STUB(perspective_tool_perspective)
STUB(rotate_tool_rotate)
STUB(shear_tool_shear)
STUB(smudge_non_gui)
STUB(smudge_non_gui_default)
STUB(airbrush_non_gui)
STUB(airbrush_non_gui_default)
STUB(by_color_select)
STUB(clone_non_gui)
STUB(clone_non_gui_default)
STUB(convolve_non_gui)
STUB(convolve_non_gui_default)
#ifdef __GNUC__
#warning obsolete crap
......@@ -636,34 +634,6 @@ ToolInfo tool_info[] =
}
}, /* perspective */
{
NULL,
N_("Blend"),
N_("/Tools/Paint Tools/Blend"),
"L",
(char **) gradient_bits,
NULL,
NULL,
N_("Fill with a color gradient"),
"tools/blend.html",
BLEND,
tools_new_blend,
tools_free_blend,
NULL,
NULL,
NULL,
{
blend_small_bits, blend_small_mask_bits,
blend_small_width, blend_small_height,
0, 0, NULL, NULL, NULL
},
{
NULL, NULL,
0, 0,
0, 0, NULL, NULL, NULL
}
},
{
NULL,
N_("Airbrush"),
......@@ -692,34 +662,6 @@ ToolInfo tool_info[] =
}
},
{
NULL,
N_("Ink"),
N_("/Tools/Paint Tools/Ink"),
"K",
(char **) ink_bits,
NULL,
NULL,
N_("Draw in ink"),
"tools/ink.html",
INK,
tools_new_ink,
tools_free_ink,
NULL,
NULL,
NULL,
{
ink_small_bits, ink_small_mask_bits,
ink_small_width, ink_small_height,
0, 0, NULL, NULL, NULL
},
{
NULL, NULL,
0, 0,
0, 0, NULL, NULL, NULL
}
},
{
NULL,
N_("Clone"),
......
......@@ -1349,25 +1349,21 @@ undo_push_paint (GimpImage *gimage,
}
}
#ifdef __GNUC__
#warning super bogosity error
#endif
static gboolean
undo_pop_paint (GimpImage *gimage,
UndoState state,
UndoType type,
gpointer pu_ptr)
{
#if 0
PaintCore *pc;
PaintUndo *pu;
gdouble tmp;
GimpPaintTool *pt;
PaintUndo *pu;
gdouble tmp;
/* Can't have ANY tool selected - maybe a plugin running */
if (active_tool == NULL)
return TRUE;
pc = (PaintCore *) active_tool->private;
pt = (GimpPaintTool *) active_tool;
pu = (PaintUndo *) pu_ptr;
/* only pop if the active tool is the tool that pushed this undo */
......@@ -1375,30 +1371,27 @@ undo_pop_paint (GimpImage *gimage,
return TRUE;
/* swap the paint core information */
tmp = pc->lastx;
pc->lastx = pu->lastx;
tmp = pt->lastx;
pt->lastx = pu->lastx;
pu->lastx = tmp;
tmp = pc->lasty;
pc->lasty = pu->lasty;
tmp = pt->lasty;
pt->lasty = pu->lasty;
pu->lasty = tmp;
tmp = pc->lastpressure;
pc->lastpressure = pu->lastpressure;
tmp = pt->lastpressure;
pt->lastpressure = pu->lastpressure;
pu->lastpressure = tmp;
tmp = pc->lastxtilt;
pc->lastxtilt = pu->lastxtilt;
tmp = pt->lastxtilt;
pt->lastxtilt = pu->lastxtilt;
pu->lastxtilt = tmp;
tmp = pc->lastytilt;
pc->lastytilt = pu->lastytilt;
tmp = pt->lastytilt;
pt->lastytilt = pu->lastytilt;
pu->lastytilt = tmp;
return TRUE;
#else
return FALSE;
#endif
}
static void
......
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