1998-06-15 06:42:36 +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
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
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"
|
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
#include <stdlib.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#include <string.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
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/pixel-region.h"
|
|
|
|
#include "base/temp-buf.h"
|
|
|
|
#include "base/tile.h"
|
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2001-04-07 23:58:26 +08:00
|
|
|
#include "paint-funcs/paint-funcs.h"
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimpimage-mask.h"
|
|
|
|
|
2001-03-08 09:07:03 +08:00
|
|
|
#include "gimpinktool.h"
|
|
|
|
#include "gimpinktool-blob.h"
|
|
|
|
#include "gimptool.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "paint_options.h"
|
2001-02-28 08:10:58 +08:00
|
|
|
#include "tool_manager.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
|
2001-07-08 06:49:01 +08:00
|
|
|
#include "gimprc.h"
|
|
|
|
#include "undo.h"
|
|
|
|
#include "gdisplay.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
#define SUBSAMPLE 8
|
1999-04-10 22:55:17 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
/* the Ink structures */
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
typedef Blob * (* BlobFunc) (gdouble,
|
|
|
|
gdouble,
|
|
|
|
gdouble,
|
|
|
|
gdouble,
|
|
|
|
gdouble,
|
|
|
|
gdouble);
|
|
|
|
|
1999-02-03 12:29:08 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
typedef struct _BrushWidget BrushWidget;
|
2000-01-14 20:41:00 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
struct _BrushWidget
|
|
|
|
{
|
2000-12-31 12:07:42 +08:00
|
|
|
GtkWidget *widget;
|
|
|
|
gboolean state;
|
1998-06-15 06:42:36 +08:00
|
|
|
};
|
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
typedef struct _InkOptions InkOptions;
|
2000-01-14 20:41:00 +08:00
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
struct _InkOptions
|
|
|
|
{
|
1999-04-22 22:34:00 +08:00
|
|
|
PaintOptions paint_options;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-14 20:41:00 +08:00
|
|
|
gdouble size;
|
|
|
|
gdouble size_d;
|
1999-04-22 22:34:00 +08:00
|
|
|
GtkObject *size_w;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-14 20:41:00 +08:00
|
|
|
gdouble sensitivity;
|
|
|
|
gdouble sensitivity_d;
|
1999-04-22 22:34:00 +08:00
|
|
|
GtkObject *sensitivity_w;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-14 20:41:00 +08:00
|
|
|
gdouble vel_sensitivity;
|
|
|
|
gdouble vel_sensitivity_d;
|
1999-04-22 22:34:00 +08:00
|
|
|
GtkObject *vel_sensitivity_w;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-14 20:41:00 +08:00
|
|
|
gdouble tilt_sensitivity;
|
|
|
|
gdouble tilt_sensitivity_d;
|
1999-04-22 22:34:00 +08:00
|
|
|
GtkObject *tilt_sensitivity_w;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-14 20:41:00 +08:00
|
|
|
gdouble tilt_angle;
|
|
|
|
gdouble tilt_angle_d;
|
1999-04-22 22:34:00 +08:00
|
|
|
GtkObject *tilt_angle_w;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
BlobFunc function;
|
|
|
|
BlobFunc function_d;
|
|
|
|
GtkWidget *function_w[3]; /* 3 radio buttons */
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-14 20:41:00 +08:00
|
|
|
gdouble aspect;
|
|
|
|
gdouble aspect_d;
|
|
|
|
gdouble angle;
|
|
|
|
gdouble angle_d;
|
1999-04-22 22:34:00 +08:00
|
|
|
BrushWidget *brush_w;
|
1999-04-13 01:55:06 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
/* local function prototypes */
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
static void gimp_ink_tool_class_init (GimpInkToolClass *klass);
|
|
|
|
static void gimp_ink_tool_init (GimpInkTool *tool);
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
static void gimp_ink_tool_finalize (GObject *object);
|
2001-02-28 08:10:58 +08:00
|
|
|
|
|
|
|
static InkOptions * ink_options_new (void);
|
2001-07-18 04:50:01 +08:00
|
|
|
static void ink_options_reset (GimpToolOptions *tool_options);
|
|
|
|
|
|
|
|
static void ink_button_press (GimpTool *tool,
|
|
|
|
GdkEventButton *mevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void ink_button_release (GimpTool *tool,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void ink_motion (GimpTool *tool,
|
|
|
|
GdkEventMotion *mevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void ink_cursor_update (GimpTool *tool,
|
|
|
|
GdkEventMotion *mevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void ink_control (GimpTool *tool,
|
|
|
|
ToolAction tool_action,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
|
|
|
|
static void time_smoother_add (GimpInkTool *ink_tool,
|
|
|
|
guint32 value);
|
|
|
|
static gdouble time_smoother_result (GimpInkTool *ink_tool);
|
|
|
|
static void time_smoother_init (GimpInkTool *ink_tool,
|
|
|
|
guint32 initval);
|
|
|
|
static void dist_smoother_add (GimpInkTool *ink_tool,
|
|
|
|
gdouble value);
|
|
|
|
static gdouble dist_smoother_result (GimpInkTool *ink_tool);
|
|
|
|
static void dist_smoother_init (GimpInkTool *ink_tool,
|
|
|
|
gdouble initval);
|
|
|
|
|
|
|
|
static void ink_init (GimpInkTool *ink_tool,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
gdouble x,
|
|
|
|
gdouble y);
|
|
|
|
static void ink_finish (GimpInkTool *ink_tool,
|
|
|
|
GimpDrawable *drawable);
|
2000-12-31 12:07:42 +08:00
|
|
|
static void ink_cleanup (void);
|
|
|
|
|
2001-07-18 04:50:01 +08:00
|
|
|
static void ink_type_update (GtkWidget *radio_button,
|
|
|
|
BlobFunc function);
|
|
|
|
static GdkPixmap * blob_pixmap (GdkColormap *colormap,
|
|
|
|
GdkVisual *visual,
|
|
|
|
BlobFunc function);
|
|
|
|
static void paint_blob (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
Blob *blob);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
/* Rendering functions */
|
2001-07-18 04:50:01 +08:00
|
|
|
static void ink_set_paint_area (GimpInkTool *ink_tool,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
Blob *blob);
|
|
|
|
static void ink_paste (GimpInkTool *ink_tool,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
Blob *blob);
|
|
|
|
|
|
|
|
static void ink_to_canvas_tiles (GimpInkTool *ink_tool,
|
|
|
|
Blob *blob,
|
|
|
|
guchar *color);
|
|
|
|
|
|
|
|
static void ink_set_undo_tiles (GimpDrawable *drawable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
|
|
|
static void ink_set_canvas_tiles (gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
/* Brush pseudo-widget callbacks */
|
2000-12-31 12:07:42 +08:00
|
|
|
static void brush_widget_active_rect (BrushWidget *brush_widget,
|
|
|
|
GtkWidget *widget,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkRectangle *rect);
|
2000-12-31 12:07:42 +08:00
|
|
|
static void brush_widget_realize (GtkWidget *widget);
|
|
|
|
static void brush_widget_expose (GtkWidget *widget,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventExpose *event,
|
|
|
|
BrushWidget *brush_widget);
|
2000-12-31 12:07:42 +08:00
|
|
|
static void brush_widget_button_press (GtkWidget *widget,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventButton *event,
|
|
|
|
BrushWidget *brush_widget);
|
2000-12-31 12:07:42 +08:00
|
|
|
static void brush_widget_button_release (GtkWidget *widget,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventButton *event,
|
|
|
|
BrushWidget *brush_widget);
|
2000-12-31 12:07:42 +08:00
|
|
|
static void brush_widget_motion_notify (GtkWidget *widget,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventMotion *event,
|
|
|
|
BrushWidget *brush_widget);
|
|
|
|
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
/* local variables */
|
|
|
|
|
|
|
|
/* the ink tool options */
|
|
|
|
static InkOptions *ink_options = NULL;
|
|
|
|
|
|
|
|
/* undo blocks variables */
|
|
|
|
static TileManager *undo_tiles = NULL;
|
|
|
|
|
|
|
|
/* Tiles used to render the stroke at 1 byte/pp */
|
|
|
|
static TileManager *canvas_tiles = NULL;
|
|
|
|
|
|
|
|
/* Flat buffer that is used to used to render the dirty region
|
|
|
|
* for composition onto the destination drawable
|
|
|
|
*/
|
|
|
|
static TempBuf *canvas_buf = NULL;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
static GimpToolClass *parent_class = NULL;
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
/* functions */
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
void
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_ink_tool_register (Gimp *gimp)
|
2001-02-28 08:10:58 +08:00
|
|
|
{
|
2001-07-07 20:17:23 +08:00
|
|
|
tool_manager_register_tool (gimp,
|
|
|
|
GIMP_TYPE_INK_TOOL,
|
2001-02-28 08:10:58 +08:00
|
|
|
TRUE,
|
|
|
|
"gimp:ink_tool",
|
|
|
|
_("Ink Tool"),
|
|
|
|
_("Draw in ink"),
|
|
|
|
N_("/Tools/Paint Tools/Ink"), "K",
|
|
|
|
NULL, "tools/ink.html",
|
2001-08-06 00:08:19 +08:00
|
|
|
GIMP_STOCK_TOOL_INK);
|
2001-02-28 08:10:58 +08:00
|
|
|
}
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
GType
|
2001-02-28 08:10:58 +08:00
|
|
|
gimp_ink_tool_get_type (void)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static GType tool_type = 0;
|
2001-02-28 08:10:58 +08:00
|
|
|
|
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static const GTypeInfo tool_info =
|
2001-02-28 08:10:58 +08:00
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
sizeof (GimpInkToolClass),
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_ink_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
2001-02-28 08:10:58 +08:00
|
|
|
sizeof (GimpInkTool),
|
2001-08-14 22:53:55 +08:00
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_ink_tool_init,
|
2001-02-28 08:10:58 +08:00
|
|
|
};
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_TOOL,
|
|
|
|
"GimpInkTool",
|
|
|
|
&tool_info, 0);
|
2001-02-28 08:10:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_ink_tool_class_init (GimpInkToolClass *klass)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
GObjectClass *object_class;
|
2001-02-28 08:10:58 +08:00
|
|
|
GimpToolClass *tool_class;
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
|
|
|
tool_class = GIMP_TOOL_CLASS (klass);
|
2001-02-28 08:10:58 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-02-28 08:10:58 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
object_class->finalize = gimp_ink_tool_finalize;
|
2001-02-28 08:10:58 +08:00
|
|
|
|
|
|
|
tool_class->control = ink_control;
|
|
|
|
tool_class->button_press = ink_button_press;
|
|
|
|
tool_class->button_release = ink_button_release;
|
|
|
|
tool_class->motion = ink_motion;
|
|
|
|
tool_class->cursor_update = ink_cursor_update;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_ink_tool_init (GimpInkTool *ink_tool)
|
|
|
|
{
|
|
|
|
GimpTool *tool;
|
|
|
|
|
|
|
|
tool = GIMP_TOOL (ink_tool);
|
|
|
|
|
|
|
|
/* The tool options */
|
|
|
|
if (! ink_options)
|
|
|
|
{
|
|
|
|
ink_options = ink_options_new ();
|
|
|
|
|
|
|
|
tool_manager_register_tool_options (GIMP_TYPE_INK_TOOL,
|
2001-07-18 04:50:01 +08:00
|
|
|
(GimpToolOptions *) ink_options);
|
2001-02-28 08:10:58 +08:00
|
|
|
|
2001-07-18 04:50:01 +08:00
|
|
|
ink_options_reset ((GimpToolOptions *) ink_options);
|
2001-02-28 08:10:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-14 22:53:55 +08:00
|
|
|
gimp_ink_tool_finalize (GObject *object)
|
2001-02-28 08:10:58 +08:00
|
|
|
{
|
|
|
|
GimpInkTool *ink_tool;
|
|
|
|
|
|
|
|
ink_tool = GIMP_INK_TOOL (object);
|
|
|
|
|
|
|
|
if (ink_tool->last_blob)
|
2001-08-14 22:53:55 +08:00
|
|
|
{
|
|
|
|
g_free (ink_tool->last_blob);
|
|
|
|
ink_tool->last_blob = NULL;
|
|
|
|
}
|
2001-02-28 08:10:58 +08:00
|
|
|
|
|
|
|
ink_cleanup ();
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-02-28 08:10:58 +08:00
|
|
|
}
|
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
static void
|
|
|
|
ink_type_update (GtkWidget *radio_button,
|
|
|
|
BlobFunc function)
|
|
|
|
{
|
|
|
|
InkOptions *options = ink_options;
|
|
|
|
|
|
|
|
if (GTK_TOGGLE_BUTTON (radio_button)->active)
|
|
|
|
options->function = function;
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (options->brush_w->widget);
|
|
|
|
}
|
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
static void
|
2001-07-18 04:50:01 +08:00
|
|
|
ink_options_reset (GimpToolOptions *tool_options)
|
1999-04-09 06:25:54 +08:00
|
|
|
{
|
2001-04-01 04:41:39 +08:00
|
|
|
InkOptions *options;
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2001-04-01 04:41:39 +08:00
|
|
|
options = (InkOptions *) tool_options;
|
|
|
|
|
|
|
|
paint_options_reset (tool_options);
|
1999-04-22 22:34:00 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->size_w),
|
|
|
|
options->size_d);
|
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->sensitivity_w),
|
|
|
|
options->sensitivity_d);
|
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->tilt_sensitivity_w),
|
|
|
|
options->tilt_sensitivity_d);
|
1999-04-10 22:55:17 +08:00
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->vel_sensitivity_w),
|
|
|
|
options->vel_sensitivity_d);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->tilt_angle_w),
|
|
|
|
options->tilt_angle_d);
|
1999-04-18 07:18:43 +08:00
|
|
|
gtk_toggle_button_set_active (((options->function_d == blob_ellipse) ?
|
|
|
|
GTK_TOGGLE_BUTTON (options->function_w[0]) :
|
|
|
|
((options->function_d == blob_square) ?
|
|
|
|
GTK_TOGGLE_BUTTON (options->function_w[1]) :
|
|
|
|
GTK_TOGGLE_BUTTON (options->function_w[2]))),
|
|
|
|
TRUE);
|
1999-04-09 06:25:54 +08:00
|
|
|
options->aspect = options->aspect_d;
|
|
|
|
options->angle = options->angle_d;
|
1999-04-13 01:55:06 +08:00
|
|
|
gtk_widget_queue_draw (options->brush_w->widget);
|
1999-04-09 06:25:54 +08:00
|
|
|
}
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
static InkOptions *
|
1999-04-13 01:55:06 +08:00
|
|
|
ink_options_new (void)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
1999-04-09 06:25:54 +08:00
|
|
|
InkOptions *options;
|
2001-04-01 04:41:39 +08:00
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *hbox2;
|
|
|
|
GtkWidget *radio_button;
|
|
|
|
GtkWidget *pixmap_widget;
|
|
|
|
GtkWidget *slider;
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *darea;
|
|
|
|
GdkPixmap *pixmap;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
options = g_new0 (InkOptions, 1);
|
1999-04-22 22:34:00 +08:00
|
|
|
paint_options_init ((PaintOptions *) options,
|
2001-02-28 08:10:58 +08:00
|
|
|
GIMP_TYPE_INK_TOOL,
|
1999-04-22 22:34:00 +08:00
|
|
|
ink_options_reset);
|
2001-02-28 08:10:58 +08:00
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
options->size = options->size_d = 4.4;
|
1999-04-09 06:25:54 +08:00
|
|
|
options->sensitivity = options->sensitivity_d = 1.0;
|
1999-04-10 22:55:17 +08:00
|
|
|
options->vel_sensitivity = options->vel_sensitivity_d = 0.8;
|
|
|
|
options->tilt_sensitivity = options->tilt_sensitivity_d = 0.4;
|
1999-04-09 06:25:54 +08:00
|
|
|
options->tilt_angle = options->tilt_angle_d = 0.0;
|
|
|
|
options->function = options->function_d = blob_ellipse;
|
|
|
|
options->aspect = options->aspect_d = 1.0;
|
|
|
|
options->angle = options->angle_d = 0.0;
|
|
|
|
|
2000-04-16 20:10:24 +08:00
|
|
|
/* the main vbox */
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
2001-07-18 04:50:01 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (((GimpToolOptions *) options)->main_vbox), vbox,
|
2000-04-16 20:10:24 +08:00
|
|
|
TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
/* adjust sliders */
|
|
|
|
frame = gtk_frame_new (_("Adjustment"));
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_widget_show (table);
|
1999-04-09 06:25:54 +08:00
|
|
|
|
|
|
|
/* size slider */
|
|
|
|
options->size_w =
|
1999-07-21 00:12:56 +08:00
|
|
|
gtk_adjustment_new (options->size_d, 0.0, 20.0, 1.0, 2.0, 0.0);
|
1999-04-09 06:25:54 +08:00
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->size_w));
|
1998-06-15 06:42:36 +08:00
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
2000-04-16 20:10:24 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Size:"), 1.0, 1.0,
|
|
|
|
slider, 1, FALSE);
|
1998-06-15 06:42:36 +08:00
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (options->size_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->size);
|
2000-04-16 20:10:24 +08:00
|
|
|
|
|
|
|
/* angle adjust slider */
|
|
|
|
options->tilt_angle_w =
|
|
|
|
gtk_adjustment_new (options->tilt_angle_d, -90.0, 90.0, 1, 10.0, 0.0);
|
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->tilt_angle_w));
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Angle:"), 1.0, 1.0,
|
|
|
|
slider, 1, FALSE);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (options->tilt_angle_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->tilt_angle);
|
2000-04-16 20:10:24 +08:00
|
|
|
|
|
|
|
/* sens sliders */
|
|
|
|
frame = gtk_frame_new (_("Sensitivity"));
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
table = gtk_table_new (3, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
/* size sens slider */
|
1999-04-09 06:25:54 +08:00
|
|
|
options->sensitivity_w =
|
|
|
|
gtk_adjustment_new (options->sensitivity_d, 0.0, 1.0, 0.01, 0.1, 0.0);
|
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->sensitivity_w));
|
1998-06-15 06:42:36 +08:00
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
2000-04-16 20:10:24 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Size:"), 1.0, 1.0,
|
|
|
|
slider, 1, FALSE);
|
1998-06-15 06:42:36 +08:00
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (options->sensitivity_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->sensitivity);
|
1998-11-26 03:21:54 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
/* tilt sens slider */
|
|
|
|
options->tilt_sensitivity_w =
|
|
|
|
gtk_adjustment_new (options->tilt_sensitivity_d, 0.0, 1.0, 0.01, 0.1, 0.0);
|
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->tilt_sensitivity_w));
|
1998-11-26 03:21:54 +08:00
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
2000-04-16 20:10:24 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
|
|
|
_("Tilt:"), 1.0, 1.0,
|
|
|
|
slider, 1, FALSE);
|
1998-11-26 03:21:54 +08:00
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (options->tilt_sensitivity_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->tilt_sensitivity);
|
1999-04-10 22:55:17 +08:00
|
|
|
|
|
|
|
/* velocity sens slider */
|
|
|
|
options->vel_sensitivity_w =
|
|
|
|
gtk_adjustment_new (options->vel_sensitivity_d, 0.0, 1.0, 0.01, 0.1, 0.0);
|
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->vel_sensitivity_w));
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
2000-04-16 20:10:24 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
|
|
|
|
_("Speed:"), 1.0, 1.0,
|
|
|
|
slider, 1, FALSE);
|
1999-04-10 22:55:17 +08:00
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (options->vel_sensitivity_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->vel_sensitivity);
|
1999-04-10 22:55:17 +08:00
|
|
|
|
2000-04-16 20:10:24 +08:00
|
|
|
/* bottom hbox */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
1998-11-26 15:44:17 +08:00
|
|
|
|
1999-02-03 12:29:08 +08:00
|
|
|
/* Brush type radiobuttons */
|
1999-04-09 06:25:54 +08:00
|
|
|
frame = gtk_frame_new (_("Type"));
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2000-04-16 20:10:24 +08:00
|
|
|
hbox2 = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox2);
|
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox2), vbox, FALSE, FALSE, 0);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
|
|
|
|
gtk_widget_get_visual (vbox),
|
1999-02-03 12:29:08 +08:00
|
|
|
blob_ellipse);
|
|
|
|
|
|
|
|
pixmap_widget = gtk_pixmap_new (pixmap, NULL);
|
2001-07-25 21:21:57 +08:00
|
|
|
gdk_drawable_unref (pixmap);
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_misc_set_padding (GTK_MISC (pixmap_widget), 6, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
|
|
|
radio_button = gtk_radio_button_new (NULL);
|
|
|
|
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
g_signal_connect (G_OBJECT (radio_button), "toggled",
|
|
|
|
G_CALLBACK (ink_type_update),
|
|
|
|
(gpointer) blob_ellipse);
|
|
|
|
|
|
|
|
|
1999-04-18 07:18:43 +08:00
|
|
|
options->function_w[0] = radio_button;
|
1999-04-09 06:25:54 +08:00
|
|
|
|
|
|
|
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
|
|
|
|
gtk_widget_get_visual (vbox),
|
1999-02-03 12:29:08 +08:00
|
|
|
blob_square);
|
|
|
|
|
|
|
|
pixmap_widget = gtk_pixmap_new (pixmap, NULL);
|
2001-07-25 21:21:57 +08:00
|
|
|
gdk_drawable_unref (pixmap);
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_misc_set_padding (GTK_MISC (pixmap_widget), 6, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
radio_button =
|
|
|
|
gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio_button));
|
1999-02-03 12:29:08 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
g_signal_connect (G_OBJECT (radio_button), "toggled",
|
|
|
|
G_CALLBACK (ink_type_update),
|
|
|
|
(gpointer) blob_square);
|
|
|
|
|
|
|
|
|
1999-04-18 07:18:43 +08:00
|
|
|
options->function_w[1] = radio_button;
|
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
|
|
|
|
gtk_widget_get_visual (vbox),
|
1999-02-03 12:29:08 +08:00
|
|
|
blob_diamond);
|
|
|
|
|
|
|
|
pixmap_widget = gtk_pixmap_new (pixmap, NULL);
|
2001-07-25 21:21:57 +08:00
|
|
|
gdk_drawable_unref (pixmap);
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_misc_set_padding (GTK_MISC (pixmap_widget), 6, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
radio_button =
|
|
|
|
gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio_button));
|
1999-02-03 12:29:08 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
g_signal_connect (G_OBJECT (radio_button), "toggled",
|
|
|
|
G_CALLBACK (ink_type_update),
|
|
|
|
(gpointer) blob_diamond);
|
|
|
|
|
|
|
|
|
1999-04-18 07:18:43 +08:00
|
|
|
options->function_w[2] = radio_button;
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
/* Brush shape widget */
|
1999-04-09 06:25:54 +08:00
|
|
|
frame = gtk_frame_new (_("Shape"));
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2000-04-16 20:10:24 +08:00
|
|
|
frame = gtk_aspect_frame_new (NULL, 0.0, 0.5, 1.0, FALSE);
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
2000-04-16 20:10:24 +08:00
|
|
|
options->brush_w = g_new (BrushWidget, 1);
|
|
|
|
options->brush_w->state = FALSE;
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
darea = gtk_drawing_area_new();
|
1999-04-13 01:55:06 +08:00
|
|
|
options->brush_w->widget = darea;
|
1999-04-18 07:18:43 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 60, 60);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), darea);
|
1999-04-18 07:18:43 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
gtk_widget_set_events (darea,
|
|
|
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
|
|
|
|
| GDK_POINTER_MOTION_MASK | GDK_EXPOSURE_MASK);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (darea), "button_press_event",
|
|
|
|
G_CALLBACK (brush_widget_button_press),
|
|
|
|
options->brush_w);
|
|
|
|
g_signal_connect (G_OBJECT (darea), "button_release_event",
|
|
|
|
G_CALLBACK (brush_widget_button_release),
|
|
|
|
options->brush_w);
|
|
|
|
g_signal_connect (G_OBJECT (darea), "motion_notify_event",
|
|
|
|
G_CALLBACK (brush_widget_motion_notify),
|
|
|
|
options->brush_w);
|
|
|
|
g_signal_connect (G_OBJECT (darea), "expose_event",
|
|
|
|
G_CALLBACK (brush_widget_expose),
|
|
|
|
options->brush_w);
|
|
|
|
g_signal_connect (G_OBJECT (darea), "realize",
|
|
|
|
G_CALLBACK (brush_widget_realize),
|
|
|
|
options->brush_w);
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2000-04-16 20:10:24 +08:00
|
|
|
gtk_widget_show_all (hbox);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
|
|
|
|
/* the brush widget functions */
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_active_rect (BrushWidget *brush_widget,
|
|
|
|
GtkWidget *widget,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkRectangle *rect)
|
|
|
|
{
|
|
|
|
int x,y;
|
|
|
|
int r;
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
r = MIN (widget->allocation.width, widget->allocation.height) / 2;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
x = widget->allocation.width / 2 + 0.85 * r * ink_options->aspect / 10.0 *
|
1998-06-15 06:42:36 +08:00
|
|
|
cos (ink_options->angle);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
y = widget->allocation.height / 2 + 0.85 * r * ink_options->aspect / 10.0 *
|
1998-06-15 06:42:36 +08:00
|
|
|
sin (ink_options->angle);
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
rect->x = x - 5;
|
|
|
|
rect->y = y - 5;
|
1998-06-15 06:42:36 +08:00
|
|
|
rect->width = 10;
|
|
|
|
rect->height = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_realize (GtkWidget *widget)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_draw_brush (BrushWidget *brush_widget,
|
|
|
|
GtkWidget *widget,
|
|
|
|
gdouble xc,
|
|
|
|
gdouble yc,
|
|
|
|
gdouble radius)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
Blob *blob;
|
|
|
|
|
|
|
|
blob = ink_options->function (xc, yc,
|
|
|
|
radius * cos (ink_options->angle),
|
|
|
|
radius * sin (ink_options->angle),
|
|
|
|
(- (radius / ink_options->aspect) *
|
|
|
|
sin (ink_options->angle)),
|
|
|
|
((radius / ink_options->aspect) *
|
|
|
|
cos (ink_options->angle)));
|
|
|
|
|
|
|
|
paint_blob (widget->window, widget->style->fg_gc[widget->state], blob);
|
|
|
|
g_free (blob);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event,
|
|
|
|
BrushWidget *brush_widget)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
GdkRectangle rect;
|
|
|
|
int r0;
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
|
|
|
|
r0 = MIN (widget->allocation.width, widget->allocation.height) / 2;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
if (r0 < 2)
|
|
|
|
return;
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gdk_window_clear_area (widget->window, 0, 0,
|
|
|
|
widget->allocation.width,
|
|
|
|
widget->allocation.height);
|
|
|
|
brush_widget_draw_brush (brush_widget, widget,
|
|
|
|
widget->allocation.width / 2,
|
|
|
|
widget->allocation.height / 2,
|
|
|
|
0.9 * r0);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_active_rect (brush_widget, widget, &rect);
|
|
|
|
gdk_draw_rectangle (widget->window, widget->style->bg_gc[GTK_STATE_NORMAL],
|
1998-06-15 06:42:36 +08:00
|
|
|
TRUE, /* filled */
|
|
|
|
rect.x, rect.y,
|
|
|
|
rect.width, rect.height);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_draw_shadow (widget->style, widget->window, widget->state, GTK_SHADOW_OUT,
|
1998-06-15 06:42:36 +08:00
|
|
|
rect.x, rect.y,
|
|
|
|
rect.width, rect.height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event,
|
|
|
|
BrushWidget *brush_widget)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_active_rect (brush_widget, widget, &rect);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
if ((event->x >= rect.x) && (event->x-rect.x < rect.width) &&
|
|
|
|
(event->y >= rect.y) && (event->y-rect.y < rect.height))
|
|
|
|
{
|
|
|
|
brush_widget->state = TRUE;
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
|
1999-07-24 23:37:03 +08:00
|
|
|
gtk_grab_add (brush_widget->widget);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event,
|
|
|
|
BrushWidget *brush_widget)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
brush_widget->state = FALSE;
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
|
1999-07-24 23:37:03 +08:00
|
|
|
gtk_grab_remove (brush_widget->widget);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
brush_widget_motion_notify (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event,
|
|
|
|
BrushWidget *brush_widget)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int r0;
|
|
|
|
int rsquare;
|
|
|
|
|
|
|
|
if (brush_widget->state)
|
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
x = event->x - widget->allocation.width / 2;
|
|
|
|
y = event->y - widget->allocation.height / 2;
|
1998-06-15 06:42:36 +08:00
|
|
|
rsquare = x*x + y*y;
|
|
|
|
|
|
|
|
if (rsquare != 0)
|
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
ink_options->angle = atan2 (y, x);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
r0 = MIN (widget->allocation.width, widget->allocation.height) / 2;
|
1998-06-15 06:42:36 +08:00
|
|
|
ink_options->aspect =
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
10.0 * sqrt ((double) rsquare / (r0 * r0)) / 0.85;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
if (ink_options->aspect < 1.0)
|
|
|
|
ink_options->aspect = 1.0;
|
|
|
|
if (ink_options->aspect > 10.0)
|
|
|
|
ink_options->aspect = 10.0;
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_widget_draw (widget, NULL);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-02-03 12:29:08 +08:00
|
|
|
/*
|
|
|
|
* Return a black-on white pixmap in the given colormap and
|
|
|
|
* visual that represents the BlobFunc 'function'
|
|
|
|
*/
|
|
|
|
static GdkPixmap *
|
|
|
|
blob_pixmap (GdkColormap *colormap,
|
2001-02-28 08:10:58 +08:00
|
|
|
GdkVisual *visual,
|
|
|
|
BlobFunc function)
|
1999-02-03 12:29:08 +08:00
|
|
|
{
|
|
|
|
GdkPixmap *pixmap;
|
2001-02-28 08:10:58 +08:00
|
|
|
GdkGC *black_gc, *white_gc;
|
|
|
|
GdkColor tmp_color;
|
|
|
|
Blob *blob;
|
1999-02-03 12:29:08 +08:00
|
|
|
|
|
|
|
pixmap = gdk_pixmap_new (NULL, 22, 21, visual->depth);
|
|
|
|
|
|
|
|
black_gc = gdk_gc_new (pixmap);
|
|
|
|
gdk_color_black (colormap, &tmp_color);
|
|
|
|
gdk_gc_set_foreground (black_gc, &tmp_color);
|
|
|
|
|
|
|
|
white_gc = gdk_gc_new (pixmap);
|
|
|
|
gdk_color_white (colormap, &tmp_color);
|
|
|
|
gdk_gc_set_foreground (white_gc, &tmp_color);
|
|
|
|
|
|
|
|
gdk_draw_rectangle (pixmap, white_gc, TRUE, 0, 0, 21, 20);
|
|
|
|
gdk_draw_rectangle (pixmap, black_gc, FALSE, 0, 0, 21, 20);
|
|
|
|
blob = (*function) (10, 10, 8, 0, 0, 8);
|
|
|
|
paint_blob (pixmap, black_gc, blob);
|
1999-11-15 06:50:08 +08:00
|
|
|
g_free (blob);
|
1999-02-03 12:29:08 +08:00
|
|
|
|
|
|
|
gdk_gc_unref (white_gc);
|
|
|
|
gdk_gc_unref (black_gc);
|
|
|
|
|
|
|
|
return pixmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Draw a blob onto a drawable with the specified graphics context
|
|
|
|
*/
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
paint_blob (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
Blob *blob)
|
1999-02-03 12:29:08 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i=0;i<blob->height;i++)
|
|
|
|
{
|
|
|
|
if (blob->data[i].left <= blob->data[i].right)
|
|
|
|
gdk_draw_line (drawable, gc,
|
|
|
|
blob->data[i].left,i+blob->y,
|
|
|
|
blob->data[i].right+1,i+blob->y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
static Blob *
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_pen_ellipse (gdouble x_center,
|
|
|
|
gdouble y_center,
|
|
|
|
gdouble pressure,
|
|
|
|
gdouble xtilt,
|
|
|
|
gdouble ytilt,
|
1999-04-10 22:55:17 +08:00
|
|
|
gdouble velocity)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
double size;
|
|
|
|
double tsin, tcos;
|
|
|
|
double aspect, radmin;
|
|
|
|
double x,y;
|
1998-11-26 03:21:54 +08:00
|
|
|
double tscale;
|
1998-11-26 15:44:17 +08:00
|
|
|
double tscale_c;
|
|
|
|
double tscale_s;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
/* Adjust the size depending on pressure. */
|
|
|
|
|
|
|
|
size = ink_options->size * (1.0 + ink_options->sensitivity *
|
|
|
|
(2.0 * pressure - 1.0) );
|
|
|
|
|
|
|
|
/* Adjust the size further depending on pointer velocity
|
|
|
|
and velocity-sensitivity. These 'magic constants' are
|
|
|
|
'feels natural' tigert-approved. --ADM */
|
|
|
|
|
|
|
|
if (velocity < 3.0)
|
|
|
|
velocity = 3.0;
|
|
|
|
|
|
|
|
#ifdef VERBOSE
|
|
|
|
g_print("%f (%f) -> ", (float)size, (float)velocity);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
size = ink_options->vel_sensitivity *
|
|
|
|
((4.5 * size) / (1.0 + ink_options->vel_sensitivity * (2.0*(velocity))))
|
|
|
|
+ (1.0 - ink_options->vel_sensitivity) * size;
|
|
|
|
|
|
|
|
#ifdef VERBOSE
|
|
|
|
g_print("%f\n", (float)size);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Clamp resulting size to sane limits */
|
|
|
|
|
|
|
|
if (size > ink_options->size * (1.0 + ink_options->sensitivity))
|
|
|
|
size = ink_options->size * (1.0 + ink_options->sensitivity);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
if (size*SUBSAMPLE < 1.0) size = 1.0/SUBSAMPLE;
|
|
|
|
|
|
|
|
/* Add brush angle/aspect to tilt vectorially */
|
1998-06-15 06:42:36 +08:00
|
|
|
|
1998-11-26 15:44:17 +08:00
|
|
|
/* I'm not happy with the way the brush widget info is combined with
|
|
|
|
tilt info from the brush. My personal feeling is that representing
|
|
|
|
both as affine transforms would make the most sense. -RLL */
|
|
|
|
|
1998-11-26 03:21:54 +08:00
|
|
|
tscale = ink_options->tilt_sensitivity * 10.0;
|
2000-02-19 02:20:04 +08:00
|
|
|
tscale_c = tscale * cos (gimp_deg_to_rad (ink_options->tilt_angle));
|
|
|
|
tscale_s = tscale * sin (gimp_deg_to_rad (ink_options->tilt_angle));
|
1998-11-26 15:44:17 +08:00
|
|
|
x = ink_options->aspect*cos(ink_options->angle) +
|
|
|
|
xtilt * tscale_c - ytilt * tscale_s;
|
|
|
|
y = ink_options->aspect*sin(ink_options->angle) +
|
|
|
|
ytilt * tscale_c + xtilt * tscale_s;
|
|
|
|
#ifdef VERBOSE
|
|
|
|
g_print ("angle %g aspect %g; %g %g; %g %g\n",
|
|
|
|
ink_options->angle, ink_options->aspect, tscale_c, tscale_s, x, y);
|
|
|
|
#endif
|
1998-06-15 06:42:36 +08:00
|
|
|
aspect = sqrt(x*x+y*y);
|
|
|
|
|
|
|
|
if (aspect != 0)
|
|
|
|
{
|
|
|
|
tcos = x/aspect;
|
|
|
|
tsin = y/aspect;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tsin = sin(ink_options->angle);
|
|
|
|
tcos = cos(ink_options->angle);
|
|
|
|
}
|
1999-04-09 06:25:54 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
if (aspect < 1.0)
|
|
|
|
aspect = 1.0;
|
|
|
|
else if (aspect > 10.0)
|
|
|
|
aspect = 10.0;
|
|
|
|
|
|
|
|
radmin = SUBSAMPLE * size/aspect;
|
|
|
|
if (radmin < 1.0) radmin = 1.0;
|
|
|
|
|
1999-02-03 12:29:08 +08:00
|
|
|
return ink_options->function (x_center * SUBSAMPLE, y_center * SUBSAMPLE,
|
|
|
|
radmin*aspect*tcos, radmin*aspect*tsin,
|
|
|
|
-radmin*tsin, radmin*tcos);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_button_press (GimpTool *tool,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventButton *bevent,
|
2000-12-31 12:07:42 +08:00
|
|
|
GDisplay *gdisp)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
GimpInkTool *ink_tool;
|
1998-06-15 06:42:36 +08:00
|
|
|
GimpDrawable *drawable;
|
|
|
|
Blob *b;
|
2001-02-28 08:10:58 +08:00
|
|
|
gdouble x, y;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_tool = GIMP_INK_TOOL (tool);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Keep the coordinates of the target */
|
|
|
|
gdisplay_untransform_coords_f (gdisp, bevent->x, bevent->y,
|
|
|
|
&x, &y, TRUE);
|
2000-12-29 23:22:01 +08:00
|
|
|
drawable = gimp_image_active_drawable (gdisp->gimage);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
ink_init (ink_tool, drawable, x, y);
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
tool->state = ACTIVE;
|
|
|
|
tool->gdisp = gdisp;
|
1998-06-15 06:42:36 +08:00
|
|
|
tool->paused_count = 0;
|
|
|
|
|
|
|
|
/* pause the current selection and grab the pointer */
|
2001-06-18 21:10:03 +08:00
|
|
|
gdisplays_selection_visibility (gdisp->gimage, SELECTION_PAUSE);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
1998-07-19 01:39:23 +08:00
|
|
|
/* add motion memory if you press mod1 first ^ perfectmouse */
|
2001-06-04 04:40:50 +08:00
|
|
|
if (((bevent->state & GDK_MOD1_MASK) != 0) != (gimprc.perfectmouse != 0))
|
1998-06-15 06:42:36 +08:00
|
|
|
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
|
|
|
GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
|
|
|
NULL, NULL, bevent->time);
|
|
|
|
else
|
|
|
|
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
1998-07-19 01:39:23 +08:00
|
|
|
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK,
|
1998-06-15 06:42:36 +08:00
|
|
|
NULL, NULL, bevent->time);
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
tool->gdisp = gdisp;
|
1998-06-15 06:42:36 +08:00
|
|
|
tool->state = ACTIVE;
|
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#warning FIXME: presure, tilt
|
|
|
|
|
|
|
|
b = ink_pen_ellipse (x, y,
|
2001-07-27 23:18:20 +08:00
|
|
|
1.0, 0.5, 0.5,
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
/* bevent->pressure, bevent->xtilt, bevent->ytilt, */
|
|
|
|
10.0);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
ink_paste (ink_tool, drawable, b);
|
|
|
|
ink_tool->last_blob = b;
|
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
time_smoother_init (ink_tool, bevent->time);
|
|
|
|
ink_tool->last_time = bevent->time;
|
|
|
|
dist_smoother_init (ink_tool, 0.0);
|
|
|
|
ink_tool->init_velocity = TRUE;
|
|
|
|
ink_tool->lastx = x;
|
|
|
|
ink_tool->lasty = y;
|
|
|
|
|
1998-10-05 04:16:17 +08:00
|
|
|
gdisplay_flush_now (gdisp);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_button_release (GimpTool *tool,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventButton *bevent,
|
2000-12-31 12:07:42 +08:00
|
|
|
GDisplay *gdisp)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
GimpInkTool *ink_tool;
|
|
|
|
GimpImage *gimage;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_tool = GIMP_INK_TOOL (tool);
|
|
|
|
|
|
|
|
gimage = gdisp->gimage;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* resume the current selection and ungrab the pointer */
|
2001-06-18 21:10:03 +08:00
|
|
|
gdisplays_selection_visibility (gdisp->gimage, SELECTION_RESUME);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
gdk_pointer_ungrab (bevent->time);
|
|
|
|
gdk_flush ();
|
|
|
|
|
|
|
|
/* Set tool state to inactive -- no longer painting */
|
|
|
|
tool->state = INACTIVE;
|
|
|
|
|
1999-07-14 17:44:58 +08:00
|
|
|
/* free the last blob */
|
|
|
|
g_free (ink_tool->last_blob);
|
|
|
|
ink_tool->last_blob = NULL;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_finish (ink_tool, gimp_image_active_drawable (gdisp->gimage));
|
1998-06-15 06:42:36 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
dist_smoother_init (GimpInkTool *ink_tool,
|
|
|
|
gdouble initval)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
ink_tool->dt_index = 0;
|
|
|
|
|
|
|
|
for (i=0; i<DIST_SMOOTHER_BUFFER; i++)
|
|
|
|
{
|
|
|
|
ink_tool->dt_buffer[i] = initval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gdouble
|
2001-02-28 08:10:58 +08:00
|
|
|
dist_smoother_result (GimpInkTool *ink_tool)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
gint i;
|
1999-04-10 22:55:17 +08:00
|
|
|
gdouble result = 0.0;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
for (i = 0; i < DIST_SMOOTHER_BUFFER; i++)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
result += ink_tool->dt_buffer[i];
|
|
|
|
}
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
return (result / (gdouble) DIST_SMOOTHER_BUFFER);
|
1999-04-10 22:55:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
dist_smoother_add (GimpInkTool *ink_tool,
|
|
|
|
gdouble value)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
ink_tool->dt_buffer[ink_tool->dt_index] = value;
|
|
|
|
|
|
|
|
if ((++ink_tool->dt_index) == DIST_SMOOTHER_BUFFER)
|
|
|
|
ink_tool->dt_index = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
time_smoother_init (GimpInkTool *ink_tool,
|
|
|
|
guint32 initval)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
ink_tool->ts_index = 0;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
for (i = 0; i < TIME_SMOOTHER_BUFFER; i++)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
ink_tool->ts_buffer[i] = initval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gdouble
|
2001-02-28 08:10:58 +08:00
|
|
|
time_smoother_result (GimpInkTool *ink_tool)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
gint i;
|
1999-04-10 22:55:17 +08:00
|
|
|
guint64 result = 0;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
for (i = 0; i < TIME_SMOOTHER_BUFFER; i++)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
result += ink_tool->ts_buffer[i];
|
|
|
|
}
|
|
|
|
|
Win32 portability changes:
* config.h.win32, README.win32: Small changes.
* tools/pdbgen/pdb/*.pdb: Include <string.h>.
* app/*_cmds.c: Autogenerated files reflect above changes.
* libgimp/makefile.msc app/makefile.msc: Various updates,
including new object files. Gtk+ directory now should be called
gtk+ (not gtk-plus). Use win32-specific gdk subdir. Glib directory
now should be called just glib.
* libgimp/gimp.def: Updates.
* libgimp/gimpfeatures.h.win32: Made current with
gimpfeatures.h.in.
* libgimp/gimpfileselection.c: Define S_ISDIR and S_ISREG if
necessary.
* tools/pdbgen/pdb/fileops.pdb: Must have a
statement (even an empty one) after a label.
* app/fileops_cmds.c: Autogenerated file reflects above changes.
* app/crop.c: Include <string.h>.
* app/{app_procs,batch,fileops,datafiles,errorconsole,general,
plug_in,temp_buf,tile_swap}.c: Test NATIVE_WIN32, not
_MSC_VER. (NATIVE_WIN32 means we are using the Microsoft C
runtime, even if we might be compiling with gcc.)
* app/fileops.c: Don't include <process.h> here.
* app/fileops.h: Do include <process.h> here.
* app/gimpparasite.c: Include config.h, guard inclusion of
<unistd.h>. (Is the inclusion of unistd.h in source files all over
the place really necessary?)
* app/ink.c: MSC doesn't handle conversion from unsigned __int64
to double, so cast to signed.
* app/lut_funcs.c: Include config.h, and define rint() if necessary.
* app/pixel_processor.c: Include config.h without "..", like in
all the other places. Include <string.h>
* app/text_tool.c: Guard the "POINTS" identifier that clashes with
<windows.h>, sigh.
1999-05-05 05:32:17 +08:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
return (gdouble) (gint64) (result / TIME_SMOOTHER_BUFFER);
|
|
|
|
#else
|
1999-04-10 22:55:17 +08:00
|
|
|
return (result / TIME_SMOOTHER_BUFFER);
|
Win32 portability changes:
* config.h.win32, README.win32: Small changes.
* tools/pdbgen/pdb/*.pdb: Include <string.h>.
* app/*_cmds.c: Autogenerated files reflect above changes.
* libgimp/makefile.msc app/makefile.msc: Various updates,
including new object files. Gtk+ directory now should be called
gtk+ (not gtk-plus). Use win32-specific gdk subdir. Glib directory
now should be called just glib.
* libgimp/gimp.def: Updates.
* libgimp/gimpfeatures.h.win32: Made current with
gimpfeatures.h.in.
* libgimp/gimpfileselection.c: Define S_ISDIR and S_ISREG if
necessary.
* tools/pdbgen/pdb/fileops.pdb: Must have a
statement (even an empty one) after a label.
* app/fileops_cmds.c: Autogenerated file reflects above changes.
* app/crop.c: Include <string.h>.
* app/{app_procs,batch,fileops,datafiles,errorconsole,general,
plug_in,temp_buf,tile_swap}.c: Test NATIVE_WIN32, not
_MSC_VER. (NATIVE_WIN32 means we are using the Microsoft C
runtime, even if we might be compiling with gcc.)
* app/fileops.c: Don't include <process.h> here.
* app/fileops.h: Do include <process.h> here.
* app/gimpparasite.c: Include config.h, guard inclusion of
<unistd.h>. (Is the inclusion of unistd.h in source files all over
the place really necessary?)
* app/ink.c: MSC doesn't handle conversion from unsigned __int64
to double, so cast to signed.
* app/lut_funcs.c: Include config.h, and define rint() if necessary.
* app/pixel_processor.c: Include config.h without "..", like in
all the other places. Include <string.h>
* app/text_tool.c: Guard the "POINTS" identifier that clashes with
<windows.h>, sigh.
1999-05-05 05:32:17 +08:00
|
|
|
#endif
|
1999-04-10 22:55:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
time_smoother_add (GimpInkTool *ink_tool,
|
|
|
|
guint32 value)
|
1999-04-10 22:55:17 +08:00
|
|
|
{
|
|
|
|
ink_tool->ts_buffer[ink_tool->ts_index] = value;
|
|
|
|
|
|
|
|
if ((++ink_tool->ts_index) == TIME_SMOOTHER_BUFFER)
|
|
|
|
ink_tool->ts_index = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_motion (GimpTool *tool,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventMotion *mevent,
|
2000-12-31 12:07:42 +08:00
|
|
|
GDisplay *gdisp)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
GimpInkTool *ink_tool;
|
1998-06-15 06:42:36 +08:00
|
|
|
GimpDrawable *drawable;
|
2000-12-31 12:07:42 +08:00
|
|
|
Blob *b, *blob_union;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
gdouble x, y;
|
|
|
|
gdouble pressure;
|
|
|
|
gdouble velocity;
|
|
|
|
gdouble dist;
|
1999-04-10 22:55:17 +08:00
|
|
|
gdouble lasttime, thistime;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_tool = GIMP_INK_TOOL (tool);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
gdisplay_untransform_coords_f (gdisp, mevent->x, mevent->y, &x, &y, TRUE);
|
2000-12-29 23:22:01 +08:00
|
|
|
drawable = gimp_image_active_drawable (gdisp->gimage);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
1999-04-10 22:55:17 +08:00
|
|
|
lasttime = ink_tool->last_time;
|
|
|
|
|
|
|
|
time_smoother_add (ink_tool, mevent->time);
|
2001-02-28 08:10:58 +08:00
|
|
|
thistime = ink_tool->last_time = time_smoother_result (ink_tool);
|
1999-04-10 22:55:17 +08:00
|
|
|
|
|
|
|
/* The time resolution on X-based GDK motion events is
|
|
|
|
bloody awful, hence the use of the smoothing function.
|
|
|
|
Sadly this also means that there is always the chance of
|
|
|
|
having an indeterminite velocity since this event and
|
|
|
|
the previous several may still appear to issue at the same
|
|
|
|
instant. -ADM */
|
|
|
|
|
|
|
|
if (thistime == lasttime)
|
|
|
|
thistime = lasttime + 1;
|
|
|
|
|
|
|
|
if (ink_tool->init_velocity)
|
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
dist_smoother_init (ink_tool,
|
|
|
|
dist = sqrt ((ink_tool->lastx-x) * (ink_tool->lastx-x) +
|
|
|
|
(ink_tool->lasty-y) * (ink_tool->lasty-y)));
|
1999-04-10 22:55:17 +08:00
|
|
|
ink_tool->init_velocity = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
dist_smoother_add (ink_tool,
|
|
|
|
sqrt ((ink_tool->lastx-x) * (ink_tool->lastx-x) +
|
|
|
|
(ink_tool->lasty-y) * (ink_tool->lasty-y)));
|
|
|
|
|
|
|
|
dist = dist_smoother_result (ink_tool);
|
1999-04-10 22:55:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ink_tool->lastx = x;
|
|
|
|
ink_tool->lasty = y;
|
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#warning FIXME: tilt, pressure
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
pressure = 1.0; /* mevent->pressure; */
|
2001-02-28 08:10:58 +08:00
|
|
|
velocity = 10.0 * sqrt ((dist) / (double) (thistime - lasttime));
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
#warning FIXME: tilt, pressure
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
b = ink_pen_ellipse (x, y, pressure, 0.5, 0.5,
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
/* mevent->xtilt, mevent->ytilt, */ velocity);
|
1998-06-15 06:42:36 +08:00
|
|
|
blob_union = blob_convex_union (ink_tool->last_blob, b);
|
|
|
|
g_free (ink_tool->last_blob);
|
|
|
|
ink_tool->last_blob = b;
|
|
|
|
|
|
|
|
ink_paste (ink_tool, drawable, blob_union);
|
|
|
|
g_free (blob_union);
|
2001-02-28 08:10:58 +08:00
|
|
|
|
1998-10-05 04:16:17 +08:00
|
|
|
gdisplay_flush_now (gdisp);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_cursor_update (GimpTool *tool,
|
1998-06-15 06:42:36 +08:00
|
|
|
GdkEventMotion *mevent,
|
2000-12-31 12:07:42 +08:00
|
|
|
GDisplay *gdisp)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-01-29 07:25:25 +08:00
|
|
|
GimpLayer *layer;
|
2000-12-31 12:07:42 +08:00
|
|
|
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
|
|
|
gint x, y;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2000-06-14 18:59:16 +08:00
|
|
|
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y,
|
|
|
|
&x, &y, FALSE, FALSE);
|
2000-12-29 23:22:01 +08:00
|
|
|
if ((layer = gimp_image_get_active_layer (gdisp->gimage)))
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
int off_x, off_y;
|
2000-06-14 18:59:16 +08:00
|
|
|
|
2001-01-15 05:11:52 +08:00
|
|
|
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
2000-06-14 18:59:16 +08:00
|
|
|
|
|
|
|
if (x >= off_x && y >= off_y &&
|
2001-01-15 05:11:52 +08:00
|
|
|
x < (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer))) &&
|
|
|
|
y < (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer))))
|
2000-06-14 18:59:16 +08:00
|
|
|
{
|
|
|
|
/* One more test--is there a selected region?
|
|
|
|
* if so, is cursor inside?
|
|
|
|
*/
|
|
|
|
if (gimage_mask_is_empty (gdisp->gimage))
|
|
|
|
ctype = GIMP_MOUSE_CURSOR;
|
|
|
|
else if (gimage_mask_value (gdisp->gimage, x, y))
|
|
|
|
ctype = GIMP_MOUSE_CURSOR;
|
|
|
|
}
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
2001-02-28 08:10:58 +08:00
|
|
|
|
2001-02-25 03:29:47 +08:00
|
|
|
gdisplay_install_tool_cursor (gdisp,
|
|
|
|
ctype,
|
|
|
|
GIMP_INK_TOOL_CURSOR,
|
|
|
|
GIMP_CURSOR_MODIFIER_NONE);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_control (GimpTool *tool,
|
1999-06-22 06:12:07 +08:00
|
|
|
ToolAction action,
|
2000-12-31 12:07:42 +08:00
|
|
|
GDisplay *gdisp)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
GimpInkTool *ink_tool;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_tool = GIMP_INK_TOOL (tool);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
switch (action)
|
|
|
|
{
|
1999-06-22 06:12:07 +08:00
|
|
|
case PAUSE:
|
1998-06-15 06:42:36 +08:00
|
|
|
break;
|
1999-06-22 06:12:07 +08:00
|
|
|
|
|
|
|
case RESUME:
|
1998-06-15 06:42:36 +08:00
|
|
|
break;
|
1999-06-22 06:12:07 +08:00
|
|
|
|
|
|
|
case HALT:
|
1998-06-15 06:42:36 +08:00
|
|
|
ink_cleanup ();
|
|
|
|
break;
|
1999-06-22 06:12:07 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_init (GimpInkTool *ink_tool,
|
2000-12-31 12:07:42 +08:00
|
|
|
GimpDrawable *drawable,
|
|
|
|
gdouble x,
|
|
|
|
gdouble y)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
/* free the block structures */
|
|
|
|
if (undo_tiles)
|
|
|
|
tile_manager_destroy (undo_tiles);
|
|
|
|
if (canvas_tiles)
|
|
|
|
tile_manager_destroy (canvas_tiles);
|
|
|
|
|
|
|
|
/* Allocate the undo structure */
|
2001-01-15 05:11:52 +08:00
|
|
|
undo_tiles = tile_manager_new (gimp_drawable_width (drawable),
|
|
|
|
gimp_drawable_height (drawable),
|
|
|
|
gimp_drawable_bytes (drawable));
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Allocate the canvas blocks structure */
|
2001-01-15 05:11:52 +08:00
|
|
|
canvas_tiles = tile_manager_new (gimp_drawable_width (drawable),
|
|
|
|
gimp_drawable_height (drawable), 1);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Get the initial undo extents */
|
|
|
|
ink_tool->x1 = ink_tool->x2 = x;
|
|
|
|
ink_tool->y1 = ink_tool->y2 = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_finish (GimpInkTool *ink_tool,
|
|
|
|
GimpDrawable *drawable)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
/* push an undo */
|
2001-07-08 06:49:01 +08:00
|
|
|
gimp_drawable_apply_image (drawable, ink_tool->x1, ink_tool->y1,
|
|
|
|
ink_tool->x2, ink_tool->y2, undo_tiles, TRUE);
|
1998-06-15 06:42:36 +08:00
|
|
|
undo_tiles = NULL;
|
|
|
|
|
|
|
|
/* invalidate the drawable--have to do it here, because
|
|
|
|
* it is not done during the actual painting.
|
|
|
|
*/
|
2001-02-05 06:10:54 +08:00
|
|
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable));
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ink_cleanup (void)
|
|
|
|
{
|
|
|
|
/* If the undo tiles exist, nuke them */
|
|
|
|
if (undo_tiles)
|
|
|
|
{
|
|
|
|
tile_manager_destroy (undo_tiles);
|
|
|
|
undo_tiles = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the canvas blocks exist, nuke them */
|
|
|
|
if (canvas_tiles)
|
|
|
|
{
|
|
|
|
tile_manager_destroy (canvas_tiles);
|
|
|
|
canvas_tiles = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free the temporary buffer if it exist */
|
|
|
|
if (canvas_buf)
|
2001-02-28 08:10:58 +08:00
|
|
|
{
|
|
|
|
temp_buf_free (canvas_buf);
|
|
|
|
canvas_buf = NULL;
|
|
|
|
}
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************
|
|
|
|
* Rendering functions *
|
|
|
|
*********************************/
|
|
|
|
|
|
|
|
/* Some of this stuff should probably be combined with the
|
|
|
|
* code it was copied from in paint_core.c; but I wanted
|
|
|
|
* to learn this stuff, so I've kept it simple.
|
|
|
|
*
|
|
|
|
* The following only supports CONSTANT mode. Incremental
|
|
|
|
* would, I think, interact strangely with the way we
|
|
|
|
* do things. But it wouldn't be hard to implement at all.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_set_paint_area (GimpInkTool *ink_tool,
|
1998-06-15 06:42:36 +08:00
|
|
|
GimpDrawable *drawable,
|
|
|
|
Blob *blob)
|
|
|
|
{
|
2000-12-31 12:07:42 +08:00
|
|
|
gint x, y, width, height;
|
|
|
|
gint x1, y1, x2, y2;
|
|
|
|
gint bytes;
|
2001-02-28 08:10:58 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
blob_bounds (blob, &x, &y, &width, &height);
|
|
|
|
|
2001-01-15 05:11:52 +08:00
|
|
|
bytes = gimp_drawable_has_alpha (drawable) ?
|
|
|
|
gimp_drawable_bytes (drawable) : gimp_drawable_bytes (drawable) + 1;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2001-01-15 05:11:52 +08:00
|
|
|
x1 = CLAMP (x/SUBSAMPLE - 1, 0, gimp_drawable_width (drawable));
|
|
|
|
y1 = CLAMP (y/SUBSAMPLE - 1, 0, gimp_drawable_height (drawable));
|
|
|
|
x2 = CLAMP ((x + width)/SUBSAMPLE + 2, 0, gimp_drawable_width (drawable));
|
|
|
|
y2 = CLAMP ((y + height)/SUBSAMPLE + 2, 0, gimp_drawable_height (drawable));
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* configure the canvas buffer */
|
|
|
|
if ((x2 - x1) && (y2 - y1))
|
|
|
|
canvas_buf = temp_buf_resize (canvas_buf, bytes, x1, y1,
|
|
|
|
(x2 - x1), (y2 - y1));
|
|
|
|
}
|
|
|
|
|
|
|
|
enum { ROW_START, ROW_STOP };
|
|
|
|
|
|
|
|
/* The insertion sort here, for SUBSAMPLE = 8, tends to beat out
|
|
|
|
* qsort() by 4x with CFLAGS=-O2, 2x with CFLAGS=-g
|
|
|
|
*/
|
2000-12-31 12:07:42 +08:00
|
|
|
static void
|
|
|
|
insert_sort (gint *data,
|
|
|
|
gint n)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2000-12-31 12:07:42 +08:00
|
|
|
gint i, j, k;
|
|
|
|
gint tmp1, tmp2;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
for (i=2; i<2*n; i+=2)
|
|
|
|
{
|
|
|
|
tmp1 = data[i];
|
|
|
|
tmp2 = data[i+1];
|
|
|
|
j = 0;
|
|
|
|
while (data[j] < tmp1)
|
|
|
|
j += 2;
|
|
|
|
|
|
|
|
for (k=i; k>j; k-=2)
|
|
|
|
{
|
|
|
|
data[k] = data[k-2];
|
|
|
|
data[k+1] = data[k-1];
|
|
|
|
}
|
|
|
|
|
|
|
|
data[j] = tmp1;
|
|
|
|
data[j+1] = tmp2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
fill_run (guchar *dest,
|
|
|
|
guchar alpha,
|
2000-12-31 12:07:42 +08:00
|
|
|
gint w)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
if (alpha == 255)
|
|
|
|
{
|
|
|
|
memset (dest, 255, w);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (w--)
|
|
|
|
{
|
1998-11-28 06:42:15 +08:00
|
|
|
*dest = MAX(*dest, alpha);
|
1998-06-15 06:42:36 +08:00
|
|
|
dest++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-12-31 12:07:42 +08:00
|
|
|
render_blob_line (Blob *blob,
|
|
|
|
guchar *dest,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
gint buf[4 * SUBSAMPLE];
|
|
|
|
gint *data = buf;
|
|
|
|
gint n = 0;
|
2000-12-31 12:07:42 +08:00
|
|
|
gint i, j;
|
|
|
|
gint current = 0; /* number of filled rows at this point
|
|
|
|
* in the scan line
|
|
|
|
*/
|
|
|
|
gint last_x;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Sort start and ends for all lines */
|
|
|
|
|
|
|
|
j = y * SUBSAMPLE - blob->y;
|
2001-02-28 08:10:58 +08:00
|
|
|
for (i = 0; i < SUBSAMPLE; i++)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
if (j >= blob->height)
|
|
|
|
break;
|
2001-02-28 08:10:58 +08:00
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
if ((j > 0) && (blob->data[j].left <= blob->data[j].right))
|
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
data[2 * n] = blob->data[j].left;
|
|
|
|
data[2 * n + 1] = ROW_START;
|
|
|
|
data[2 * SUBSAMPLE + 2 * n] = blob->data[j].right;
|
|
|
|
data[2 * SUBSAMPLE + 2 * n + 1] = ROW_STOP;
|
1998-06-15 06:42:36 +08:00
|
|
|
n++;
|
|
|
|
}
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we have less than SUBSAMPLE rows, compress */
|
|
|
|
if (n < SUBSAMPLE)
|
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
for (i = 0; i < 2 * n; i++)
|
|
|
|
data[2 * n + i] = data[2 * SUBSAMPLE + i];
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Now count start and end separately */
|
|
|
|
n *= 2;
|
|
|
|
|
|
|
|
insert_sort (data, n);
|
|
|
|
|
|
|
|
/* Discard portions outside of tile */
|
|
|
|
|
|
|
|
while ((n > 0) && (data[0] < SUBSAMPLE*x))
|
|
|
|
{
|
|
|
|
if (data[1] == ROW_START)
|
|
|
|
current++;
|
|
|
|
else
|
|
|
|
current--;
|
|
|
|
data += 2;
|
|
|
|
n--;
|
|
|
|
}
|
|
|
|
|
|
|
|
while ((n > 0) && (data[2*(n-1)] >= SUBSAMPLE*(x+width)))
|
|
|
|
n--;
|
|
|
|
|
|
|
|
/* Render the row */
|
|
|
|
|
|
|
|
last_x = 0;
|
2001-02-28 08:10:58 +08:00
|
|
|
for (i = 0; i < n;)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
gint cur_x = data[2 * i] / SUBSAMPLE - x;
|
2000-12-31 12:07:42 +08:00
|
|
|
gint pixel;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Fill in portion leading up to this pixel */
|
|
|
|
if (current && cur_x != last_x)
|
2001-02-28 08:10:58 +08:00
|
|
|
fill_run (dest + last_x, (255 * current) / SUBSAMPLE, cur_x - last_x);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Compute the value for this pixel */
|
|
|
|
pixel = current * SUBSAMPLE;
|
|
|
|
|
|
|
|
while (i<n)
|
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
gint tmp_x = data[2 * i] / SUBSAMPLE;
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
if (tmp_x - x != cur_x)
|
|
|
|
break;
|
|
|
|
|
2001-02-28 08:10:58 +08:00
|
|
|
if (data[2 * i + 1] == ROW_START)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
current++;
|
2001-02-28 08:10:58 +08:00
|
|
|
pixel += ((tmp_x + 1) * SUBSAMPLE) - data[2 * i];
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
current--;
|
2001-02-28 08:10:58 +08:00
|
|
|
pixel -= ((tmp_x + 1) * SUBSAMPLE) - data[2 * i];
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
dest[cur_x] = MAX (dest[cur_x], (pixel * 255) / (SUBSAMPLE * SUBSAMPLE));
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
last_x = cur_x + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (current != 0)
|
2001-02-28 08:10:58 +08:00
|
|
|
fill_run (dest + last_x, (255 * current)/ SUBSAMPLE, width - last_x);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-12-31 12:07:42 +08:00
|
|
|
render_blob (PixelRegion *dest,
|
|
|
|
Blob *blob)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2000-12-31 12:07:42 +08:00
|
|
|
gint i;
|
|
|
|
gint h;
|
|
|
|
guchar *s;
|
|
|
|
gpointer pr;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
for (pr = pixel_regions_register (1, dest);
|
|
|
|
pr != NULL;
|
|
|
|
pr = pixel_regions_process (pr))
|
|
|
|
{
|
|
|
|
h = dest->h;
|
|
|
|
s = dest->data;
|
|
|
|
|
|
|
|
for (i=0; i<h; i++)
|
|
|
|
{
|
|
|
|
render_blob_line (blob, s,
|
|
|
|
dest->x, dest->y + i, dest->w);
|
|
|
|
s += dest->rowstride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_paste (GimpInkTool *ink_tool,
|
1998-06-15 06:42:36 +08:00
|
|
|
GimpDrawable *drawable,
|
|
|
|
Blob *blob)
|
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
GimpImage *gimage;
|
2001-07-07 20:17:23 +08:00
|
|
|
GimpContext *context;
|
2000-12-31 12:07:42 +08:00
|
|
|
PixelRegion srcPR;
|
|
|
|
gint offx, offy;
|
|
|
|
gchar col[MAX_CHANNELS];
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2001-01-15 05:11:52 +08:00
|
|
|
if (! (gimage = gimp_drawable_gimage (drawable)))
|
1998-06-15 06:42:36 +08:00
|
|
|
return;
|
1998-08-17 07:54:51 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
context = gimp_get_current_context (gimage->gimp);
|
|
|
|
|
1998-06-15 06:42:36 +08:00
|
|
|
/* Get the the buffer */
|
|
|
|
ink_set_paint_area (ink_tool, drawable, blob);
|
1998-08-17 07:54:51 +08:00
|
|
|
|
|
|
|
/* check to make sure there is actually a canvas to draw on */
|
|
|
|
if (!canvas_buf)
|
|
|
|
return;
|
1998-06-15 06:42:36 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_get_foreground (gimage, drawable, col);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* set the alpha channel */
|
|
|
|
col[canvas_buf->bytes - 1] = OPAQUE_OPACITY;
|
|
|
|
|
|
|
|
/* color the pixels */
|
|
|
|
color_pixels (temp_buf_data (canvas_buf), col,
|
|
|
|
canvas_buf->width * canvas_buf->height, canvas_buf->bytes);
|
|
|
|
|
|
|
|
/* set undo blocks */
|
|
|
|
ink_set_undo_tiles (drawable,
|
|
|
|
canvas_buf->x, canvas_buf->y,
|
|
|
|
canvas_buf->width, canvas_buf->height);
|
|
|
|
|
|
|
|
/* initialize any invalid canvas tiles */
|
|
|
|
ink_set_canvas_tiles (canvas_buf->x, canvas_buf->y,
|
|
|
|
canvas_buf->width, canvas_buf->height);
|
|
|
|
|
|
|
|
ink_to_canvas_tiles (ink_tool, blob, col);
|
|
|
|
|
|
|
|
/* initialize canvas buf source pixel regions */
|
|
|
|
srcPR.bytes = canvas_buf->bytes;
|
|
|
|
srcPR.x = 0; srcPR.y = 0;
|
|
|
|
srcPR.w = canvas_buf->width;
|
|
|
|
srcPR.h = canvas_buf->height;
|
|
|
|
srcPR.rowstride = canvas_buf->width * canvas_buf->bytes;
|
|
|
|
srcPR.data = temp_buf_data (canvas_buf);
|
|
|
|
|
|
|
|
/* apply the paint area to the gimage */
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_apply_image (gimage, drawable, &srcPR,
|
|
|
|
FALSE,
|
2001-07-07 20:17:23 +08:00
|
|
|
(int) (gimp_context_get_opacity (context) * 255),
|
|
|
|
gimp_context_get_paint_mode (context),
|
2000-12-29 23:22:01 +08:00
|
|
|
undo_tiles, /* specify an alternative src1 */
|
|
|
|
canvas_buf->x, canvas_buf->y);
|
1998-06-15 06:42:36 +08:00
|
|
|
|
|
|
|
/* Update the undo extents */
|
|
|
|
ink_tool->x1 = MIN (ink_tool->x1, canvas_buf->x);
|
|
|
|
ink_tool->y1 = MIN (ink_tool->y1, canvas_buf->y);
|
|
|
|
ink_tool->x2 = MAX (ink_tool->x2, (canvas_buf->x + canvas_buf->width));
|
|
|
|
ink_tool->y2 = MAX (ink_tool->y2, (canvas_buf->y + canvas_buf->height));
|
|
|
|
|
|
|
|
/* Update the gimage--it is important to call gdisplays_update_area
|
|
|
|
* instead of drawable_update because we don't want the drawable
|
|
|
|
* preview to be constantly invalidated
|
|
|
|
*/
|
2001-01-15 05:11:52 +08:00
|
|
|
gimp_drawable_offsets (drawable, &offx, &offy);
|
1998-06-29 08:24:44 +08:00
|
|
|
gdisplays_update_area (gimage, canvas_buf->x + offx, canvas_buf->y + offy,
|
1998-06-15 06:42:36 +08:00
|
|
|
canvas_buf->width, canvas_buf->height);
|
|
|
|
}
|
|
|
|
|
1998-11-28 06:42:15 +08:00
|
|
|
/* This routine a) updates the representation of the stroke
|
|
|
|
* in the canvas tiles, then renders the dirty bit of it
|
|
|
|
* into canvas_buf.
|
|
|
|
*/
|
1998-06-15 06:42:36 +08:00
|
|
|
static void
|
2001-02-28 08:10:58 +08:00
|
|
|
ink_to_canvas_tiles (GimpInkTool *ink_tool,
|
|
|
|
Blob *blob,
|
|
|
|
guchar *color)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
|
|
|
PixelRegion srcPR, maskPR;
|
|
|
|
|
|
|
|
/* draw the blob on the canvas tiles */
|
|
|
|
pixel_region_init (&srcPR, canvas_tiles,
|
|
|
|
canvas_buf->x, canvas_buf->y,
|
|
|
|
canvas_buf->width, canvas_buf->height, TRUE);
|
|
|
|
|
|
|
|
render_blob (&srcPR, blob);
|
|
|
|
|
|
|
|
/* combine the canvas tiles and the canvas buf */
|
|
|
|
srcPR.bytes = canvas_buf->bytes;
|
|
|
|
srcPR.x = 0; srcPR.y = 0;
|
|
|
|
srcPR.w = canvas_buf->width;
|
|
|
|
srcPR.h = canvas_buf->height;
|
|
|
|
srcPR.rowstride = canvas_buf->width * canvas_buf->bytes;
|
|
|
|
srcPR.data = temp_buf_data (canvas_buf);
|
|
|
|
|
|
|
|
pixel_region_init (&maskPR, canvas_tiles,
|
|
|
|
canvas_buf->x, canvas_buf->y,
|
|
|
|
canvas_buf->width, canvas_buf->height, FALSE);
|
|
|
|
|
|
|
|
/* apply the canvas tiles to the canvas buf */
|
|
|
|
apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-05-01 05:11:27 +08:00
|
|
|
ink_set_undo_tiles (GimpDrawable *drawable,
|
2001-02-28 08:10:58 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-02-28 08:10:58 +08:00
|
|
|
gint i, j;
|
1998-06-15 06:42:36 +08:00
|
|
|
Tile *src_tile;
|
|
|
|
Tile *dest_tile;
|
|
|
|
|
|
|
|
for (i = y; i < (y + h); i += (TILE_HEIGHT - (i % TILE_HEIGHT)))
|
|
|
|
{
|
|
|
|
for (j = x; j < (x + w); j += (TILE_WIDTH - (j % TILE_WIDTH)))
|
|
|
|
{
|
1998-08-16 03:17:36 +08:00
|
|
|
dest_tile = tile_manager_get_tile (undo_tiles, j, i, FALSE, FALSE);
|
1998-08-12 01:35:34 +08:00
|
|
|
if (tile_is_valid (dest_tile) == FALSE)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2001-01-15 05:11:52 +08:00
|
|
|
src_tile = tile_manager_get_tile (gimp_drawable_data (drawable),
|
|
|
|
j, i, TRUE, FALSE);
|
1998-08-16 03:17:36 +08:00
|
|
|
tile_manager_map_tile (undo_tiles, j, i, src_tile);
|
1998-07-10 10:43:12 +08:00
|
|
|
tile_release (src_tile, FALSE);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2000-12-31 12:07:42 +08:00
|
|
|
ink_set_canvas_tiles (gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
2000-12-31 12:07:42 +08:00
|
|
|
gint i, j;
|
1998-06-15 06:42:36 +08:00
|
|
|
Tile *tile;
|
|
|
|
|
|
|
|
for (i = y; i < (y + h); i += (TILE_HEIGHT - (i % TILE_HEIGHT)))
|
|
|
|
{
|
|
|
|
for (j = x; j < (x + w); j += (TILE_WIDTH - (j % TILE_WIDTH)))
|
|
|
|
{
|
1998-08-16 03:17:36 +08:00
|
|
|
tile = tile_manager_get_tile (canvas_tiles, j, i, FALSE, FALSE);
|
1998-08-12 01:35:34 +08:00
|
|
|
if (tile_is_valid (tile) == FALSE)
|
1998-06-15 06:42:36 +08:00
|
|
|
{
|
1998-08-16 03:17:36 +08:00
|
|
|
tile = tile_manager_get_tile (canvas_tiles, j, i, TRUE, TRUE);
|
1998-08-12 01:35:34 +08:00
|
|
|
memset (tile_data_pointer (tile, 0, 0),
|
|
|
|
0,
|
|
|
|
tile_size (tile));
|
1998-07-10 10:43:12 +08:00
|
|
|
tile_release (tile, TRUE);
|
1998-06-15 06:42:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|