~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to app/tools/gimppaintbrushtool.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an 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/gimppaintoptions.h"
 
28
 
 
29
#include "widgets/gimphelp-ids.h"
 
30
 
 
31
#include "gimppaintbrushtool.h"
 
32
#include "gimppaintoptions-gui.h"
 
33
#include "gimptoolcontrol.h"
 
34
 
 
35
#include "gimp-intl.h"
 
36
 
 
37
 
 
38
static void   gimp_paintbrush_tool_init (GimpPaintbrushTool *tool);
 
39
 
 
40
 
 
41
void
 
42
gimp_paintbrush_tool_register (GimpToolRegisterCallback  callback,
 
43
                               gpointer                  data)
 
44
{
 
45
  (* callback) (GIMP_TYPE_PAINTBRUSH_TOOL,
 
46
                GIMP_TYPE_PAINT_OPTIONS,
 
47
                gimp_paint_options_gui,
 
48
                GIMP_PAINT_OPTIONS_CONTEXT_MASK |
 
49
                GIMP_CONTEXT_GRADIENT_MASK,
 
50
                "gimp-paintbrush-tool",
 
51
                _("Paintbrush"),
 
52
                _("Paint fuzzy brush strokes"),
 
53
                N_("_Paintbrush"), "P",
 
54
                NULL, GIMP_HELP_TOOL_PAINTBRUSH,
 
55
                GIMP_STOCK_TOOL_PAINTBRUSH,
 
56
                data);
 
57
}
 
58
 
 
59
GType
 
60
gimp_paintbrush_tool_get_type (void)
 
61
{
 
62
  static GType tool_type = 0;
 
63
 
 
64
  if (! tool_type)
 
65
    {
 
66
      static const GTypeInfo tool_info =
 
67
      {
 
68
        sizeof (GimpPaintbrushToolClass),
 
69
        (GBaseInitFunc) NULL,
 
70
        (GBaseFinalizeFunc) NULL,
 
71
        NULL,           /* class_init     */
 
72
        NULL,           /* class_finalize */
 
73
        NULL,           /* class_data     */
 
74
        sizeof (GimpPaintbrushTool),
 
75
        0,              /* n_preallocs    */
 
76
        (GInstanceInitFunc) gimp_paintbrush_tool_init,
 
77
      };
 
78
 
 
79
      tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
 
80
                                          "GimpPaintbrushTool",
 
81
                                          &tool_info, 0);
 
82
    }
 
83
 
 
84
  return tool_type;
 
85
}
 
86
 
 
87
static void
 
88
gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
 
89
{
 
90
  GimpTool *tool = GIMP_TOOL (paintbrush);
 
91
 
 
92
  gimp_tool_control_set_tool_cursor (tool->control,
 
93
                                     GIMP_TOOL_CURSOR_PAINTBRUSH);
 
94
 
 
95
  gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (paintbrush),
 
96
                                       GIMP_COLOR_PICK_MODE_FOREGROUND);
 
97
}