2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1999-07-02 00:52:50 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1999-07-02 00:52:50 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1999-07-02 00:52:50 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1999-07-02 00:52:50 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +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/gimpsmudgeoptions.h"
|
2002-02-15 03:31:16 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2010-11-02 04:48:59 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
2003-02-08 01:12:21 +08:00
|
|
|
|
2001-04-12 01:20:34 +08:00
|
|
|
#include "gimpsmudgetool.h"
|
2003-06-30 04:40:45 +08:00
|
|
|
#include "gimppaintoptions-gui.h"
|
2003-04-16 00:05:52 +08:00
|
|
|
#include "gimptoolcontrol.h"
|
2001-04-12 01:20:34 +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 GtkWidget * gimp_smudge_options_gui (GimpToolOptions *tool_options);
|
2001-11-21 07:00:47 +08:00
|
|
|
|
1999-07-02 00:52:50 +08:00
|
|
|
|
2006-08-16 05:46:22 +08:00
|
|
|
G_DEFINE_TYPE (GimpSmudgeTool, gimp_smudge_tool, GIMP_TYPE_BRUSH_TOOL)
|
2005-12-13 17:13:50 +08:00
|
|
|
|
|
|
|
|
2001-04-12 01:20:34 +08:00
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_smudge_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
1999-07-02 00:52:50 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_SMUDGE_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_SMUDGE_OPTIONS,
|
|
|
|
gimp_smudge_options_gui,
|
2003-06-30 04:40:45 +08:00
|
|
|
GIMP_PAINT_OPTIONS_CONTEXT_MASK,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-smudge-tool",
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Smudge"),
|
2006-09-19 02:00:22 +08:00
|
|
|
_("Smudge Tool: Smudge selectively using a brush"),
|
2004-04-29 21:19:28 +08:00
|
|
|
N_("_Smudge"), "S",
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_SMUDGE,
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_SMUDGE,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-04-12 01:20:34 +08:00
|
|
|
}
|
1999-07-02 00:52:50 +08:00
|
|
|
|
2005-12-13 17:13:50 +08:00
|
|
|
static void
|
|
|
|
gimp_smudge_tool_class_init (GimpSmudgeToolClass *klass)
|
2001-04-12 01:20:34 +08:00
|
|
|
{
|
1999-07-02 00:52:50 +08:00
|
|
|
}
|
|
|
|
|
2001-04-12 01:20:34 +08:00
|
|
|
static void
|
|
|
|
gimp_smudge_tool_init (GimpSmudgeTool *smudge)
|
|
|
|
{
|
2006-08-02 07:42:12 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (smudge);
|
|
|
|
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (smudge);
|
1999-07-02 00:52:50 +08:00
|
|
|
|
2004-06-05 07:08:29 +08:00
|
|
|
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_SMUDGE);
|
1999-07-02 00:52:50 +08:00
|
|
|
|
2006-09-12 14:37:54 +08:00
|
|
|
paint_tool->status = _("Click to smudge");
|
|
|
|
paint_tool->status_line = _("Click to smudge the line");
|
2006-09-13 19:04:49 +08:00
|
|
|
paint_tool->status_ctrl = NULL;
|
1999-07-02 00:52:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-02-15 03:31:16 +08:00
|
|
|
/* tool options stuff */
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
static GtkWidget *
|
2003-02-05 22:39:40 +08:00
|
|
|
gimp_smudge_options_gui (GimpToolOptions *tool_options)
|
2001-04-12 01:20:34 +08:00
|
|
|
{
|
2006-08-16 05:46:22 +08:00
|
|
|
GObject *config = G_OBJECT (tool_options);
|
2006-08-28 06:19:35 +08:00
|
|
|
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
|
2010-11-02 04:48:59 +08:00
|
|
|
GtkWidget *scale;
|
2001-04-12 01:20:34 +08:00
|
|
|
|
|
|
|
/* the rate scale */
|
2010-11-02 04:48:59 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "rate",
|
|
|
|
_("Rate"),
|
|
|
|
1.0, 10.0, 1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2003-02-10 01:32:52 +08:00
|
|
|
|
|
|
|
return vbox;
|
2001-04-12 01:20:34 +08:00
|
|
|
}
|