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-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 20:21:50 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
2002-03-29 11:50:29 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2002-02-15 03:31:16 +08:00
|
|
|
#include "paint/gimpairbrush.h"
|
2003-02-05 22:39:40 +08:00
|
|
|
#include "paint/gimpairbrushoptions.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
#include "gimpairbrushtool.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "paint_options.h"
|
2002-03-29 11:50:29 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
static void gimp_airbrush_tool_class_init (GimpAirbrushToolClass *klass);
|
|
|
|
static void gimp_airbrush_tool_init (GimpAirbrushTool *airbrush);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
static GtkWidget * gimp_airbrush_options_gui (GimpToolOptions *tool_options);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
static GimpPaintToolClass *parent_class = NULL;
|
1999-04-09 06:25:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_airbrush_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
1999-04-09 06:25:54 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_AIRBRUSH_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_AIRBRUSH_OPTIONS,
|
|
|
|
gimp_airbrush_options_gui,
|
2001-11-21 07:00:47 +08:00
|
|
|
TRUE,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-airbrush-tool",
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Airbrush"),
|
|
|
|
_("Airbrush with variable pressure"),
|
|
|
|
N_("/Tools/Paint Tools/Airbrush"), "A",
|
|
|
|
NULL, "tools/airbrush.html",
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_AIRBRUSH,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
1999-04-09 06:25:54 +08:00
|
|
|
}
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
GType
|
2001-04-01 07:04:29 +08:00
|
|
|
gimp_airbrush_tool_get_type (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static GType tool_type = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static const GTypeInfo tool_info =
|
2001-04-01 07:04:29 +08:00
|
|
|
{
|
|
|
|
sizeof (GimpAirbrushToolClass),
|
2001-08-14 22:53:55 +08:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_airbrush_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpAirbrushTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_airbrush_tool_init,
|
2001-04-01 07:04:29 +08:00
|
|
|
};
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
|
|
|
|
"GimpAirbrushTool",
|
|
|
|
&tool_info, 0);
|
2001-04-01 07:04:29 +08:00
|
|
|
}
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
return tool_type;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
static void
|
|
|
|
gimp_airbrush_tool_class_init (GimpAirbrushToolClass *klass)
|
|
|
|
{
|
2002-02-15 03:31:16 +08:00
|
|
|
GObjectClass *object_class;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-02-15 03:31:16 +08:00
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
static void
|
|
|
|
gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
|
1999-04-13 01:55:06 +08:00
|
|
|
{
|
2001-04-01 07:04:29 +08:00
|
|
|
GimpTool *tool;
|
|
|
|
GimpPaintTool *paint_tool;
|
|
|
|
|
|
|
|
tool = GIMP_TOOL (airbrush);
|
|
|
|
paint_tool = GIMP_PAINT_TOOL (airbrush);
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2002-05-03 19:31:08 +08:00
|
|
|
gimp_tool_control_set_tool_cursor (tool->control, GIMP_AIRBRUSH_TOOL_CURSOR);
|
2001-04-01 07:04:29 +08:00
|
|
|
|
2002-02-15 03:31:16 +08:00
|
|
|
paint_tool->pick_colors = TRUE;
|
|
|
|
paint_tool->core = g_object_new (GIMP_TYPE_AIRBRUSH, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-02-22 00:02:30 +08:00
|
|
|
/* tool options stuff */
|
2002-02-15 03:31:16 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
static GtkWidget *
|
2003-02-05 22:39:40 +08:00
|
|
|
gimp_airbrush_options_gui (GimpToolOptions *tool_options)
|
2001-04-01 07:04:29 +08:00
|
|
|
{
|
2003-02-08 01:12:21 +08:00
|
|
|
GObject *config;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *table;
|
2001-04-01 07:04:29 +08:00
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
config = G_OBJECT (tool_options);
|
2001-11-21 07:00:47 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
vbox = gimp_paint_options_gui (tool_options);
|
2001-04-01 07:04:29 +08:00
|
|
|
|
2002-03-09 02:30:40 +08:00
|
|
|
table = gtk_table_new (2, 3, FALSE);
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2);
|
2001-04-01 07:04:29 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
2002-03-09 02:30:40 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
gimp_prop_scale_entry_new (config, "rate",
|
|
|
|
GTK_TABLE (table), 0, 0,
|
|
|
|
_("Rate:"),
|
|
|
|
1.0, 1.0, 1,
|
|
|
|
FALSE, 0.0, 0.0);
|
|
|
|
|
|
|
|
gimp_prop_scale_entry_new (config, "pressure",
|
|
|
|
GTK_TABLE (table), 0, 1,
|
|
|
|
_("Pressure:"),
|
|
|
|
1.0, 1.0, 1,
|
|
|
|
FALSE, 0.0, 0.0);
|
2003-02-10 01:32:52 +08:00
|
|
|
|
|
|
|
return vbox;
|
2001-04-01 07:04:29 +08:00
|
|
|
}
|