Commit 84b634f2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

build the measure tool again.

2001-02-27  Michael Natterer  <mitch@gimp.org>

	* app/tools/Makefile.am: build the measure tool again.

	* app/tools/gimpcolorpickertool.c: correct prototypes for some
	functions so we don't get warnings about incompatible assignments
	in "class_init", chain up in "control".

	* app/tools/gimpdrawtool.c: added an implementation of "control"
	which can be called from subclasses so we don't need to call
	GimpDrawTool's methods directly from there.

	* app/tools/gimppaintbrushtool.[ch]: create it's tool options so it
	doesn't crash. Commented out the non_gui stuff. We need a different
	interface for this.

	* app/tools/gimppainttool.[ch]: some cleanups: call the draw tool's
	"control" function, fixed "cursor_update", fixed indentation.

	* app/tools/measure.[ch]: made it work again (properly subclass
	GimpDrawTool).

	* app/tools/tool.c: re-added the non_gui paintbrush STUB()'s

	* app/tools/tools.c: don't allocate the non_gui stuff.
	GimpPaintTool is an abstract superclass, so we cannot create
	an instance of it. Moreover, the current non_gui stuff assumes
	that there is something like a "paint_core" and changes it's
	virtual function pointers, breaking the object system totally.
parent f19f4389
2001-02-27 Michael Natterer <mitch@gimp.org>
* app/tools/Makefile.am: build the measure tool again.
* app/tools/gimpcolorpickertool.c: correct prototypes for some
functions so we don't get warnings about incompatible assignments
in "class_init", chain up in "control".
* app/tools/gimpdrawtool.c: added an implementation of "control"
which can be called from subclasses so we don't need to call
GimpDrawTool's methods directly from there.
* app/tools/gimppaintbrushtool.[ch]: create it's tool options so it
doesn't crash. Commented out the non_gui stuff. We need a different
interface for this.
* app/tools/gimppainttool.[ch]: some cleanups: call the draw tool's
"control" function, fixed "cursor_update", fixed indentation.
* app/tools/measure.[ch]: made it work again (properly subclass
GimpDrawTool).
* app/tools/tool.c: re-added the non_gui paintbrush STUB()'s
* app/tools/tools.c: don't allocate the non_gui stuff.
GimpPaintTool is an abstract superclass, so we cannot create
an instance of it. Moreover, the current non_gui stuff assumes
that there is something like a "paint_core" and changes it's
virtual function pointers, breaking the object system totally.
2001-02-27 Sven Neumann <sven@gimp.org>
* plug-ins/common/header.c: applied patch from Chuck Mason
......
......@@ -99,10 +99,10 @@ static void gimp_color_picker_tool_cursor_update (GimpTool *tool,
GDisplay *gdisp);
static void gimp_color_picker_tool_control (GimpTool *tool,
ToolAction action,
ToolAction action,
GDisplay *gdisp);
static void gimp_color_picker_tool_draw (GimpTool *tool);
static void gimp_color_picker_tool_draw (GimpDrawTool *draw_tool);
......@@ -110,9 +110,9 @@ static GimpColorPickerToolOptions * gimp_color_picker_tool_options_new (void);
static void gimp_color_picker_tool_options_reset (void);
static void gimp_color_picker_tool_info_window_close_callback (GtkWidget *widget,
gpointer data);
gpointer data);
static void gimp_color_picker_tool_info_update (GimpTool *tool,
gboolean valid);
gboolean valid);
......@@ -146,7 +146,7 @@ static gchar index_buf[MAX_INFO_BUF];
static gchar gray_buf [MAX_INFO_BUF];
static gchar hex_buf [MAX_INFO_BUF];
static GimpToolClass *parent_class = NULL;
static GimpDrawToolClass *parent_class = NULL;
void
......@@ -594,28 +594,24 @@ gimp_color_picker_tool_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp)
{
GimpDrawTool *dr_tool;
dr_tool = GIMP_DRAW_TOOL(tool);
switch (action)
{
case PAUSE :
gimp_draw_tool_pause (dr_tool);
break;
case RESUME :
gimp_draw_tool_resume (dr_tool);
break;
case HALT :
gimp_draw_tool_stop (dr_tool);
info_dialog_popdown (gimp_color_picker_tool_info);
break;
default:
break;
}
if (GIMP_TOOL_CLASS (parent_class)->control)
GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
}
typedef guchar * (*GetColorFunc) (GimpObject *object,
......@@ -742,19 +738,19 @@ pick_color (GimpImage *gimage,
}
static void
gimp_color_picker_tool_draw (GimpTool *tool)
gimp_color_picker_tool_draw (GimpDrawTool *draw_tool)
{
GimpColorPickerTool *cp_tool;
GimpDrawTool *dr_tool;
gint tx, ty;
gint radiusx, radiusy;
gint cx, cy;
GimpTool *tool;
gint tx, ty;
gint radiusx, radiusy;
gint cx, cy;
if (! gimp_color_picker_tool_options->sample_average)
return;
cp_tool = GIMP_COLOR_PICKER_TOOL(tool);
dr_tool = GIMP_DRAW_TOOL(tool);
cp_tool = GIMP_COLOR_PICKER_TOOL (draw_tool);
tool = GIMP_TOOL (draw_tool);
gdisplay_transform_coords (tool->gdisp, cp_tool->centerx, cp_tool->centery,
&tx, &ty, TRUE);
......@@ -765,14 +761,14 @@ gimp_color_picker_tool_draw (GimpTool *tool)
cy = SCALEY (tool->gdisp, 1);
/* Draw the circle around the collecting area */
gdk_draw_rectangle (dr_tool->win, dr_tool->gc, 0,
gdk_draw_rectangle (draw_tool->win, draw_tool->gc, 0,
tx - radiusx,
ty - radiusy,
2 * radiusx + cx, 2 * radiusy + cy);
if (radiusx > 1 && radiusy > 1)
{
gdk_draw_rectangle (dr_tool->win, dr_tool->gc, 0,
gdk_draw_rectangle (draw_tool->win, draw_tool->gc, 0,
tx - radiusx + 2,
ty - radiusy + 2,
2 * radiusx + cx - 4, 2 * radiusy + cy - 4);
......@@ -781,7 +777,7 @@ gimp_color_picker_tool_draw (GimpTool *tool)
static void
gimp_color_picker_tool_info_update (GimpTool *tool,
gboolean valid)
gboolean valid)
{
if (!valid)
{
......@@ -881,7 +877,7 @@ gimp_color_picker_tool_info_update (GimpTool *tool,
static void
gimp_color_picker_tool_info_window_close_callback (GtkWidget *widget,
gpointer client_data)
gpointer client_data)
{
info_dialog_popdown ((InfoDialog *) client_data);
}
......@@ -111,17 +111,19 @@ static GimpUnit non_gui_gradient_unit;
static GimpPaintToolClass *parent_class;
/* forward function declarations */
static void gimp_paintbrush_tool_motion (GimpPaintTool *,
GimpDrawable *,
PaintPressureOptions *,
gdouble ,
gdouble ,
PaintApplicationMode ,
GradientPaintMode );
static void gimp_paintbrush_tool_paint_func (GimpPaintTool *paint_core,
GimpDrawable *drawable,
PaintState state);
static void gimp_paintbrush_tool_class_init (GimpPaintToolClass *klass);
static void gimp_paintbrush_tool_motion (GimpPaintTool *,
GimpDrawable *,
PaintPressureOptions *,
gdouble ,
gdouble ,
PaintApplicationMode ,
GradientPaintMode );
static void gimp_paintbrush_tool_paint (GimpPaintTool *paint_core,
GimpDrawable *drawable,
PaintState state);
static void gimp_paintbrush_tool_class_init (GimpPaintbrushToolClass *klass);
static void gimp_paintbrush_tool_init (GimpPaintbrushTool *tool);
/* functions */
......@@ -138,7 +140,7 @@ gimp_paintbrush_tool_get_type (void)
sizeof (GimpPaintbrushTool),
sizeof (GimpPaintbrushToolClass),
(GtkClassInitFunc) gimp_paintbrush_tool_class_init,
(GtkObjectInitFunc) NULL /*gimp_paintbrush_tool_initialize*/,
(GtkObjectInitFunc) gimp_paintbrush_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
NULL
......@@ -153,7 +155,7 @@ gimp_paintbrush_tool_get_type (void)
static void
gimp_paintbrush_tool_gradient_toggle_callback (GtkWidget *widget,
gpointer data)
gpointer data)
{
PaintbrushOptions *options = paintbrush_options;
......@@ -391,9 +393,9 @@ gimp_paintbrush_tool_options_new (void)
#define TIMED_BRUSH 0
static void
gimp_paintbrush_tool_paint_func (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state)
gimp_paintbrush_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state)
{
GDisplay *gdisp = gdisplay_active ();
double fade_out;
......@@ -448,11 +450,11 @@ gimp_paintbrush_tool_paint_func (GimpPaintTool *paint_tool,
}
gimp_paintbrush_tool_motion (paint_tool, drawable,
paintbrush_options->paint_options.pressure_options,
paintbrush_options->use_fade ? fade_out : 0,
paintbrush_options->use_gradient ? gradient_length : 0,
paintbrush_options->paint_options.incremental,
paintbrush_options->gradient_type);
paintbrush_options->paint_options.pressure_options,
paintbrush_options->use_fade ? fade_out : 0,
paintbrush_options->use_gradient ? gradient_length : 0,
paintbrush_options->paint_options.incremental,
paintbrush_options->gradient_type);
break;
case FINISH_PAINT :
......@@ -479,19 +481,39 @@ gimp_paintbrush_tool_new (void)
return gtk_type_new (GIMP_TYPE_PAINTBRUSH_TOOL);
}
void
gimp_paintbrush_tool_initialize (GimpPaintTool *tool)
static void
gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
{
tool->pick_colors = TRUE;
tool->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
GimpTool *tool;
GimpPaintTool *paint_tool;
tool = GIMP_TOOL (paintbrush);
paint_tool = GIMP_PAINT_TOOL (paintbrush);
if (! paintbrush_options)
{
paintbrush_options = gimp_paintbrush_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_PAINTBRUSH_TOOL,
(ToolOptions *) paintbrush_options);
}
tool->tool_cursor = GIMP_PAINTBRUSH_TOOL_CURSOR;
paint_tool->pick_colors = TRUE;
paint_tool->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
}
void
gimp_paintbrush_tool_class_init (GimpPaintToolClass *klass)
static void
gimp_paintbrush_tool_class_init (GimpPaintbrushToolClass *klass)
{
GimpPaintToolClass *paint_tool_class;
paint_tool_class = (GimpPaintToolClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_PAINT_TOOL);
klass->paint_func = gimp_paintbrush_tool_paint_func;
paint_tool_class->paint = gimp_paintbrush_tool_paint;
}
void
......@@ -507,27 +529,26 @@ gimp_paintbrush_tool_register (void)
}
static void
gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintPressureOptions *pressure_options,
double fade_out,
double gradient_length,
PaintApplicationMode incremental,
GradientPaintMode gradient_type)
gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintPressureOptions *pressure_options,
double fade_out,
double gradient_length,
PaintApplicationMode incremental,
GradientPaintMode gradient_type)
{
GImage *gimage;
TempBuf *area;
gdouble x, paint_left;
gdouble position;
guchar local_blend = OPAQUE_OPACITY;
guchar temp_blend = OPAQUE_OPACITY;
guchar col[MAX_CHANNELS];
GimpRGB color;
gint mode;
gint opacity;
gdouble scale;
GimpImage *gimage;
TempBuf *area;
gdouble x, paint_left;
gdouble position;
guchar local_blend = OPAQUE_OPACITY;
guchar temp_blend = OPAQUE_OPACITY;
guchar col[MAX_CHANNELS];
GimpRGB color;
gint mode;
gint opacity;
gdouble scale;
PaintApplicationMode paint_appl_mode = incremental ? INCREMENTAL : CONSTANT;
position = 0.0;
......@@ -568,7 +589,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
paint_tool->curpressure, &color);
else
gimp_paint_tool_get_color_from_gradient (paint_tool, gradient_length,
&color, mode);
&color, mode);
temp_blend = (gint) ((color.a * local_blend));
......@@ -589,8 +610,8 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
else if (paint_tool->brush && paint_tool->brush->pixmap)
{
gimp_paint_tool_color_area_with_pixmap (paint_tool, gimage, drawable,
area,
scale, SOFT);
area,
scale, SOFT);
paint_appl_mode = INCREMENTAL;
}
else
......@@ -606,19 +627,22 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
opacity = opacity * 2.0 * paint_tool->curpressure;
gimp_paint_tool_paste_canvas (paint_tool, drawable,
MIN (opacity, 255),
gimp_context_get_opacity (NULL) * 255,
gimp_context_get_paint_mode (NULL),
pressure_options->pressure ? PRESSURE : SOFT,
scale, paint_appl_mode);
MIN (opacity, 255),
gimp_context_get_opacity (NULL) * 255,
gimp_context_get_paint_mode (NULL),
pressure_options->pressure ? PRESSURE : SOFT,
scale, paint_appl_mode);
}
}
#warning (FIX non-gui paint tools)
#if 0
static gpointer
gimp_paintbrush_tool_non_gui_paint_func (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state)
gimp_paintbrush_tool_non_gui_paint_func (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state)
{
GImage *gimage;
gdouble fade_out;
......@@ -661,19 +685,19 @@ gimp_paintbrush_tool_non_gui_paint_func (GimpPaintTool *paint_tool,
}
gimp_paintbrush_tool_motion (paint_tool,drawable,
&non_gui_pressure_options,
fade_out,
gradient_length,
non_gui_incremental,
non_gui_gradient_type);
&non_gui_pressure_options,
fade_out,
gradient_length,
non_gui_incremental,
non_gui_gradient_type);
return NULL;
}
gboolean
gimp_paintbrush_tool_non_gui_default (GimpDrawable *drawable,
int num_strokes,
double *stroke_array)
gint num_strokes,
double *stroke_array)
{
PaintbrushOptions *options = paintbrush_options;
gdouble fade_out = PAINTBRUSH_DEFAULT_FADE_OUT;
......@@ -708,7 +732,7 @@ gimp_paintbrush_tool_non_gui_default (GimpDrawable *drawable,
* thats why the code below is duplicated.
*/
if (gimp_paint_tool_start (&non_gui_paint_tool, drawable,
stroke_array[0], stroke_array[1]))
stroke_array[0], stroke_array[1]))
{
non_gui_fade_out = fade_out;
non_gui_gradient_length = gradient_length;
......@@ -718,7 +742,7 @@ gimp_paintbrush_tool_non_gui_default (GimpDrawable *drawable,
non_gui_gradient_unit = gradient_unit;
/* Set the paint core's paint func */
non_gui_paint_tool_class->paint_func =(PaintFunc) gimp_paintbrush_tool_non_gui_paint_func;
non_gui_paint_tool_class->paint = gimp_paintbrush_tool_non_gui_paint_func;
non_gui_paint_tool->startx = non_gui_paint_tool->lastx = stroke_array[0];
non_gui_paint_tool->starty = non_gui_paint_tool->lasty = stroke_array[1];
......@@ -751,17 +775,17 @@ gimp_paintbrush_tool_non_gui_default (GimpDrawable *drawable,
gboolean
gimp_paintbrush_tool_non_gui (GimpDrawable *drawable,
int num_strokes,
double *stroke_array,
double fade_out,
int method,
double gradient_length)
gint num_strokes,
gdouble *stroke_array,
gdouble fade_out,
gint method,
gdouble gradient_length)
{
int i;
gint i;
/* Code duplicated above */
if (gimp_paint_tool_start (&non_gui_paint_tool, drawable,
stroke_array[0], stroke_array[1]))
stroke_array[0], stroke_array[1]))
{
non_gui_fade_out = fade_out;
non_gui_gradient_length = gradient_length;
......@@ -769,7 +793,7 @@ gimp_paintbrush_tool_non_gui (GimpDrawable *drawable,
non_gui_incremental = method;
/* Set the paint core's paint func */
non_gui_paint_tool_class->paint_func = gimp_paintbrush_tool_non_gui_paint_func;
non_gui_paint_tool_class->paint = gimp_paintbrush_tool_non_gui_paint_func;
non_gui_paint_tool->startx = non_gui_paint_tool->lastx = stroke_array[0];
non_gui_paint_tool->starty = non_gui_paint_tool->lasty = stroke_array[1];
......@@ -800,3 +824,4 @@ gimp_paintbrush_tool_non_gui (GimpDrawable *drawable,
else
return FALSE;
}
#endif
......@@ -19,14 +19,20 @@
#ifndef __GIMP_PAINTBRUSH_TOOL_H__
#define __GIMP_PAINTBRUSH_TOOL_H__
#include "gimppainttool.h"
#define GIMP_TYPE_PAINTBRUSH_TOOL (gimp_paintbrush_tool_get_type ())
#define GIMP_PAINTBRUSH_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PAINTBRUSH_TOOL, GimpPaintbrushTool))
#define GIMP_IS_PAINTBRUSH_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PAINTBRUSH_TOOL))
#define GIMP_PAINTBRUSH_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINTBRUSH_TOOL, GimpPaintbrushToolClass))
#define GIMP_IS_PAINTBRUSH_TOOL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINTBRUSH_TOOL))
typedef struct _GimpPaintbrushTool GimpPaintbrushTool;
typedef struct _GimpPaintbrushToolClass GimpPaintbrushToolClass;
struct _GimpPaintbrushTool
{
GimpPaintTool parent_instance;
......@@ -37,25 +43,25 @@ struct _GimpPaintbrushToolClass
GimpPaintToolClass parent_class;
};
typedef struct _GimpPaintbrushTool GimpPaintbrushTool;
typedef struct _GimpPaintbrushToolClass GimpPaintbrushToolClass;
/* FIXME: this antique code doesn't follow the coding style */
void gimp_paintbrush_tool_register (void);
GtkType gimp_paintbrush_tool_get_type (void);
GimpTool * gimp_paintbrush_tool_new (void);
gboolean gimp_paintbrush_tool_non_gui (GimpDrawable *,
gint ,
gdouble *,
gdouble ,
gint ,
gdouble );
gboolean gimp_paintbrush_tool_non_gui_default (GimpDrawable *,
gint ,
gdouble *);
void gimp_paintbrush_tool_register (void);
GimpTool * gimp_paintbrush_tool_new (void);
/* FIXME: this antique code doesn't follow the coding style */
gboolean gimp_paintbrush_tool_non_gui (GimpDrawable *,
gint ,
gdouble *,
gdouble ,
gint ,
gdouble );
gboolean gimp_paintbrush_tool_non_gui_default (GimpDrawable *,
gint ,
gdouble *);
GtkType gimp_paintbrush_tool_get_type (void);
#endif /* __GIMP_PAINTBRUSH_TOOL_H__ */
This diff is collapsed.
......@@ -19,15 +19,9 @@
#ifndef __GIMP_PAINT_TOOL_H__
#define __GIMP_PAINT_TOOL_H__
#include "tools/gimpdrawtool.h"
#define GIMP_TYPE_PAINT_TOOL (gimp_paint_tool_get_type ())
#define GIMP_PAINT_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PAINT_TOOL, GimpPaintTool))
#define GIMP_IS_PAINT_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PAINT_TOOL))
#define GIMP_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINT_TOOL, GimpPaintToolClass))
#define GIMP_IS_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINT_TOOL))
#include "tools/gimpdrawtool.h"
GtkType gimp_paint_tool_get_type (void);
/* the different states that the painting function can be called with */
......@@ -56,9 +50,15 @@ typedef enum /*< skip >*/
*/
} ToolFlags;
typedef void (* PaintFunc) (GimpPaintTool *tool,
GimpDrawable *drawable,
PaintState paint_state);
#define GIMP_TYPE_PAINT_TOOL (gimp_paint_tool_get_type ())
#define GIMP_PAINT_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PAINT_TOOL, GimpPaintTool))
#define GIMP_IS_PAINT_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PAINT_TOOL))
#define GIMP_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINT_TOOL, GimpPaintToolClass))
#define GIMP_IS_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINT_TOOL))
typedef struct _GimpPaintToolClass GimpPaintToolClass;
struct _GimpPaintTool
{
......@@ -113,15 +113,11 @@ struct _GimpPaintToolClass
{
GimpDrawToolClass parent_class;
PaintFunc paint_func; /* painting function */
void (* paint) (GimpPaintTool *tool,
GimpDrawable *drawable,
PaintState paint_state);
};
typedef struct _GimpPaintToolClass GimpPaintToolClass;
/* this should change */
extern GimpPaintTool *non_gui_paint_tool;
extern GimpPaintToolClass *non_gui_paint_tool_class;
/* Special undo type */
typedef struct _PaintUndo PaintUndo;
......@@ -141,47 +137,29 @@ struct _PaintUndo
#endif /* GTK_HAVE_SIX_VALUATORS */
};
/* paint tool action functions */
void gimp_paint_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
void gimp_paint_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
void gimp_paint_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
void gimp_paint_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
void gimp_paint_tool_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp);
void gimp_paint_tool_paint (GimpPaintTool *tool,
GimpDrawable *drawable,
PaintState state);
/* paint tool functions */
void gimp_paint_tool_no_draw (GimpPaintTool *tool);
GimpPaintTool *gimp_paint_tool_new (void);
void gimp_paint_tool_destroy (GimpTool *tool);
int gimp_paint_tool_start (GimpPaintTool *tool,
GimpDrawable *drawable,
gdouble x,
gdouble y);
GtkType gimp_paint_tool_get_type (void);
void gimp_paint_tool_paint (GimpPaintTool *tool,
GimpDrawable *drawable,
PaintState state);
void gimp_paint_tool_no_draw (GimpPaintTool *tool);
int gimp_paint_tool_start (GimpPaintTool *tool,
GimpDrawable *drawable,
gdouble x,
gdouble y);
void gimp_paint_tool_interpolate (GimpPaintTool *tool,
GimpDrawable *drawable);
GimpDrawable *drawable);
void gimp_paint_tool_finish (GimpPaintTool *tool,
GimpDrawable *drawable);
GimpDrawable *drawable);
void gimp_paint_tool_cleanup (void);
void gimp_paint_tool_get_color_from_gradient (GimpPaintTool *tool,
gdouble gradient_length,
GimpRGB *color,
GradientPaintMode mode);
gdouble gradient_length,
GimpRGB *color,
GradientPaintMode mode);
/* paint tool painting functions */
TempBuf * gimp_paint_tool_get_paint_area (GimpPaintTool *tool,
......@@ -194,26 +172,26 @@ TempBuf * gimp_paint_tool_get_orig_image (GimpPaintTool *tool,
gint x2,
gint y2);
void gimp_paint_tool_paste_canvas (GimpPaintTool *tool,
GimpDrawable *drawable,
gint brush_opacity,
gint image_opacity,
LayerModeEffects paint_mode,
BrushApplicationMode brush_hardness,
gdouble brush_scale,
PaintApplicationMode mode);
GimpDrawable *drawable,
gint brush_opacity,
gint image_opacity,
LayerModeEffects paint_mode,
BrushApplicationMode brush_hardness,
gdouble brush_scale,
PaintApplicationMode mode);
void gimp_paint_tool_replace_canvas (GimpPaintTool *tool,
GimpDrawable *drawable,
gint brush_opacity,
gint image_opacity,
BrushApplicationMode brush_hardness,
gdouble brush_scale,
PaintApplicationMode mode);
GimpDrawable *drawable,
gint brush_opacity,
gint image_opacity,
BrushApplicationMode brush_hardness,
gdouble brush_scale,
PaintApplicationMode mode);
void gimp_paint_tool_color_area_with_pixmap (GimpPaintTool *tool,
GimpImage *dest,
GimpDrawable *drawable,
TempBuf *area,
gdouble scale,
BrushApplicationMode mode);
GimpImage *dest,
GimpDrawable *drawable,
TempBuf *area,
gdouble scale,
BrushApplicationMode mode);
#endif /* __GIMP_PAINT_TOOL_H__ */
......@@ -62,8 +62,8 @@ libapptools_la_SOURCES = \
## levels.h \
## magnify.c \
## magnify.h \
## measure.c \
## measure.h \
measure.c \
measure.h \
move.c \
move.h \
gimppaintbrushtool.c \
......
This diff is collapsed.
......@@ -19,15 +19,9 @@
#ifndef __GIMP_PAINT_TOOL_H__
#define __GIMP_PAINT_TOOL_H__
#include "tools/gimpdrawtool.h"
#define GIMP_TYPE_PAINT_TOOL (gimp_paint_tool_get_type ())
#define GIMP_PAINT_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PAINT_TOOL, GimpPaintTool))
#define GIMP_IS_PAINT_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PAINT_TOOL))
#define GIMP_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINT_TOOL, GimpPaintToolClass))
#define GIMP_IS_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINT_TOOL))
#include "tools/gimpdrawtool.h"
GtkType gimp_paint_tool_get_type (void);
/* the different states that the painting function can be called with */
......@@ -56,9 +50,15 @@ typedef enum /*< skip >*/
*/
} ToolFlags;
typedef void (* PaintFunc) (GimpPaintTool *tool,
GimpDrawable *drawable,
PaintState paint_state);
#define GIMP_TYPE_PAINT_TOOL (gimp_paint_tool_get_type ())
#define GIMP_PAINT_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PAINT_TOOL, GimpPaintTool))
#define GIMP_IS_PAINT_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PAINT_TOOL))
#define GIMP_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINT_TOOL, GimpPaintToolClass))
#define GIMP_IS_PAINT_TOOL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINT_TOOL))
typedef struct _GimpPaintToolClass GimpPaintToolClass;
struct _GimpPaintTool
{
......@@ -113,15 +113,11 @@ struct _GimpPaintToolClass
{
GimpDrawToolClass parent_class;
PaintFunc paint_func; /* painting function */
void (* paint) (GimpPaintTool *tool,
GimpDrawable *drawable,
PaintState paint_state);
};
typedef struct _GimpPaintToolClass GimpPaintToolClass;