1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
#include "libgimpwidgets/gimpwidgets.h"
25
#include "tools-types.h"
27
#include "paint/gimpsourceoptions.h"
29
#include "widgets/gimphelp-ids.h"
31
#include "gimphealtool.h"
32
#include "gimppaintoptions-gui.h"
33
#include "gimptoolcontrol.h"
35
#include "gimp-intl.h"
38
static GtkWidget * gimp_heal_options_gui (GimpToolOptions *tool_options);
41
G_DEFINE_TYPE (GimpHealTool, gimp_heal_tool, GIMP_TYPE_SOURCE_TOOL)
45
gimp_heal_tool_register (GimpToolRegisterCallback callback,
48
(* callback) (GIMP_TYPE_HEAL_TOOL,
49
GIMP_TYPE_SOURCE_OPTIONS,
50
gimp_heal_options_gui,
51
GIMP_PAINT_OPTIONS_CONTEXT_MASK,
54
_("Healing Tool: Heal image irregularities"),
64
gimp_heal_tool_class_init (GimpHealToolClass *klass)
69
gimp_heal_tool_init (GimpHealTool *heal)
71
GimpTool *tool = GIMP_TOOL (heal);
72
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
73
GimpSourceTool *source_tool = GIMP_SOURCE_TOOL (tool);
75
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_HEAL);
77
paint_tool->status = _("Click to heal");
78
paint_tool->status_ctrl = _("%s to set a new heal source");
80
source_tool->status_paint = _("Click to heal");
81
source_tool->status_set_source = _("Click to set a new heal source");
82
source_tool->status_set_source_ctrl = _("%s to set a new heal source");
86
/* tool options stuff */
89
gimp_heal_options_gui (GimpToolOptions *tool_options)
91
GObject *config = G_OBJECT (tool_options);
92
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
97
/* create and attach the sample merged checkbox */
98
button = gimp_prop_check_button_new (config, "sample-merged",
100
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
101
gtk_widget_show (button);
103
/* create and attach the alignment options to a table */
104
table = gtk_table_new (1, 2, FALSE);
105
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
106
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
107
gtk_widget_show (table);
109
combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0);
110
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
111
_("Alignment:"), 0.0, 0.5,