Commit db526795 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

Merged the "soc-2006-healing-brush" branch. That branch is now officially

2006-09-02  Michael Natterer  <mitch@gimp.org>

	Merged the "soc-2006-healing-brush" branch. That branch is now
	officially closed and all further fixes and changes have to be
	applied to HEAD.

	Did some minor adjustments, mostly small indentation and spacing
	fixes. Derive the tool from the newly introduced GimpBrushTool
	which did not exist when the branch was created.

	Thanks a lot to Kevin Sookocheff for this nice contribution!

	* app/paint/paint-enums.[ch]: new enum GimpHealAlignMode.

	* app/paint/Makefile.am
	* app/paint/makefile.msc
	* app/paint/gimpheal.[ch]
	* app/paint/gimphealoptions.[ch]: the heal core and its options.

	* app/paint/gimp-paint.c: register the heal core.

	* app/tools/Makefile.am
	* app/tools/makefile.msc
	* app/tools/gimphealtool.[ch]: the heal tool.

	* app/tools/gimp-tools.c: register the heal tool.

	* app/tools/gimppaintoptions-gui.c: show the widgets that are used
	by heal.

	* app/widgets/gimphelp-ids.h: the heal help ID.

	* tools/pdbgen/stddefs.pdb
	* tools/pdbgen/pdb/paint_tools.pdb: the heal PDB wrappers.

	* app/widgets/widgets-enums.h
	* app/widgets/gimpcursor.c
	* cursors/Makefile.am
	* cursors/makefile.msc
	* cursors/tool-heal.png
	* cursors/xbm/tool-heal.xbm
	* cursors/xbm/tool-heal-mask.xbm: a new cursor for the heal tool.

	* libgimpwidgets/gimpstock.[ch]
	* themes/Default/images/Makefile.am
	* themes/Default/images/makefile.msc
	* themes/Default/images/tools/stock-tool-heal-16.png
	* themes/Default/images/tools/stock-tool-heal-22.png: new stock
	icons for the heal tool.

	* app/pdb/internal_procs.c
	* app/pdb/paint_tools_cmds.c
	* libgimp/gimppainttools_pdb.[ch]: regenerated.
parent a3217d46
2006-09-02 Michael Natterer <mitch@gimp.org>
Merged the "soc-2006-healing-brush" branch. That branch is now
officially closed and all further fixes and changes have to be
applied to HEAD.
Did some minor adjustments, mostly small indentation and spacing
fixes. Derive the tool from the newly introduced GimpBrushTool
which did not exist when the branch was created.
Thanks a lot to Kevin Sookocheff for this nice contribution!
* app/paint/paint-enums.[ch]: new enum GimpHealAlignMode.
* app/paint/Makefile.am
* app/paint/makefile.msc
* app/paint/gimpheal.[ch]
* app/paint/gimphealoptions.[ch]: the heal core and its options.
* app/paint/gimp-paint.c: register the heal core.
* app/tools/Makefile.am
* app/tools/makefile.msc
* app/tools/gimphealtool.[ch]: the heal tool.
* app/tools/gimp-tools.c: register the heal tool.
* app/tools/gimppaintoptions-gui.c: show the widgets that are used
by heal.
* app/widgets/gimphelp-ids.h: the heal help ID.
* tools/pdbgen/stddefs.pdb
* tools/pdbgen/pdb/paint_tools.pdb: the heal PDB wrappers.
* app/widgets/widgets-enums.h
* app/widgets/gimpcursor.c
* cursors/Makefile.am
* cursors/makefile.msc
* cursors/tool-heal.png
* cursors/xbm/tool-heal.xbm
* cursors/xbm/tool-heal-mask.xbm: a new cursor for the heal tool.
* libgimpwidgets/gimpstock.[ch]
* themes/Default/images/Makefile.am
* themes/Default/images/makefile.msc
* themes/Default/images/tools/stock-tool-heal-16.png
* themes/Default/images/tools/stock-tool-heal-22.png: new stock
icons for the heal tool.
* app/pdb/internal_procs.c
* app/pdb/paint_tools_cmds.c
* libgimp/gimppainttools_pdb.[ch]: regenerated.
2006-09-02 Michael Natterer <mitch@gimp.org>
* app/paint/gimpclone.c
......
......@@ -42,6 +42,10 @@ libapppaint_a_sources = \
gimperaser.h \
gimperaseroptions.c \
gimperaseroptions.h \
gimpheal.c \
gimpheal.h \
gimphealoptions.c \
gimphealoptions.h \
gimpink.c \
gimpink.h \
gimpink-blob.c \
......
......@@ -32,6 +32,7 @@
#include "gimpconvolve.h"
#include "gimpdodgeburn.h"
#include "gimperaser.h"
#include "gimpheal.h"
#include "gimpink.h"
#include "gimppaintoptions.h"
#include "gimppaintbrush.h"
......@@ -60,6 +61,7 @@ gimp_paint_init (Gimp *gimp)
gimp_smudge_register,
gimp_convolve_register,
gimp_clone_register,
gimp_heal_register,
gimp_ink_register,
gimp_airbrush_register,
gimp_eraser_register,
......
This diff is collapsed.
......@@ -19,8 +19,10 @@
#ifndef __GIMP_HEAL_H__
#define __GIMP_HEAL_H__
#include "gimpbrushcore.h"
#define GIMP_TYPE_HEAL (gimp_heal_get_type ())
#define GIMP_HEAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_HEAL, GimpHeal))
#define GIMP_HEAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_HEAL, GimpHealClass))
......@@ -28,30 +30,31 @@
#define GIMP_IS_HEAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_HEAL))
#define GIMP_HEAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_HEAL, GimpHealClass))
typedef struct _GimpHeal GimpHeal;
typedef struct _GimpHealClass GimpHealClass;
struct _GimpHeal
{
GimpBrushCore parent_instance;
GimpBrushCore parent_instance;
gboolean set_source;
gboolean set_source;
GimpDrawable *src_drawable;
gdouble src_x;
gdouble src_y;
GimpDrawable *src_drawable;
gdouble src_x;
gdouble src_y;
gdouble orig_src_x;
gdouble orig_src_y;
gdouble orig_src_x;
gdouble orig_src_y;
gdouble offset_x;
gdouble offset_y;
gboolean first_stroke;
gdouble offset_x;
gdouble offset_y;
gboolean first_stroke;
};
struct _GimpHealClass
{
GimpBrushCoreClass parent_class;
GimpBrushCoreClass parent_class;
};
......
......@@ -23,8 +23,10 @@
#include "libgimpconfig/gimpconfig.h"
#include "paint-types.h"
#include "gimphealoptions.h"
enum
{
PROP_0,
......@@ -32,6 +34,7 @@ enum
PROP_SAMPLE_MERGED
};
static void gimp_heal_options_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -41,8 +44,10 @@ static void gimp_heal_options_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (GimpHealOptions, gimp_heal_options, GIMP_TYPE_PAINT_OPTIONS)
static void
gimp_heal_options_class_init (GimpHealOptionsClass *klass)
{
......@@ -61,7 +66,6 @@ gimp_heal_options_class_init (GimpHealOptionsClass *klass)
"sample-merged", NULL,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
}
static void
......
......@@ -31,8 +31,8 @@
#define GIMP_HEAL_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_HEAL_OPTIONS, GimpHealOptionsClass))
typedef struct _GimpHealOptions GimpHealOptions;
typedef struct _GimpPaintOptionsClass GimpHealOptionsClass;
typedef struct _GimpHealOptions GimpHealOptions;
typedef struct _GimpPaintOptionsClass GimpHealOptionsClass;
struct _GimpHealOptions
{
......@@ -41,8 +41,9 @@ struct _GimpHealOptions
GimpHealAlignMode align_mode;
gboolean sample_merged;
};
GType gimp_heal_options_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_HEAL_OPTIONS_H__ */
......@@ -42,6 +42,8 @@ OBJECTS = \
gimpink-blob.obj \
gimpink-undo.obj \
gimpinkoptions.obj \
gimpheal.obj \
gimphealoptions.obj \
gimppaintbrush.obj \
gimppaintcore.obj \
gimppaintcore-stroke.obj \
......
......@@ -126,6 +126,36 @@ gimp_ink_blob_type_get_type (void)
return type;
}
GType
gimp_heal_align_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_HEAL_ALIGN_NO, "GIMP_HEAL_ALIGN_NO", "no" },
{ GIMP_HEAL_ALIGN_YES, "GIMP_HEAL_ALIGN_YES", "yes" },
{ GIMP_HEAL_ALIGN_FIXED, "GIMP_HEAL_ALIGN_FIXED", "fixed" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_HEAL_ALIGN_NO, N_("None"), NULL },
{ GIMP_HEAL_ALIGN_YES, N_("Aligned"), NULL },
{ GIMP_HEAL_ALIGN_FIXED, N_("Fixed"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
{
type = g_enum_register_static ("GimpHealAlignMode", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */
......@@ -84,6 +84,18 @@ typedef enum /*< pdb-skip >*/
} GimpInkBlobType;
#define GIMP_TYPE_HEAL_ALIGN_MODE (gimp_heal_align_mode_get_type ())
GType gimp_heal_align_mode_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_HEAL_ALIGN_NO, /*< desc="None" >*/
GIMP_HEAL_ALIGN_YES, /*< desc="Aligned" >*/
GIMP_HEAL_ALIGN_FIXED /*< desc="Fixed" >*/
} GimpHealAlignMode;
/*
* non-registered enums; register them if needed
*/
......
......@@ -75,7 +75,7 @@ void register_undo_procs (GimpPDB *pdb);
void register_unit_procs (GimpPDB *pdb);
void register_vectors_procs (GimpPDB *pdb);
/* 530 procedures registered total */
/* 532 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -494,6 +494,86 @@ eraser_default_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GValueArray *
heal_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
GimpDrawable *src_drawable;
gdouble src_x;
gdouble src_y;
gint32 num_strokes;
const gdouble *strokes;
drawable = gimp_value_get_drawable (&args->values[0], gimp);
src_drawable = gimp_value_get_drawable (&args->values[1], gimp);
src_x = g_value_get_double (&args->values[2]);
src_y = g_value_get_double (&args->values[3]);
num_strokes = g_value_get_int (&args->values[4]);
strokes = gimp_value_get_floatarray (&args->values[5]);
if (success)
{
GimpPaintInfo *info = (GimpPaintInfo *)
gimp_container_get_child_by_name (gimp->paint_info_list, "gimp-heal");
success = (info && gimp_item_is_attached (GIMP_ITEM (drawable)));
if (success)
{
GimpPaintOptions *options = gimp_paint_options_new (info);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes,
"src-drawable", src_drawable,
"src-x", src_x,
"src-y", src_y,
NULL);
}
}
return gimp_procedure_get_return_values (procedure, success);
}
static GValueArray *
heal_default_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 num_strokes;
const gdouble *strokes;
drawable = gimp_value_get_drawable (&args->values[0], gimp);
num_strokes = g_value_get_int (&args->values[1]);
strokes = gimp_value_get_floatarray (&args->values[2]);
if (success)
{
GimpPaintInfo *info = (GimpPaintInfo *)
gimp_container_get_child_by_name (gimp->paint_info_list, "gimp-heal");
success = (info && gimp_item_is_attached (GIMP_ITEM (drawable)));
if (success)
{
GimpPaintOptions *options = gimp_paint_options_new (info);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, NULL);
}
}
return gimp_procedure_get_return_values (procedure, success);
}
static GValueArray *
paintbrush_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -1102,6 +1182,90 @@ register_paint_tools_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-heal
*/
procedure = gimp_procedure_new (heal_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-heal");
gimp_procedure_set_static_strings (procedure,
"gimp-heal",
"Heal from the source to the dest drawable using the current brush",
"This tool heals the source drawable starting at the specified source coordinates to the dest drawable. For image healing, if the sum of the src coordinates and subsequent stroke offsets exceeds the extents of the src drawable, then no paint is transferred. The healing tool is capable of transforming between any image types except RGB->Indexed.",
"Kevin Sookocheff",
"Kevin Sookocheff",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("src-drawable",
"src drawable",
"The source drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("src-x",
"src x",
"The x coordinate in the source image",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("src-y",
"src y",
"The y coordinate in the source image",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-strokes",
"num strokes",
"Number of stroke control points (count each coordinate as 2 points)",
2, G_MAXINT32, 2,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_float_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-heal-default
*/
procedure = gimp_procedure_new (heal_default_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-heal-default");
gimp_procedure_set_static_strings (procedure,
"gimp-heal-default",
"Heal from the source to the dest drawable using the current brush",
"This tool heals from the source drawable starting at the specified source coordinates to the dest drawable. This function performs exactly the same as the 'gimp-heal' function except that the tools arguments are obtained from the healing option dialog. It this dialog has not been activated then the dialogs default values will be used.",
"Kevin Sookocheff",
"Kevin Sookocheff",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-strokes",
"num strokes",
"Number of stroke control points (count each coordinate as 2 points)",
2, G_MAXINT32, 2,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_float_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-paintbrush
*/
......
......@@ -78,6 +78,8 @@ libapptools_a_sources = \
gimpforegroundselecttool-undo.h \
gimpfuzzyselecttool.c \
gimpfuzzyselecttool.h \
gimphealtool.c \
gimphealtool.h \
gimphistogramoptions.c \
gimphistogramoptions.h \
gimphuesaturationtool.c \
......
......@@ -63,6 +63,7 @@
#include "gimpfreeselecttool.h"
#include "gimpforegroundselecttool.h"
#include "gimpfuzzyselecttool.h"
#include "gimphealtool.h"
#include "gimphuesaturationtool.h"
#include "gimpinktool.h"
#include "gimpiscissorstool.h"
......@@ -132,6 +133,7 @@ gimp_tools_init (Gimp *gimp)
gimp_dodge_burn_tool_register,
gimp_smudge_tool_register,
gimp_convolve_tool_register,
gimp_heal_tool_register,
gimp_clone_tool_register,
gimp_ink_tool_register,
gimp_airbrush_tool_register,
......@@ -512,6 +514,10 @@ gimp_tools_register (GType tool_type,
{
paint_core_name = "gimp-clone";
}
else if (tool_type == GIMP_TYPE_HEAL_TOOL)
{
paint_core_name = "gimp-heal";
}
else if (tool_type == GIMP_TYPE_CONVOLVE_TOOL)
{
paint_core_name = "gimp-convolve";
......
......@@ -24,13 +24,13 @@
#include "tools-types.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimppickable.h"
#include "core/gimptoolinfo.h"
#include "paint/gimpheal.h"
#include "paint/gimphealoptions.h"
#include "paint/gimphealoptions.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewablebox.h"
......@@ -41,15 +41,17 @@
#include "gimphealtool.h"
#include "gimppaintoptions-gui.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
static gboolean gimp_heal_tool_has_display (GimpTool *tool,
GimpDisplay *display);
static GimpDisplay *gimp_heal_tool_has_image (GimpTool *tool,
static GimpDisplay * gimp_heal_tool_has_image (GimpTool *tool,
GimpImage *image);
static void gimp_heal_tool_button_press (GimpTool *tool,
......@@ -79,39 +81,39 @@ static void gimp_heal_tool_oper_update (GimpTool *tool,
gboolean proximity,
GimpDisplay *display);
static void gimp_heal_tool_draw (GimpDrawTool *draw_tool);
static void gimp_heal_tool_draw (GimpDrawTool *draw_tool);
static GtkWidget * gimp_heal_options_gui (GimpToolOptions *tool_options);
static GtkWidget *gimp_heal_options_gui (GimpToolOptions *tool_options);
G_DEFINE_TYPE (GimpHealTool, gimp_heal_tool, GIMP_TYPE_BRUSH_TOOL)
G_DEFINE_TYPE (GimpHealTool, gimp_heal_tool, GIMP_TYPE_PAINT_TOOL)
void
gimp_heal_tool_register (GimpToolRegisterCallback callback,
gpointer data)
{
(* callback) (GIMP_TYPE_HEAL_TOOL, /* tool type */
GIMP_TYPE_HEAL_OPTIONS, /* tool option type */
gimp_heal_options_gui, /* options gui */
GIMP_PAINT_OPTIONS_CONTEXT_MASK, /* context properties */
"gimp-heal-tool", /* identifier */
_("Heal"), /* blurb */
_("Heal image irregularities"), /* help */
N_("_Heal"), /* menu path */
"H", /* menu accelerator */
NULL, /* help domain */
GIMP_HELP_TOOL_HEAL, /* help data */
GIMP_STOCK_TOOL_HEAL, /* stock id */
data); /* register */
(* callback) (GIMP_TYPE_HEAL_TOOL,
GIMP_TYPE_HEAL_OPTIONS,
gimp_heal_options_gui,
GIMP_PAINT_OPTIONS_CONTEXT_MASK,
"gimp-heal-tool",
_("Heal"),
_("Heal image irregularities"),
N_("_Heal"),
"H",
NULL,
GIMP_HELP_TOOL_HEAL,
GIMP_STOCK_TOOL_HEAL,
data);
}
static void
gimp_heal_tool_class_init (GimpHealToolClass *klass)
{
/* get parent classes where we override methods */
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
/* override the methods */
tool_class->has_display = gimp_heal_tool_has_display;
tool_class->has_image = gimp_heal_tool_has_image;
tool_class->control = gimp_heal_tool_control;
......@@ -129,8 +131,7 @@ gimp_heal_tool_init (GimpHealTool *heal)
GimpTool *tool = GIMP_TOOL (heal);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_HEAL);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_HEAL);
paint_tool->status = _("Click to heal.");
paint_tool->status_ctrl = _("%s to set a new heal source");
......@@ -143,7 +144,8 @@ gimp_heal_tool_has_display (GimpTool *tool,
GimpHealTool *heal_tool = GIMP_HEAL_TOOL (tool);
return (display == heal_tool->src_display ||
GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->has_display (tool, display));
GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->has_display (tool,
display));
}
static GimpDisplay *
......@@ -153,7 +155,8 @@ gimp_heal_tool_has_image (GimpTool *tool,
GimpHealTool *heal_tool = GIMP_HEAL_TOOL (tool);
GimpDisplay *display;
display = GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->has_image (tool, image);
display = GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->has_image (tool,
image);
if (! display && heal_tool->src_display)
{
......@@ -200,9 +203,9 @@ gimp_heal_tool_button_press (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpHealTool *heal_tool = GIMP_HEAL_TOOL (tool);
GimpHeal *heal = GIMP_HEAL (paint_tool->core);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpHealTool *heal_tool = GIMP_HEAL_TOOL (tool);
GimpHeal *heal = GIMP_HEAL (paint_tool->core);
GimpHealOptions *options;
options = GIMP_HEAL_OPTIONS (tool->tool_info->tool_options);
......@@ -216,9 +219,9 @@ gimp_heal_tool_button_press (GimpTool *tool,
/* state holds a set of bit-flags to indicate the state of modifier keys and
* mouse buttons in various event types. Typical modifier keys are Shift,
* Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
* Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
* Part of gtk -> GdkModifierType */
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
/* we enter here only if CTRL is pressed */
{
/* mark that the source display has been set. defined in gimpheal.h */
......@@ -256,10 +259,10 @@ gimp_heal_tool_button_press (GimpTool *tool,
/* chain up to call the parents functions */
GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->button_press (tool, coords,
time, state,
time, state,
display);
/* set the tool display's source position to match the current heal
/* set the tool display's source position to match the current heal
* implementation source position */
heal_tool->src_x = heal->src_x;
heal_tool->src_y = heal->src_y;
......@@ -275,9 +278,9 @@ gimp_heal_tool_motion (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
GimpHealTool *heal_tool = GIMP_HEAL_TOOL (tool);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpHeal *heal = GIMP_HEAL (paint_tool->core);
GimpHealTool *heal_tool = GIMP_HEAL_TOOL (tool);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpHeal *heal = GIMP_HEAL (paint_tool->core);
/* pause drawing */
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
......@@ -309,9 +312,9 @@ gimp_heal_tool_cursor_update (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
GimpHealOptions *options;
GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
GimpHealOptions *options;
GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_HEAL_OPTIONS (tool->tool_info->tool_options);
......@@ -340,8 +343,7 @@ gimp_heal_tool_cursor_update (GimpTool *tool,
/* chain up to the parent class */
GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->cursor_update (tool, coords,
state, display);
state, display);
}
static void
......@@ -365,7 +367,7 @@ gimp_heal_tool_oper_update (GimpTool *tool,
/* chain up to the parent class */
GIMP_TOOL_CLASS (gimp_heal_tool_parent_class)->oper_update (tool, coords,
state, proximity,
state, proximity,
display);
if (proximity)
......@@ -461,16 +463,12 @@ gimp_heal_tool_draw (GimpDrawTool *draw_tool)
static GtkWidget *
gimp_heal_options_gui (GimpToolOptions *tool_options)
{
GObject *config;
GtkWidget *vbox;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *button;
GtkWidget *table;
GtkWidget *combo;
config = G_OBJECT (tool_options);
vbox = gimp_paint_options_gui (tool_options);
/* create and attach the sample merged checkbox */
button = gimp_prop_check_button_new (config, "sample-merged",
_("Sample merged"));
......
......@@ -19,7 +19,9 @@
#ifndef __GIMP_HEAL_TOOL_H__
#define __GIMP_HEAL_TOOL_H__
#include "gimppainttool.h"
#include "gimpbrushtool.h"
#define GIMP_TYPE_HEAL_TOOL (gimp_heal_tool_get_type ())
#define GIMP_HEAL_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_HEAL_TOOL, GimpHealTool))
......@@ -28,12 +30,14 @@
#define GIMP_IS_HEAL_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_HEAL_TOOL))
#define GIMP_HEAL_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_HEAL_TOOL, GimpHealToolClass))
typedef struct _GimpHealTool GimpHealTool;
typedef struct _GimpHealToolClass GimpHealToolClass;
struct _GimpHealTool
{
GimpPaintTool parent_instance;
GimpBrushTool parent_instance;
GimpDisplay *src_display; /* Detail about the source location to paint from */
gint src_x;
......@@ -42,13 +46,14 @@ struct _GimpHealTool
struct _GimpHealToolClass
{
GimpPaintToolClass parent_class;
GimpBrushToolClass parent_class;
};