Show what line you are drawing when using <Shift> on paint-tools.

Needs some work for the clone-tool, since it seems to behave different then
the rest...


--Sven
This commit is contained in:
Sven Neumann 1999-05-15 00:02:47 +00:00
parent a4730edaf3
commit 5f464b9f5d
15 changed files with 243 additions and 104 deletions

View File

@ -1,3 +1,14 @@
Sat May 15 01:55:12 MEST 1999 Sven Neumann <sven@gimp.org>
* app/menus.c: Moved the seperator down so that it seperates the MRU
dialog from the rest.
* app/paint_core.c: Show the line you are drawing when using <Shift>
on paint_tools. Still need to figure out what's different about the
clone tool...
* app/blend.c
* app/cursorutil.c
* app/paintbrush.c: a little bit of code cleanup while I was on it
Sat May 15 00:06:06 BST 1999 Andy Thomas <alt@gimp.org> Sat May 15 00:06:06 BST 1999 Andy Thomas <alt@gimp.org>
* app/gdisplay.c * app/gdisplay.c

View File

@ -1113,13 +1113,13 @@ gradient_calc_shapeburst_dimpled_factor (double x,
} }
static double static double
gradient_repeat_none(double val) gradient_repeat_none (double val)
{ {
return BOUNDS(val, 0.0, 1.0); return BOUNDS(val, 0.0, 1.0);
} }
static double static double
gradient_repeat_sawtooth(double val) gradient_repeat_sawtooth (double val)
{ {
if (val >= 0.0) if (val >= 0.0)
return fmod(val, 1.0); return fmod(val, 1.0);
@ -1128,7 +1128,7 @@ gradient_repeat_sawtooth(double val)
} }
static double static double
gradient_repeat_triangular(double val) gradient_repeat_triangular (double val)
{ {
int ival; int ival;
@ -1228,7 +1228,7 @@ gradient_precalc_shapeburst (GImage *gimage,
static void static void
gradient_render_pixel(double x, double y, color_t *color, void *render_data) gradient_render_pixel (double x, double y, color_t *color, void *render_data)
{ {
RenderBlendData *rbd; RenderBlendData *rbd;
double factor; double factor;
@ -1321,7 +1321,7 @@ gradient_render_pixel(double x, double y, color_t *color, void *render_data)
static void static void
gradient_put_pixel(int x, int y, color_t color, void *put_pixel_data) gradient_put_pixel (int x, int y, color_t color, void *put_pixel_data)
{ {
PutPixelData *ppd; PutPixelData *ppd;
unsigned char *data; unsigned char *data;
@ -1568,7 +1568,7 @@ gradient_fill_region (GImage *gimage,
} }
static void static void
calc_rgb_to_hsv(double *r, double *g, double *b) calc_rgb_to_hsv (double *r, double *g, double *b)
{ {
double red, green, blue; double red, green, blue;
double h, s, v; double h, s, v;
@ -1640,7 +1640,7 @@ calc_rgb_to_hsv(double *r, double *g, double *b)
} }
static void static void
calc_hsv_to_rgb(double *h, double *s, double *v) calc_hsv_to_rgb (double *h, double *s, double *v)
{ {
double hue, saturation, value; double hue, saturation, value;
double f, p, q, t; double f, p, q, t;
@ -1738,7 +1738,8 @@ tools_new_blend ()
tool->button_press_func = blend_button_press; tool->button_press_func = blend_button_press;
tool->button_release_func = blend_button_release; tool->button_release_func = blend_button_release;
tool->motion_func = blend_motion; tool->motion_func = blend_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func; tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = blend_cursor_update; tool->cursor_update_func = blend_cursor_update;
tool->control_func = blend_control; tool->control_func = blend_control;
tool->preserve = TRUE; tool->preserve = TRUE;

View File

@ -1113,13 +1113,13 @@ gradient_calc_shapeburst_dimpled_factor (double x,
} }
static double static double
gradient_repeat_none(double val) gradient_repeat_none (double val)
{ {
return BOUNDS(val, 0.0, 1.0); return BOUNDS(val, 0.0, 1.0);
} }
static double static double
gradient_repeat_sawtooth(double val) gradient_repeat_sawtooth (double val)
{ {
if (val >= 0.0) if (val >= 0.0)
return fmod(val, 1.0); return fmod(val, 1.0);
@ -1128,7 +1128,7 @@ gradient_repeat_sawtooth(double val)
} }
static double static double
gradient_repeat_triangular(double val) gradient_repeat_triangular (double val)
{ {
int ival; int ival;
@ -1228,7 +1228,7 @@ gradient_precalc_shapeburst (GImage *gimage,
static void static void
gradient_render_pixel(double x, double y, color_t *color, void *render_data) gradient_render_pixel (double x, double y, color_t *color, void *render_data)
{ {
RenderBlendData *rbd; RenderBlendData *rbd;
double factor; double factor;
@ -1321,7 +1321,7 @@ gradient_render_pixel(double x, double y, color_t *color, void *render_data)
static void static void
gradient_put_pixel(int x, int y, color_t color, void *put_pixel_data) gradient_put_pixel (int x, int y, color_t color, void *put_pixel_data)
{ {
PutPixelData *ppd; PutPixelData *ppd;
unsigned char *data; unsigned char *data;
@ -1568,7 +1568,7 @@ gradient_fill_region (GImage *gimage,
} }
static void static void
calc_rgb_to_hsv(double *r, double *g, double *b) calc_rgb_to_hsv (double *r, double *g, double *b)
{ {
double red, green, blue; double red, green, blue;
double h, s, v; double h, s, v;
@ -1640,7 +1640,7 @@ calc_rgb_to_hsv(double *r, double *g, double *b)
} }
static void static void
calc_hsv_to_rgb(double *h, double *s, double *v) calc_hsv_to_rgb (double *h, double *s, double *v)
{ {
double hue, saturation, value; double hue, saturation, value;
double f, p, q, t; double f, p, q, t;
@ -1738,7 +1738,8 @@ tools_new_blend ()
tool->button_press_func = blend_button_press; tool->button_press_func = blend_button_press;
tool->button_release_func = blend_button_release; tool->button_release_func = blend_button_release;
tool->motion_func = blend_motion; tool->motion_func = blend_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func; tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = blend_cursor_update; tool->cursor_update_func = blend_cursor_update;
tool->control_func = blend_control; tool->control_func = blend_control;
tool->preserve = TRUE; tool->preserve = TRUE;

View File

@ -85,7 +85,7 @@ static gboolean pending_removebusy = FALSE;
static void static void
create_cursor(BM_Cursor *bmcursor) create_cursor (BM_Cursor *bmcursor)
{ {
GdkPixmap *pixmap; GdkPixmap *pixmap;
GdkPixmap *pixmapmsk; GdkPixmap *pixmapmsk;
@ -97,12 +97,12 @@ create_cursor(BM_Cursor *bmcursor)
pixmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits, pixmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits,
bmcursor->width, bmcursor->height); bmcursor->width, bmcursor->height);
g_return_if_fail(pixmap != NULL); g_return_if_fail (pixmap != NULL);
pixmapmsk = gdk_bitmap_create_from_data (NULL, bmcursor->mask_bits, pixmapmsk = gdk_bitmap_create_from_data (NULL, bmcursor->mask_bits,
bmcursor->width, bmcursor->width,
bmcursor->height); bmcursor->height);
g_return_if_fail(pixmapmsk != NULL); g_return_if_fail (pixmapmsk != NULL);
bmcursor->cursor = gdk_cursor_new_from_pixmap (pixmap, pixmapmsk, &fg, &bg, bmcursor->cursor = gdk_cursor_new_from_pixmap (pixmap, pixmapmsk, &fg, &bg,
bmcursor->x_hot, bmcursor->x_hot,
@ -111,7 +111,7 @@ create_cursor(BM_Cursor *bmcursor)
} }
static void static void
gimp_change_win_cursor(GdkWindow *win, GimpCursorType curtype) gimp_change_win_cursor (GdkWindow *win, GimpCursorType curtype)
{ {
GdkCursor *cursor; GdkCursor *cursor;

View File

@ -55,7 +55,6 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 }, { N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 }, { N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 }, { N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -67,6 +66,7 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 }, { N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" } { N_("/File/---"), NULL, NULL, 0, "<Separator>" }
}; };
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);

View File

@ -55,7 +55,6 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 }, { N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 }, { N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 }, { N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -67,6 +66,7 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 }, { N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" } { N_("/File/---"), NULL, NULL, 0, "<Separator>" }
}; };
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);

View File

@ -55,7 +55,6 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 }, { N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 }, { N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 }, { N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -67,6 +66,7 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 }, { N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" } { N_("/File/---"), NULL, NULL, 0, "<Separator>" }
}; };
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);

View File

@ -31,6 +31,7 @@
#include "layers_dialog.h" #include "layers_dialog.h"
#include "paint_funcs.h" #include "paint_funcs.h"
#include "paint_core.h" #include "paint_core.h"
#include "palette.h"
#include "selection.h" #include "selection.h"
#include "tools.h" #include "tools.h"
#include "undo.h" #include "undo.h"
@ -40,6 +41,10 @@
#include "tile.h" /* ick. */ #include "tile.h" /* ick. */
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x)) #define SQR(x) ((x) * (x))
#define EPSILON 0.00001 #define EPSILON 0.00001
@ -178,8 +183,8 @@ paint_core_button_press (tool, bevent, gdisp_ptr)
! (bevent->state & GDK_SHIFT_MASK)) ! (bevent->state & GDK_SHIFT_MASK))
{ {
/* initialize some values */ /* initialize some values */
paint_core->startx = paint_core->lastx = paint_core->curx; paint_core->startx = paint_core->lastx = paint_core->curx = x;
paint_core->starty = paint_core->lasty = paint_core->cury; paint_core->starty = paint_core->lasty = paint_core->cury = y;
paint_core->startpressure = paint_core->lastpressure = paint_core->curpressure; paint_core->startpressure = paint_core->lastpressure = paint_core->curpressure;
paint_core->startytilt = paint_core->lastytilt = paint_core->curytilt; paint_core->startytilt = paint_core->lastytilt = paint_core->curytilt;
paint_core->startxtilt = paint_core->lastxtilt = paint_core->curxtilt; paint_core->startxtilt = paint_core->lastxtilt = paint_core->curxtilt;
@ -221,7 +226,7 @@ paint_core_button_press (tool, bevent, gdisp_ptr)
if (paint_core->pick_colors if (paint_core->pick_colors
&& (bevent->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) && (bevent->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
{ {
paint_core_sample_color(drawable, x, y, bevent->state); paint_core_sample_color (drawable, x, y, bevent->state);
paint_core->pick_state = TRUE; paint_core->pick_state = TRUE;
return; return;
} }
@ -237,6 +242,7 @@ paint_core_button_press (tool, bevent, gdisp_ptr)
paint_core->lastpressure = paint_core->curpressure; paint_core->lastpressure = paint_core->curpressure;
paint_core->lastxtilt = paint_core->curxtilt; paint_core->lastxtilt = paint_core->curxtilt;
paint_core->lastytilt = paint_core->curytilt; paint_core->lastytilt = paint_core->curytilt;
;
} }
else else
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT); (* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
@ -268,6 +274,7 @@ paint_core_button_release (tool, bevent, gdisp_ptr)
(* paint_core->paint_func) (paint_core, gimage_active_drawable (gdisp->gimage), FINISH_PAINT); (* paint_core->paint_func) (paint_core, gimage_active_drawable (gdisp->gimage), FINISH_PAINT);
/* Set tool state to inactive -- no longer painting */ /* Set tool state to inactive -- no longer painting */
draw_core_stop (paint_core->core, tool);
tool->state = INACTIVE; tool->state = INACTIVE;
paint_core->pick_state = FALSE; paint_core->pick_state = FALSE;
@ -293,12 +300,11 @@ paint_core_motion (tool, mevent, gdisp_ptr)
if (paint_core->pick_state) if (paint_core->pick_state)
{ {
paint_core_sample_color(gimage_active_drawable (gdisp->gimage), paint_core_sample_color (gimage_active_drawable (gdisp->gimage),
paint_core->curx, paint_core->cury, mevent->state); paint_core->curx, paint_core->cury, mevent->state);
return; return;
} }
paint_core->curpressure = mevent->pressure; paint_core->curpressure = mevent->pressure;
paint_core->curxtilt = mevent->xtilt; paint_core->curxtilt = mevent->xtilt;
paint_core->curytilt = mevent->ytilt; paint_core->curytilt = mevent->ytilt;
@ -325,13 +331,17 @@ paint_core_cursor_update (tool, mevent, gdisp_ptr)
Layer *layer; Layer *layer;
PaintCore * paint_core; PaintCore * paint_core;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW; GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
int x, y;
gdisp = (GDisplay *) gdisp_ptr; gdisp = (GDisplay *) gdisp_ptr;
paint_core = (PaintCore *) tool->private; paint_core = (PaintCore *) tool->private;
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, /* undraw the current tool */
FALSE, FALSE); draw_core_pause (paint_core->core, tool);
/* Get the current coordinates */
gdisplay_untransform_coords_f (gdisp, (double) mevent->x, (double) mevent->y,
&paint_core->curx, &paint_core->cury, TRUE);
if ((layer = gimage_get_active_layer (gdisp->gimage))) if ((layer = gimage_get_active_layer (gdisp->gimage)))
{ {
int off_x, off_y; int off_x, off_y;
@ -342,19 +352,34 @@ paint_core_cursor_update (tool, mevent, gdisp_ptr)
{ {
ctype = GIMP_COLOR_PICKER_CURSOR; ctype = GIMP_COLOR_PICKER_CURSOR;
} }
else if (x >= off_x && y >= off_y && else if (paint_core->curx >= off_x && paint_core->cury >= off_y &&
x < (off_x + drawable_width (GIMP_DRAWABLE(layer))) && paint_core->curx < (off_x + drawable_width (GIMP_DRAWABLE(layer))) &&
y < (off_y + drawable_height (GIMP_DRAWABLE(layer)))) paint_core->cury < (off_y + drawable_height (GIMP_DRAWABLE(layer))))
{ {
/* One more test--is there a selected region? /* One more test--is there a selected region?
* if so, is cursor inside? * if so, is cursor inside?
*/ */
if (gimage_mask_is_empty (gdisp->gimage)) if (gimage_mask_is_empty (gdisp->gimage))
ctype = GDK_PENCIL; ctype = GDK_PENCIL;
else if (gimage_mask_value (gdisp->gimage, x, y)) else if (gimage_mask_value (gdisp->gimage, paint_core->curx, paint_core->cury))
ctype = GDK_PENCIL; ctype = GDK_PENCIL;
}
}
/* If shift is down and this is not the first paint stroke, draw a line */
if (gdisp_ptr == tool->gdisp_ptr && mevent->state & GDK_SHIFT_MASK)
{
if (paint_core->core->gc == NULL)
draw_core_start (paint_core->core, gdisp->canvas->window, tool);
else
{
/* is this a bad hack ? */
paint_core->core->paused_count = 0;
draw_core_resume (paint_core->core, tool);
}
}
} }
gdisplay_install_tool_cursor (gdisp, ctype); gdisplay_install_tool_cursor (gdisp, ctype);
} }
@ -382,17 +407,50 @@ paint_core_control (tool, action, gdisp_ptr)
break; break;
case HALT : case HALT :
(* paint_core->paint_func) (paint_core, drawable, FINISH_PAINT); (* paint_core->paint_func) (paint_core, drawable, FINISH_PAINT);
draw_core_stop (paint_core->core, tool);
paint_core_cleanup (); paint_core_cleanup ();
break; break;
} }
} }
void void
paint_core_no_draw (tool) paint_core_draw (tool)
Tool * tool; Tool * tool;
{ {
GDisplay *gdisp;
PaintCore * paint_core;
paint_core = (PaintCore *) tool->private;
/* if shift was never used, we don't care about a redraw */
if (paint_core->core->gc != NULL)
{
gdisp = (GDisplay *) tool->gdisp_ptr;
/* Draw start target */
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->lastx - (TARGET_WIDTH >> 1), paint_core->lasty,
paint_core->lastx + (TARGET_WIDTH >> 1), paint_core->lasty);
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->lastx, paint_core->lasty - (TARGET_HEIGHT >> 1),
paint_core->lastx, paint_core->lasty + (TARGET_HEIGHT >> 1));
/* Draw end target */
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->curx - (TARGET_WIDTH >> 1), paint_core->cury,
paint_core->curx + (TARGET_WIDTH >> 1), paint_core->cury);
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->curx, paint_core->cury - (TARGET_HEIGHT >> 1),
paint_core->curx, paint_core->cury + (TARGET_HEIGHT >> 1));
/* Draw the line between the start and end coords */
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->lastx, paint_core->lasty,
paint_core->curx, paint_core->cury);
}
return; return;
} }
Tool * Tool *
paint_core_new (type) paint_core_new (type)
@ -404,7 +462,7 @@ paint_core_new (type)
tool = (Tool *) g_malloc (sizeof (Tool)); tool = (Tool *) g_malloc (sizeof (Tool));
private = (PaintCore *) g_malloc (sizeof (PaintCore)); private = (PaintCore *) g_malloc (sizeof (PaintCore));
private->core = draw_core_new (paint_core_no_draw); private->core = draw_core_new (paint_core_draw);
private->pick_colors = FALSE; private->pick_colors = FALSE;
tool->type = type; tool->type = type;
@ -418,7 +476,8 @@ paint_core_new (type)
tool->button_press_func = paint_core_button_press; tool->button_press_func = paint_core_button_press;
tool->button_release_func = paint_core_button_release; tool->button_release_func = paint_core_button_release;
tool->motion_func = paint_core_motion; tool->motion_func = paint_core_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func; tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = paint_core_cursor_update; tool->cursor_update_func = paint_core_cursor_update;
tool->control_func = paint_core_control; tool->control_func = paint_core_control;
@ -514,7 +573,10 @@ paint_core_init (paint_core, drawable, x, y)
} }
void void
paint_core_get_color_from_gradient (PaintCore *paint_core, double gradient_length, double *r, double *g, double *b,double *a, int mode) paint_core_get_color_from_gradient (PaintCore *paint_core,
double gradient_length,
double *r, double *g, double *b, double *a,
int mode)
{ {
double y; double y;
double distance; /* distance in current brush stroke */ double distance; /* distance in current brush stroke */
@ -527,10 +589,10 @@ paint_core_get_color_from_gradient (PaintCore *paint_core, double gradient_lengt
/* if were past the first chunk... */ /* if were past the first chunk... */
if((y/gradient_length) > 1.0) if ((y/gradient_length) > 1.0)
{ {
/* if this is an "odd" chunk..." */ /* if this is an "odd" chunk..." */
if((int)(y/gradient_length) & 1) if ((int)(y/gradient_length) & 1)
{ {
/* draw it "normally" */ /* draw it "normally" */
y = y - (gradient_length*(int)(y/gradient_length)); y = y - (gradient_length*(int)(y/gradient_length));

View File

@ -384,7 +384,7 @@ paintbrush_motion (PaintCore *paint_core,
gimage_get_foreground (gimage, drawable, col); gimage_get_foreground (gimage, drawable, col);
/* Get a region which can be used to p\\aint to */ /* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable))) if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return; return;
@ -405,7 +405,7 @@ paintbrush_motion (PaintCore *paint_core,
temp_blend = local_blend; temp_blend = local_blend;
/* hard core to mode LOOP_TRIANGLE */ /* hard core to mode LOOP_TRIANGLE */
/* need to maek a gui to handle this */ /* need to make a gui to handle this */
mode = gradient_type; mode = gradient_type;
if(gradient_length) if(gradient_length)

View File

@ -1113,13 +1113,13 @@ gradient_calc_shapeburst_dimpled_factor (double x,
} }
static double static double
gradient_repeat_none(double val) gradient_repeat_none (double val)
{ {
return BOUNDS(val, 0.0, 1.0); return BOUNDS(val, 0.0, 1.0);
} }
static double static double
gradient_repeat_sawtooth(double val) gradient_repeat_sawtooth (double val)
{ {
if (val >= 0.0) if (val >= 0.0)
return fmod(val, 1.0); return fmod(val, 1.0);
@ -1128,7 +1128,7 @@ gradient_repeat_sawtooth(double val)
} }
static double static double
gradient_repeat_triangular(double val) gradient_repeat_triangular (double val)
{ {
int ival; int ival;
@ -1228,7 +1228,7 @@ gradient_precalc_shapeburst (GImage *gimage,
static void static void
gradient_render_pixel(double x, double y, color_t *color, void *render_data) gradient_render_pixel (double x, double y, color_t *color, void *render_data)
{ {
RenderBlendData *rbd; RenderBlendData *rbd;
double factor; double factor;
@ -1321,7 +1321,7 @@ gradient_render_pixel(double x, double y, color_t *color, void *render_data)
static void static void
gradient_put_pixel(int x, int y, color_t color, void *put_pixel_data) gradient_put_pixel (int x, int y, color_t color, void *put_pixel_data)
{ {
PutPixelData *ppd; PutPixelData *ppd;
unsigned char *data; unsigned char *data;
@ -1568,7 +1568,7 @@ gradient_fill_region (GImage *gimage,
} }
static void static void
calc_rgb_to_hsv(double *r, double *g, double *b) calc_rgb_to_hsv (double *r, double *g, double *b)
{ {
double red, green, blue; double red, green, blue;
double h, s, v; double h, s, v;
@ -1640,7 +1640,7 @@ calc_rgb_to_hsv(double *r, double *g, double *b)
} }
static void static void
calc_hsv_to_rgb(double *h, double *s, double *v) calc_hsv_to_rgb (double *h, double *s, double *v)
{ {
double hue, saturation, value; double hue, saturation, value;
double f, p, q, t; double f, p, q, t;
@ -1738,7 +1738,8 @@ tools_new_blend ()
tool->button_press_func = blend_button_press; tool->button_press_func = blend_button_press;
tool->button_release_func = blend_button_release; tool->button_release_func = blend_button_release;
tool->motion_func = blend_motion; tool->motion_func = blend_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func; tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = blend_cursor_update; tool->cursor_update_func = blend_cursor_update;
tool->control_func = blend_control; tool->control_func = blend_control;
tool->preserve = TRUE; tool->preserve = TRUE;

View File

@ -1113,13 +1113,13 @@ gradient_calc_shapeburst_dimpled_factor (double x,
} }
static double static double
gradient_repeat_none(double val) gradient_repeat_none (double val)
{ {
return BOUNDS(val, 0.0, 1.0); return BOUNDS(val, 0.0, 1.0);
} }
static double static double
gradient_repeat_sawtooth(double val) gradient_repeat_sawtooth (double val)
{ {
if (val >= 0.0) if (val >= 0.0)
return fmod(val, 1.0); return fmod(val, 1.0);
@ -1128,7 +1128,7 @@ gradient_repeat_sawtooth(double val)
} }
static double static double
gradient_repeat_triangular(double val) gradient_repeat_triangular (double val)
{ {
int ival; int ival;
@ -1228,7 +1228,7 @@ gradient_precalc_shapeburst (GImage *gimage,
static void static void
gradient_render_pixel(double x, double y, color_t *color, void *render_data) gradient_render_pixel (double x, double y, color_t *color, void *render_data)
{ {
RenderBlendData *rbd; RenderBlendData *rbd;
double factor; double factor;
@ -1321,7 +1321,7 @@ gradient_render_pixel(double x, double y, color_t *color, void *render_data)
static void static void
gradient_put_pixel(int x, int y, color_t color, void *put_pixel_data) gradient_put_pixel (int x, int y, color_t color, void *put_pixel_data)
{ {
PutPixelData *ppd; PutPixelData *ppd;
unsigned char *data; unsigned char *data;
@ -1568,7 +1568,7 @@ gradient_fill_region (GImage *gimage,
} }
static void static void
calc_rgb_to_hsv(double *r, double *g, double *b) calc_rgb_to_hsv (double *r, double *g, double *b)
{ {
double red, green, blue; double red, green, blue;
double h, s, v; double h, s, v;
@ -1640,7 +1640,7 @@ calc_rgb_to_hsv(double *r, double *g, double *b)
} }
static void static void
calc_hsv_to_rgb(double *h, double *s, double *v) calc_hsv_to_rgb (double *h, double *s, double *v)
{ {
double hue, saturation, value; double hue, saturation, value;
double f, p, q, t; double f, p, q, t;
@ -1738,7 +1738,8 @@ tools_new_blend ()
tool->button_press_func = blend_button_press; tool->button_press_func = blend_button_press;
tool->button_release_func = blend_button_release; tool->button_release_func = blend_button_release;
tool->motion_func = blend_motion; tool->motion_func = blend_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func; tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = blend_cursor_update; tool->cursor_update_func = blend_cursor_update;
tool->control_func = blend_control; tool->control_func = blend_control;
tool->preserve = TRUE; tool->preserve = TRUE;

View File

@ -31,6 +31,7 @@
#include "layers_dialog.h" #include "layers_dialog.h"
#include "paint_funcs.h" #include "paint_funcs.h"
#include "paint_core.h" #include "paint_core.h"
#include "palette.h"
#include "selection.h" #include "selection.h"
#include "tools.h" #include "tools.h"
#include "undo.h" #include "undo.h"
@ -40,6 +41,10 @@
#include "tile.h" /* ick. */ #include "tile.h" /* ick. */
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x)) #define SQR(x) ((x) * (x))
#define EPSILON 0.00001 #define EPSILON 0.00001
@ -178,8 +183,8 @@ paint_core_button_press (tool, bevent, gdisp_ptr)
! (bevent->state & GDK_SHIFT_MASK)) ! (bevent->state & GDK_SHIFT_MASK))
{ {
/* initialize some values */ /* initialize some values */
paint_core->startx = paint_core->lastx = paint_core->curx; paint_core->startx = paint_core->lastx = paint_core->curx = x;
paint_core->starty = paint_core->lasty = paint_core->cury; paint_core->starty = paint_core->lasty = paint_core->cury = y;
paint_core->startpressure = paint_core->lastpressure = paint_core->curpressure; paint_core->startpressure = paint_core->lastpressure = paint_core->curpressure;
paint_core->startytilt = paint_core->lastytilt = paint_core->curytilt; paint_core->startytilt = paint_core->lastytilt = paint_core->curytilt;
paint_core->startxtilt = paint_core->lastxtilt = paint_core->curxtilt; paint_core->startxtilt = paint_core->lastxtilt = paint_core->curxtilt;
@ -221,7 +226,7 @@ paint_core_button_press (tool, bevent, gdisp_ptr)
if (paint_core->pick_colors if (paint_core->pick_colors
&& (bevent->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) && (bevent->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
{ {
paint_core_sample_color(drawable, x, y, bevent->state); paint_core_sample_color (drawable, x, y, bevent->state);
paint_core->pick_state = TRUE; paint_core->pick_state = TRUE;
return; return;
} }
@ -237,6 +242,7 @@ paint_core_button_press (tool, bevent, gdisp_ptr)
paint_core->lastpressure = paint_core->curpressure; paint_core->lastpressure = paint_core->curpressure;
paint_core->lastxtilt = paint_core->curxtilt; paint_core->lastxtilt = paint_core->curxtilt;
paint_core->lastytilt = paint_core->curytilt; paint_core->lastytilt = paint_core->curytilt;
;
} }
else else
(* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT); (* paint_core->paint_func) (paint_core, drawable, MOTION_PAINT);
@ -268,6 +274,7 @@ paint_core_button_release (tool, bevent, gdisp_ptr)
(* paint_core->paint_func) (paint_core, gimage_active_drawable (gdisp->gimage), FINISH_PAINT); (* paint_core->paint_func) (paint_core, gimage_active_drawable (gdisp->gimage), FINISH_PAINT);
/* Set tool state to inactive -- no longer painting */ /* Set tool state to inactive -- no longer painting */
draw_core_stop (paint_core->core, tool);
tool->state = INACTIVE; tool->state = INACTIVE;
paint_core->pick_state = FALSE; paint_core->pick_state = FALSE;
@ -293,12 +300,11 @@ paint_core_motion (tool, mevent, gdisp_ptr)
if (paint_core->pick_state) if (paint_core->pick_state)
{ {
paint_core_sample_color(gimage_active_drawable (gdisp->gimage), paint_core_sample_color (gimage_active_drawable (gdisp->gimage),
paint_core->curx, paint_core->cury, mevent->state); paint_core->curx, paint_core->cury, mevent->state);
return; return;
} }
paint_core->curpressure = mevent->pressure; paint_core->curpressure = mevent->pressure;
paint_core->curxtilt = mevent->xtilt; paint_core->curxtilt = mevent->xtilt;
paint_core->curytilt = mevent->ytilt; paint_core->curytilt = mevent->ytilt;
@ -325,13 +331,17 @@ paint_core_cursor_update (tool, mevent, gdisp_ptr)
Layer *layer; Layer *layer;
PaintCore * paint_core; PaintCore * paint_core;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW; GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
int x, y;
gdisp = (GDisplay *) gdisp_ptr; gdisp = (GDisplay *) gdisp_ptr;
paint_core = (PaintCore *) tool->private; paint_core = (PaintCore *) tool->private;
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, /* undraw the current tool */
FALSE, FALSE); draw_core_pause (paint_core->core, tool);
/* Get the current coordinates */
gdisplay_untransform_coords_f (gdisp, (double) mevent->x, (double) mevent->y,
&paint_core->curx, &paint_core->cury, TRUE);
if ((layer = gimage_get_active_layer (gdisp->gimage))) if ((layer = gimage_get_active_layer (gdisp->gimage)))
{ {
int off_x, off_y; int off_x, off_y;
@ -342,19 +352,34 @@ paint_core_cursor_update (tool, mevent, gdisp_ptr)
{ {
ctype = GIMP_COLOR_PICKER_CURSOR; ctype = GIMP_COLOR_PICKER_CURSOR;
} }
else if (x >= off_x && y >= off_y && else if (paint_core->curx >= off_x && paint_core->cury >= off_y &&
x < (off_x + drawable_width (GIMP_DRAWABLE(layer))) && paint_core->curx < (off_x + drawable_width (GIMP_DRAWABLE(layer))) &&
y < (off_y + drawable_height (GIMP_DRAWABLE(layer)))) paint_core->cury < (off_y + drawable_height (GIMP_DRAWABLE(layer))))
{ {
/* One more test--is there a selected region? /* One more test--is there a selected region?
* if so, is cursor inside? * if so, is cursor inside?
*/ */
if (gimage_mask_is_empty (gdisp->gimage)) if (gimage_mask_is_empty (gdisp->gimage))
ctype = GDK_PENCIL; ctype = GDK_PENCIL;
else if (gimage_mask_value (gdisp->gimage, x, y)) else if (gimage_mask_value (gdisp->gimage, paint_core->curx, paint_core->cury))
ctype = GDK_PENCIL; ctype = GDK_PENCIL;
}
}
/* If shift is down and this is not the first paint stroke, draw a line */
if (gdisp_ptr == tool->gdisp_ptr && mevent->state & GDK_SHIFT_MASK)
{
if (paint_core->core->gc == NULL)
draw_core_start (paint_core->core, gdisp->canvas->window, tool);
else
{
/* is this a bad hack ? */
paint_core->core->paused_count = 0;
draw_core_resume (paint_core->core, tool);
}
}
} }
gdisplay_install_tool_cursor (gdisp, ctype); gdisplay_install_tool_cursor (gdisp, ctype);
} }
@ -382,17 +407,50 @@ paint_core_control (tool, action, gdisp_ptr)
break; break;
case HALT : case HALT :
(* paint_core->paint_func) (paint_core, drawable, FINISH_PAINT); (* paint_core->paint_func) (paint_core, drawable, FINISH_PAINT);
draw_core_stop (paint_core->core, tool);
paint_core_cleanup (); paint_core_cleanup ();
break; break;
} }
} }
void void
paint_core_no_draw (tool) paint_core_draw (tool)
Tool * tool; Tool * tool;
{ {
GDisplay *gdisp;
PaintCore * paint_core;
paint_core = (PaintCore *) tool->private;
/* if shift was never used, we don't care about a redraw */
if (paint_core->core->gc != NULL)
{
gdisp = (GDisplay *) tool->gdisp_ptr;
/* Draw start target */
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->lastx - (TARGET_WIDTH >> 1), paint_core->lasty,
paint_core->lastx + (TARGET_WIDTH >> 1), paint_core->lasty);
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->lastx, paint_core->lasty - (TARGET_HEIGHT >> 1),
paint_core->lastx, paint_core->lasty + (TARGET_HEIGHT >> 1));
/* Draw end target */
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->curx - (TARGET_WIDTH >> 1), paint_core->cury,
paint_core->curx + (TARGET_WIDTH >> 1), paint_core->cury);
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->curx, paint_core->cury - (TARGET_HEIGHT >> 1),
paint_core->curx, paint_core->cury + (TARGET_HEIGHT >> 1));
/* Draw the line between the start and end coords */
gdk_draw_line (gdisp->canvas->window, paint_core->core->gc,
paint_core->lastx, paint_core->lasty,
paint_core->curx, paint_core->cury);
}
return; return;
} }
Tool * Tool *
paint_core_new (type) paint_core_new (type)
@ -404,7 +462,7 @@ paint_core_new (type)
tool = (Tool *) g_malloc (sizeof (Tool)); tool = (Tool *) g_malloc (sizeof (Tool));
private = (PaintCore *) g_malloc (sizeof (PaintCore)); private = (PaintCore *) g_malloc (sizeof (PaintCore));
private->core = draw_core_new (paint_core_no_draw); private->core = draw_core_new (paint_core_draw);
private->pick_colors = FALSE; private->pick_colors = FALSE;
tool->type = type; tool->type = type;
@ -418,7 +476,8 @@ paint_core_new (type)
tool->button_press_func = paint_core_button_press; tool->button_press_func = paint_core_button_press;
tool->button_release_func = paint_core_button_release; tool->button_release_func = paint_core_button_release;
tool->motion_func = paint_core_motion; tool->motion_func = paint_core_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func; tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = paint_core_cursor_update; tool->cursor_update_func = paint_core_cursor_update;
tool->control_func = paint_core_control; tool->control_func = paint_core_control;
@ -514,7 +573,10 @@ paint_core_init (paint_core, drawable, x, y)
} }
void void
paint_core_get_color_from_gradient (PaintCore *paint_core, double gradient_length, double *r, double *g, double *b,double *a, int mode) paint_core_get_color_from_gradient (PaintCore *paint_core,
double gradient_length,
double *r, double *g, double *b, double *a,
int mode)
{ {
double y; double y;
double distance; /* distance in current brush stroke */ double distance; /* distance in current brush stroke */
@ -527,10 +589,10 @@ paint_core_get_color_from_gradient (PaintCore *paint_core, double gradient_lengt
/* if were past the first chunk... */ /* if were past the first chunk... */
if((y/gradient_length) > 1.0) if ((y/gradient_length) > 1.0)
{ {
/* if this is an "odd" chunk..." */ /* if this is an "odd" chunk..." */
if((int)(y/gradient_length) & 1) if ((int)(y/gradient_length) & 1)
{ {
/* draw it "normally" */ /* draw it "normally" */
y = y - (gradient_length*(int)(y/gradient_length)); y = y - (gradient_length*(int)(y/gradient_length));

View File

@ -384,7 +384,7 @@ paintbrush_motion (PaintCore *paint_core,
gimage_get_foreground (gimage, drawable, col); gimage_get_foreground (gimage, drawable, col);
/* Get a region which can be used to p\\aint to */ /* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable))) if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return; return;
@ -405,7 +405,7 @@ paintbrush_motion (PaintCore *paint_core,
temp_blend = local_blend; temp_blend = local_blend;
/* hard core to mode LOOP_TRIANGLE */ /* hard core to mode LOOP_TRIANGLE */
/* need to maek a gui to handle this */ /* need to make a gui to handle this */
mode = gradient_type; mode = gradient_type;
if(gradient_length) if(gradient_length)

View File

@ -85,7 +85,7 @@ static gboolean pending_removebusy = FALSE;
static void static void
create_cursor(BM_Cursor *bmcursor) create_cursor (BM_Cursor *bmcursor)
{ {
GdkPixmap *pixmap; GdkPixmap *pixmap;
GdkPixmap *pixmapmsk; GdkPixmap *pixmapmsk;
@ -97,12 +97,12 @@ create_cursor(BM_Cursor *bmcursor)
pixmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits, pixmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits,
bmcursor->width, bmcursor->height); bmcursor->width, bmcursor->height);
g_return_if_fail(pixmap != NULL); g_return_if_fail (pixmap != NULL);
pixmapmsk = gdk_bitmap_create_from_data (NULL, bmcursor->mask_bits, pixmapmsk = gdk_bitmap_create_from_data (NULL, bmcursor->mask_bits,
bmcursor->width, bmcursor->width,
bmcursor->height); bmcursor->height);
g_return_if_fail(pixmapmsk != NULL); g_return_if_fail (pixmapmsk != NULL);
bmcursor->cursor = gdk_cursor_new_from_pixmap (pixmap, pixmapmsk, &fg, &bg, bmcursor->cursor = gdk_cursor_new_from_pixmap (pixmap, pixmapmsk, &fg, &bg,
bmcursor->x_hot, bmcursor->x_hot,
@ -111,7 +111,7 @@ create_cursor(BM_Cursor *bmcursor)
} }
static void static void
gimp_change_win_cursor(GdkWindow *win, GimpCursorType curtype) gimp_change_win_cursor (GdkWindow *win, GimpCursorType curtype)
{ {
GdkCursor *cursor; GdkCursor *cursor;

View File

@ -55,7 +55,6 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 }, { N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 }, { N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 }, { N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -67,6 +66,7 @@ static const GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 }, { N_("/File/Dialogs/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" } { N_("/File/---"), NULL, NULL, 0, "<Separator>" }
}; };
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);