1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 02:49:44 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2003-02-05 22:39:40 +08:00
|
|
|
#include "paint/gimppaintoptions.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
|
2001-03-08 09:07:03 +08:00
|
|
|
#include "gimppaintbrushtool.h"
|
2003-06-30 04:40:45 +08:00
|
|
|
#include "gimppaintoptions-gui.h"
|
2003-04-16 00:05:52 +08:00
|
|
|
#include "gimptoolcontrol.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
1999-07-20 06:42:49 +08:00
|
|
|
|
2003-08-31 00:41:35 +08:00
|
|
|
static void gimp_paintbrush_tool_init (GimpPaintbrushTool *tool);
|
2001-02-28 03:18:01 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
/* public functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-03-12 12:40:17 +08:00
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_paintbrush_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
2001-03-12 12:40:17 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_PAINTBRUSH_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_PAINT_OPTIONS,
|
|
|
|
gimp_paint_options_gui,
|
2003-06-30 04:40:45 +08:00
|
|
|
GIMP_PAINT_OPTIONS_CONTEXT_MASK |
|
2003-06-28 19:20:37 +08:00
|
|
|
GIMP_CONTEXT_GRADIENT_MASK,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-paintbrush-tool",
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Paintbrush"),
|
|
|
|
_("Paint fuzzy brush strokes"),
|
2003-07-02 00:22:03 +08:00
|
|
|
N_("/Tools/Paint Tools/_Paintbrush"), "P",
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_PAINTBRUSH,
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_PAINTBRUSH,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-03-12 12:40:17 +08:00
|
|
|
}
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
GType
|
2001-02-27 13:21:12 +08:00
|
|
|
gimp_paintbrush_tool_get_type (void)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static GType tool_type = 0;
|
2001-02-27 13:21:12 +08:00
|
|
|
|
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static const GTypeInfo tool_info =
|
2001-02-27 13:21:12 +08:00
|
|
|
{
|
|
|
|
sizeof (GimpPaintbrushToolClass),
|
2003-08-31 00:41:35 +08:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
NULL, /* class_init */
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpPaintbrushTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_paintbrush_tool_init,
|
2001-02-27 13:21:12 +08:00
|
|
|
};
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
|
2003-08-31 00:41:35 +08:00
|
|
|
"GimpPaintbrushTool",
|
2001-08-14 22:53:55 +08:00
|
|
|
&tool_info, 0);
|
2001-02-27 13:21:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2001-03-12 12:40:17 +08:00
|
|
|
static void
|
|
|
|
gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-10-26 03:00:49 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (paintbrush);
|
1999-09-09 09:47:54 +08:00
|
|
|
|
2003-06-05 23:43:49 +08:00
|
|
|
gimp_tool_control_set_tool_cursor (tool->control,
|
|
|
|
GIMP_PAINTBRUSH_TOOL_CURSOR);
|
2002-03-29 11:50:29 +08:00
|
|
|
|
2003-10-26 03:00:49 +08:00
|
|
|
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (paintbrush),
|
|
|
|
GIMP_COLOR_PICK_MODE_FOREGROUND);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|