~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/tools/gimphealtool.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
#include "config.h"
 
20
 
 
21
#include <gtk/gtk.h>
 
22
 
 
23
#include "libgimpwidgets/gimpwidgets.h"
 
24
 
 
25
#include "tools-types.h"
 
26
 
 
27
#include "paint/gimpsourceoptions.h"
 
28
 
 
29
#include "widgets/gimphelp-ids.h"
 
30
 
 
31
#include "gimphealtool.h"
 
32
#include "gimppaintoptions-gui.h"
 
33
#include "gimptoolcontrol.h"
 
34
 
 
35
#include "gimp-intl.h"
 
36
 
 
37
 
 
38
static GtkWidget * gimp_heal_options_gui (GimpToolOptions *tool_options);
 
39
 
 
40
 
 
41
G_DEFINE_TYPE (GimpHealTool, gimp_heal_tool, GIMP_TYPE_SOURCE_TOOL)
 
42
 
 
43
 
 
44
void
 
45
gimp_heal_tool_register (GimpToolRegisterCallback  callback,
 
46
                         gpointer                  data)
 
47
{
 
48
  (* callback) (GIMP_TYPE_HEAL_TOOL,
 
49
                GIMP_TYPE_SOURCE_OPTIONS,
 
50
                gimp_heal_options_gui,
 
51
                GIMP_PAINT_OPTIONS_CONTEXT_MASK,
 
52
                "gimp-heal-tool",
 
53
                _("Heal"),
 
54
                _("Healing Tool: Heal image irregularities"),
 
55
                N_("_Heal"),
 
56
                "H",
 
57
                NULL,
 
58
                GIMP_HELP_TOOL_HEAL,
 
59
                GIMP_STOCK_TOOL_HEAL,
 
60
                data);
 
61
}
 
62
 
 
63
static void
 
64
gimp_heal_tool_class_init (GimpHealToolClass *klass)
 
65
{
 
66
}
 
67
 
 
68
static void
 
69
gimp_heal_tool_init (GimpHealTool *heal)
 
70
{
 
71
  GimpTool       *tool        = GIMP_TOOL (heal);
 
72
  GimpPaintTool  *paint_tool  = GIMP_PAINT_TOOL (tool);
 
73
  GimpSourceTool *source_tool = GIMP_SOURCE_TOOL (tool);
 
74
 
 
75
  gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_HEAL);
 
76
 
 
77
  paint_tool->status      = _("Click to heal");
 
78
  paint_tool->status_ctrl = _("%s to set a new heal source");
 
79
 
 
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");
 
83
}
 
84
 
 
85
 
 
86
/*  tool options stuff  */
 
87
 
 
88
static GtkWidget *
 
89
gimp_heal_options_gui (GimpToolOptions *tool_options)
 
90
{
 
91
  GObject   *config = G_OBJECT (tool_options);
 
92
  GtkWidget *vbox   = gimp_paint_options_gui (tool_options);
 
93
  GtkWidget *button;
 
94
  GtkWidget *table;
 
95
  GtkWidget *combo;
 
96
 
 
97
  /* create and attach the sample merged checkbox */
 
98
  button = gimp_prop_check_button_new (config, "sample-merged",
 
99
                                       _("Sample merged"));
 
100
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
 
101
  gtk_widget_show (button);
 
102
 
 
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);
 
108
 
 
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,
 
112
                             combo, 1, FALSE);
 
113
 
 
114
  return vbox;
 
115
}