doh, XLFD stuff is in decipoints

* app/text_tool_cmds.c: doh, XLFD stuff is in decipoints

* app/color_cmds.h: removed

* app/color_cmds.c: pdbgened file now

* app/lut_funcs.h: export ChannelLutType enum

* app/internal_procs.c: register pdbgened color procs

* app/menus.c: reverted keyboard underlines since they need more discussion

-Yosh
This commit is contained in:
Manish Singh 1999-04-10 21:51:25 +00:00
parent 43f63f9fcd
commit c555988860
13 changed files with 724 additions and 866 deletions

View File

@ -1,35 +1,50 @@
Sat Apr 10 14:43:24 PDT 1999 Manish Singh <yosh@gimp.org>
* app/text_tool_cmds.c: doh, XLFD stuff is in decipoints
* app/color_cmds.h: removed
* app/color_cmds.c: pdbgened file now
* app/lut_funcs.h: export ChannelLutType enum
* app/internal_procs.c: register pdbgened color procs
* app/menus.c: reverted keyboard underlines since they need more
discussion
Sat Apr 10 15:48:46 BST 1999 Adam D. Moss <adam@gimp.org>
* app/ink.c: Velocity-sensitivity added to ink tool.
Fri Apr 9 21:45:10 PDT 1999 Manish Singh <yosh@gimp.org>
* text_tool_cmds.c: new file (from pdbgen)
* app/text_tool_cmds.c: new file (from pdbgen)
* Makefile.am: add new file, use AM_CPPFLAGS instead of CPPFLAGS
* app/Makefile.am: add new file, use AM_CPPFLAGS instead of CPPFLAGS
* internal_procs.c: register pdbgened text_tool procs
* app/internal_procs.c: register pdbgened text_tool procs
* text_tool.c: remove PDB stuff, export text_render and
* app/text_tool.c: remove PDB stuff, export text_render and
text_get_extents and SizeType and SUPERSAMPLE symbols
* text_tool.c: remove PDB stuff
* app/text_tool.c: remove PDB stuff
* blend.[ch]
* bucket_fill.[ch]
* clone.[ch]
* convolve.[ch]: export some enums
* app/blend.[ch]
* app/bucket_fill.[ch]
* app/clone.[ch]
* app/convolve.[ch]: export some enums
* channel.h
* paint_core.h: #define->enum
* app/channel.h
* app/paint_core.h: #define->enum
* channel.c
* gimpparasite.c
* parasitelist.c
* pixel_processor.c: warning cleanup
* app/channel.c
* app/gimpparasite.c
* app/parasitelist.c
* app/pixel_processor.c: warning cleanup
* convert_cmds.c
* paths_cmds.c: slight pdbgen changes
* app/convert_cmds.c
* app/paths_cmds.c: slight pdbgen changes
1999-04-09 Jay Cox <jaycox@earthlink.net>

View File

@ -78,7 +78,6 @@ gimp_SOURCES = \
color_balance.c \
color_balance.h \
color_cmds.c \
color_cmds.h \
color_notebook.c \
color_notebook.h \
color_panel.c \
@ -199,6 +198,7 @@ gimp_SOURCES = \
gimphistogram.c \
gimphistogram.h \
gimphistogramP.h \
gimphistogramF.h \
gimpunit.c \
global_edit.c \
global_edit.h \

View File

@ -22,6 +22,15 @@
#include "gimplutF.h"
#include "gimphistogramF.h"
typedef enum /*< chop=_LUT >*/
{
VALUE_LUT, /*< nick=VALUE/GRAY >*/
RED_LUT,
GREEN_LUT,
BLUE_LUT,
GRAY_LUT = 0 /*< skip >*/
} ChannelLutType;
/* brightness contrast */
void brightness_contrast_lut_setup (GimpLut *lut,
double brightness, double contrast,

View File

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-1999 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
@ -16,442 +16,345 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "color_cmds.h"
#include "gimpimage.h"
/* NOTE: This file is autogenerated by pdbgen.pl. */
#include "procedural_db.h"
#include "drawable.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplut.h"
#include "lut_funcs.h"
static Argument * brightness_contrast_invoker (Argument *);
static Argument * levels_invoker (Argument *);
static Argument * posterize_invoker (Argument *);
static ProcRecord brightness_contrast_proc;
static ProcRecord levels_proc;
static ProcRecord posterize_proc;
/* ------------------------------------------------------------------ */
/* --------- The brightness_contrast procedure definition ---------- */
/* ------------------------------------------------------------------ */
ProcArg brightness_contrast_args[] =
void
register_color_procs (void)
{
{ PDB_DRAWABLE,
"drawable",
"the drawable"
},
{ PDB_INT32,
"brightness",
"brightness adjustment: (-127 <= brightness <= 127)"
},
{ PDB_INT32,
"contrast",
"constrast adjustment: (-127 <= contrast <= 127)"
}
};
ProcRecord brightness_contrast_proc =
{
"gimp_brightness_contrast",
"Modify brightness/contrast in the specified drawable",
"This procedures allows the brightness and contrast of the specified drawable to be modified. Both 'brightness' and 'contrast' parameters are defined between -127 and 127.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
PDB_INTERNAL,
/* Input arguments */
3,
brightness_contrast_args,
/* Output arguments */
0,
NULL,
/* Exec method */
{ { brightness_contrast_invoker } },
};
procedural_db_register (&brightness_contrast_proc);
procedural_db_register (&levels_proc);
procedural_db_register (&posterize_proc);
}
static Argument *
brightness_contrast_invoker (Argument *args)
{
PixelRegion srcPR, destPR;
int success = TRUE;
int int_value;
GimpImage *gimage;
int brightness;
int contrast;
int x1, y1, x2, y2;
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 brightness;
gint32 contrast;
GimpImage *gimage;
GimpLut *lut;
PixelRegion srcPR, destPR;
int x1, y1, x2, y2;
drawable = NULL;
brightness = 0;
contrast = 0;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
brightness = args[1].value.pdb_int;
if (brightness < -127 || brightness > 127)
success = FALSE;
contrast = args[2].value.pdb_int;
if (contrast < -127 || contrast > 127)
success = FALSE;
/* the drawable */
if (success)
{
int_value = args[0].value.pdb_int;
drawable = gimp_drawable_get_ID (int_value);
if (drawable == NULL)
if (gimp_drawable_indexed (drawable))
success = FALSE;
else
gimage = gimp_drawable_gimage (drawable);
}
/* make sure the drawable is not indexed color */
if (success)
success = ! gimp_drawable_indexed (drawable);
/* brightness */
if (success)
{
int_value = args[1].value.pdb_int;
if (int_value < -127 || int_value > 127)
success = FALSE;
else
brightness = int_value;
}
/* contrast */
if (success)
{
int_value = args[2].value.pdb_int;
if (int_value < -127 || int_value > 127)
success = FALSE;
else
contrast = int_value;
}
/* arrange to modify the brightness/contrast */
if (success)
{
GimpLut *lut;
lut = brightness_contrast_lut_new(brightness / 255.0, contrast / 127.0,
gimp_drawable_bytes(drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel((p_func)gimp_lut_process, lut,
2, &srcPR, &destPR);
gimp_lut_free(lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
{
gimage = gimp_drawable_gimage (drawable);
lut = brightness_contrast_lut_new (brightness / 255.0,
contrast / 127.0,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
}
return procedural_db_return_args (&brightness_contrast_proc, success);
}
/* ------------------------------------------------------------------ */
/* ---------------- The levels procedure definition ----------------- */
/* ------------------------------------------------------------------ */
ProcArg levels_args[] =
static ProcArg brightness_contrast_inargs[] =
{
{ PDB_DRAWABLE,
{
PDB_DRAWABLE,
"drawable",
"the drawable"
"The drawable"
},
{ PDB_INT32,
"channel",
"the channel to modify: { VALUE (0), RED (1), GREEN (2), BLUE (3), GRAY (0) }"
{
PDB_INT32,
"brightness",
"Brightness adjustment: (-127 <= brightness <= 127)"
},
{ PDB_INT32,
"low_input",
"intensity of lowest input: (0 <= low_input <= 255)"
},
{ PDB_INT32,
"high_input",
"intensity of highest input: (0 <= high_input <= 255)"
},
{ PDB_FLOAT,
"gamma",
"gamma correction factor: (0.1 <= gamma <= 10)"
},
{ PDB_INT32,
"low_output",
"intensity of lowest output: (0 <= low_input <= 255)"
},
{ PDB_INT32,
"high_output",
"intensity of highest output: (0 <= high_input <= 255)"
{
PDB_INT32,
"contrast",
"Contrast adjustment: (-127 <= contrast <= 127)"
}
};
ProcRecord levels_proc =
static ProcRecord brightness_contrast_proc =
{
"gimp_levels",
"Modifies intensity levels in the specified drawable",
"This tool allows intensity levels in the specified drawable to be remapped according to a set of parameters. The low/high input levels specify an initial mapping from the source intensities. The gamma value determines how intensities between the low and high input intensities are interpolated. A gamma value of 1.0 results in a linear interpolation. Higher gamma values result in more high-level intensities. Lower gamma values result in more low-level intensities. The low/high output levels constrain the final intensity mapping--that is, no final intensity will be lower than the low output level and no final intensity will be higher than the high output level. This tool is only valid on RGB color and grayscale images. It will not operate on indexed drawables.",
"gimp_brightness_contrast",
"Modify brightness/contrast in the specified drawable.",
"This procedures allows the brightness and contrast of the specified drawable to be modified. Both 'brightness' and 'contrast' parameters are defined between -127 and 127.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
"1997",
PDB_INTERNAL,
/* Input arguments */
7,
levels_args,
/* Output arguments */
3,
brightness_contrast_inargs,
0,
NULL,
/* Exec method */
{ { levels_invoker } },
{ { brightness_contrast_invoker } }
};
static Argument *
levels_invoker (Argument *args)
{
PixelRegion srcPR, destPR;
int success = TRUE;
gboolean success = TRUE;
GimpDrawable *drawable;
int channel;
int low_inputv;
int high_inputv;
double gammav;
int low_outputv;
int high_outputv;
int int_value;
double fp_value;
gint32 channel;
gint32 low_inputv;
gint32 high_inputv;
gdouble gammav;
gint32 low_outputv;
gint32 high_outputv;
PixelRegion srcPR, destPR;
int x1, y1, x2, y2;
GimpLut *lut;
int i;
int low_input[5];
double gamma[5];
int high_input[5];
int low_output[5];
int high_output[5];
int low_input[5];
int high_input[5];
double gamma[5];
int low_output[5];
int high_output[5];
drawable = NULL;
low_inputv = 0;
high_inputv = 0;
gammav = 1.0;
low_outputv = 0;
high_outputv = 0;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
channel = args[1].value.pdb_int;
if (channel < VALUE_LUT || channel > BLUE_LUT)
success = FALSE;
low_inputv = args[2].value.pdb_int;
if (low_inputv < 0 || low_inputv > 255)
success = FALSE;
high_inputv = args[3].value.pdb_int;
if (high_inputv < 0 || high_inputv > 255)
success = FALSE;
gammav = args[4].value.pdb_float;
if (gammav < 0.1 || gammav > 10.0)
success = FALSE;
low_outputv = args[5].value.pdb_int;
if (low_outputv < 0 || low_outputv > 255)
success = FALSE;
high_outputv = args[6].value.pdb_int;
if (high_outputv < 0 || high_outputv > 255)
success = FALSE;
/* the drawable */
if (success)
{
int_value = args[0].value.pdb_int;
drawable = gimp_drawable_get_ID (int_value);
if (drawable == NULL)
success = FALSE;
}
/* make sure the drawable is not indexed color */
if (success)
success = ! gimp_drawable_indexed (drawable);
/* channel */
if (success)
{
int_value = args[1].value.pdb_int;
if (success)
if (gimp_drawable_indexed (drawable) ||
(gimp_drawable_gray (drawable) && channel != GRAY))
success = FALSE;
else
{
if (gimp_drawable_gray (drawable))
for (i = 0; i < 5; i++)
{
if (int_value != 0)
success = FALSE;
low_input[i] = 0;
high_input[i] = 255;
low_output[i] = 0;
high_output[i] = 255;
gamma[i] = 1.0;
}
else if (gimp_drawable_color (drawable))
{
if (int_value < 0 || int_value > 3)
success = FALSE;
}
else
success = FALSE;
low_input[channel] = low_inputv;
high_input[channel] = high_inputv;
gamma[channel] = gammav;
low_output[channel] = low_outputv;
high_output[channel] = high_outputv;
/* setup the lut */
lut = levels_lut_new (gamma, low_input, high_input,
low_output, high_output,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free(lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
channel = int_value;
}
/* low input */
if (success)
{
int_value = args[2].value.pdb_int;
if (int_value >= 0 && int_value < 256)
low_inputv = int_value;
else
success = FALSE;
}
/* high input */
if (success)
{
int_value = args[3].value.pdb_int;
if (int_value >= 0 && int_value < 256)
high_inputv = int_value;
else
success = FALSE;
}
/* gamma */
if (success)
{
fp_value = args[4].value.pdb_float;
if (fp_value >= 0.1 && fp_value <= 10.0)
gammav = fp_value;
else
success = FALSE;
}
/* low output */
if (success)
{
int_value = args[5].value.pdb_int;
if (int_value >= 0 && int_value < 256)
low_outputv = int_value;
else
success = FALSE;
}
/* high output */
if (success)
{
int_value = args[6].value.pdb_int;
if (int_value >= 0 && int_value < 256)
high_outputv = int_value;
else
success = FALSE;
}
/* arrange to modify the levels */
if (success)
{
GimpLut *lut;
for (i = 0; i < 5; i++)
{
low_input[i] = 0;
gamma[i] = 1.0;
high_input[i] = 255;
low_output[i] = 0;
high_output[i] = 255;
}
low_input[channel] = low_inputv;
high_input[channel] = high_inputv;
gamma[channel] = gammav;
low_output[channel] = low_outputv;
high_output[channel] = high_outputv;
/* setup the lut */
lut = levels_lut_new(gamma, low_input, high_input,
low_output, high_output,
gimp_drawable_bytes(drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel((p_func)gimp_lut_process, lut,
2, &srcPR, &destPR);
gimp_lut_free(lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
return procedural_db_return_args (&levels_proc, success);
}
/* ------------------------------------------------------------------ */
/* ---------------- The posterize procedure definition -------------- */
/* ------------------------------------------------------------------ */
ProcArg posterize_args[] =
static ProcArg levels_inargs[] =
{
{ PDB_DRAWABLE,
{
PDB_DRAWABLE,
"drawable",
"the drawable"
"The drawable"
},
{ PDB_INT32,
"levels",
"levels of posterization: (2 <= levels <= 255)"
{
PDB_INT32,
"channel",
"The channel to modify: { VALUE/GRAY (0), RED (1), GREEN (2), BLUE (3) }"
},
{
PDB_INT32,
"low_input",
"Intensity of lowest input: (0 <= low_input <= 255)"
},
{
PDB_INT32,
"high_input",
"Intensity of highest input: (0 <= high_input <= 255)"
},
{
PDB_FLOAT,
"gamma",
"Gamma correction factor: (0.1 <= gamma <= 10)"
},
{
PDB_INT32,
"low_output",
"Intensity of lowest output: (0 <= low_output <= 255)"
},
{
PDB_INT32,
"high_output",
"Intensity of highest output: (0 <= high_output <= 255)"
}
};
ProcRecord posterize_proc =
static ProcRecord levels_proc =
{
"gimp_levels",
"Modifies intensity levels in the specified drawable.",
"This tool allows intensity levels in the specified drawable to be remapped according to a set of parameters. The low/high input levels specify an initial mapping from the source intensities. The gamma value determines how intensities between the low and high input intensities are interpolated. A gamma value of 1.0 results in a linear interpolation. Higher gamma values result in more high-level intensities. Lower gamma values result in more low-level intensities. The low/high output levels constrain the final intensity mapping--that is, no final intensity will be lower than the low output level and no final intensity will be higher than the high output level. This tool is only valid on RGB color and grayscale images. It will not operate on indexed drawables.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
PDB_INTERNAL,
7,
levels_inargs,
0,
NULL,
{ { levels_invoker } }
};
static Argument *
posterize_invoker (Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 levels;
GimpImage *gimage;
GimpLut *lut;
PixelRegion srcPR, destPR;
int x1, y1, x2, y2;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
levels = args[1].value.pdb_int;
if (levels < 2 || levels > 255)
success = FALSE;
if (success)
{
if (gimp_drawable_indexed (drawable))
success = FALSE;
else
{
gimage = gimp_drawable_gimage (drawable);
lut = posterize_lut_new (levels, gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
}
return procedural_db_return_args (&posterize_proc, success);
}
static ProcArg posterize_inargs[] =
{
{
PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
PDB_INT32,
"levels",
"Levels of posterization: (2 <= levels <= 255)"
}
};
static ProcRecord posterize_proc =
{
"gimp_posterize",
"Posterize the specified drawable",
"Posterize the specified drawable.",
"This procedures reduces the number of shades allows in each intensity channel to the specified 'levels' parameter.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
PDB_INTERNAL,
/* Input arguments */
2,
posterize_args,
/* Output arguments */
posterize_inargs,
0,
NULL,
/* Exec method */
{ { posterize_invoker } },
{ { posterize_invoker } }
};
static Argument *
posterize_invoker (Argument *args)
{
PixelRegion srcPR, destPR;
int success = TRUE;
GimpImage *gimage;
GimpDrawable *drawable;
int levels;
int int_value;
int x1, y1, x2, y2;
drawable = NULL;
levels = 0;
/* the drawable */
if (success)
{
int_value = args[0].value.pdb_int;
drawable = gimp_drawable_get_ID (int_value);
if (drawable == NULL)
success = FALSE;
else
gimage = gimp_drawable_gimage (drawable);
}
/* make sure the drawable is not indexed color */
if (success)
success = ! gimp_drawable_indexed (drawable);
/* levels */
if (success)
{
int_value = args[1].value.pdb_int;
if (int_value >= 2 && int_value < 256)
levels = int_value;
else
success = FALSE;
}
/* arrange to modify the levels */
if (success)
{
GimpLut *lut;
lut = posterize_lut_new(levels, gimp_drawable_bytes(drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel((p_func)gimp_lut_process, lut,
2, &srcPR, &destPR);
gimp_lut_free(lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
return procedural_db_return_args (&posterize_proc, success);
}

View File

@ -1,28 +0,0 @@
/* 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.
*/
#ifndef __COLOR_CMDS_H__
#define __COLOR_CMDS_H__
#include "procedural_db.h"
extern ProcRecord brightness_contrast_proc;
extern ProcRecord levels_proc;
extern ProcRecord posterize_proc;
#endif /* __COLOR_CMDS_H__ */

View File

@ -50,130 +50,119 @@ static GSList *last_opened_raw_filenames = NULL;
static const GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Dialogs"), "", NULL, 0, "<Branch>" },
{ 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/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/_Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/_Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/D_ocument Index..."), NULL, raise_idea_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/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ 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/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_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/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
};
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
static GtkItemFactory *toolbox_factory = NULL;
static const GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "<Separator>" };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry image_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save _as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/_Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/_Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Edit"), "", NULL, 0, "<Branch>" },
{ N_("/Edit/Cu_t"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/_Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/_Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste _Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/C_lear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/_Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/_Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/_Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/_Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/Clear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/Cut _Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Cop_y Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Past_e Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/Cut Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Copy Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Select"), "", NULL, 0, "<Branch>" },
{ N_("/Select/_Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/_Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/_All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/_None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/_Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/_Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/_Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/F_eather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/_Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/S_hrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To _Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/Feather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/_View"), "", NULL, 0, "<Branch>" },
{ N_("/View/Zoom _In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom _Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/1_6:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/_8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/_4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/_2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/_1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 },
{ N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 },
{ N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 },
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/_Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/_Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle _Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle S_tatusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle _Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/_Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/_New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/S_hrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/_Image"), "", NULL, 0, "<Branch>" },
{ N_("/Image/_Colors"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Colors/_Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/_Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/_Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/C_hannel Ops"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Channel Ops/_Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/_Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/_Alpha"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Alpha/_Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/_RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/_Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/_Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/R_esize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/_Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Layers"), "", NULL, 0, "<Branch>" },
{ N_("/Layers/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/_Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/L_ower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/_Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/_Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/_Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Al_pha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Ma_sk To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/A_dd Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/Lower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
/* these are built on the fly */
@ -206,29 +195,26 @@ static const GtkItemFactoryEntry image_entries[] =
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/_Tools"), "", NULL, 0, "<Branch>" },
{ N_("/Tools/_Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/_Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/_Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filte_rs"), "", NULL, 0, "<Branch>" },
{ N_("/Filters/_Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-_show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/_Dialogs"), "", NULL, 0, "<Branch>" },
{ N_("/Dialogs/_Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/_Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/_Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/I_nput Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
};
static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]);
static GtkItemFactory *image_factory = NULL;

View File

@ -30,7 +30,6 @@
#include "channel_ops.h"
#include "clone.h"
#include "color_balance.h"
#include "color_cmds.h"
#include "color_picker.h"
#include "convolve.h"
#include "crop.h"
@ -76,6 +75,7 @@ void register_paths_procs (void);
void register_palette_procs (void);
void register_unit_procs (void);
void register_text_tool_procs (void);
void register_color_procs (void);
void
internal_procs_init ()
@ -368,16 +368,16 @@ internal_procs_init ()
procedural_db_register (&equalize_proc); pcount++;
procedural_db_register (&invert_proc); pcount++;
procedural_db_register (&brightness_contrast_proc); pcount++;
procedural_db_register (&curves_spline_proc); pcount++;
procedural_db_register (&curves_explicit_proc); pcount++;
procedural_db_register (&color_balance_proc); pcount++;
procedural_db_register (&histogram_proc); pcount++;
procedural_db_register (&hue_saturation_proc); pcount++;
procedural_db_register (&levels_proc); pcount++;
procedural_db_register (&posterize_proc); pcount++;
procedural_db_register (&threshold_proc); pcount++;
register_color_procs ();
pcount += 3;
register_convert_procs ();
pcount += 4;

View File

@ -22,6 +22,15 @@
#include "gimplutF.h"
#include "gimphistogramF.h"
typedef enum /*< chop=_LUT >*/
{
VALUE_LUT, /*< nick=VALUE/GRAY >*/
RED_LUT,
GREEN_LUT,
BLUE_LUT,
GRAY_LUT = 0 /*< skip >*/
} ChannelLutType;
/* brightness contrast */
void brightness_contrast_lut_setup (GimpLut *lut,
double brightness, double contrast,

View File

@ -50,130 +50,119 @@ static GSList *last_opened_raw_filenames = NULL;
static const GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Dialogs"), "", NULL, 0, "<Branch>" },
{ 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/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/_Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/_Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/D_ocument Index..."), NULL, raise_idea_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/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ 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/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_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/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
};
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
static GtkItemFactory *toolbox_factory = NULL;
static const GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "<Separator>" };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry image_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save _as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/_Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/_Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Edit"), "", NULL, 0, "<Branch>" },
{ N_("/Edit/Cu_t"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/_Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/_Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste _Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/C_lear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/_Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/_Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/_Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/_Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/Clear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/Cut _Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Cop_y Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Past_e Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/Cut Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Copy Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Select"), "", NULL, 0, "<Branch>" },
{ N_("/Select/_Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/_Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/_All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/_None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/_Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/_Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/_Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/F_eather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/_Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/S_hrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To _Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/Feather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/_View"), "", NULL, 0, "<Branch>" },
{ N_("/View/Zoom _In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom _Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/1_6:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/_8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/_4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/_2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/_1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 },
{ N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 },
{ N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 },
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/_Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/_Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle _Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle S_tatusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle _Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/_Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/_New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/S_hrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/_Image"), "", NULL, 0, "<Branch>" },
{ N_("/Image/_Colors"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Colors/_Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/_Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/_Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/C_hannel Ops"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Channel Ops/_Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/_Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/_Alpha"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Alpha/_Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/_RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/_Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/_Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/R_esize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/_Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Layers"), "", NULL, 0, "<Branch>" },
{ N_("/Layers/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/_Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/L_ower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/_Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/_Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/_Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Al_pha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Ma_sk To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/A_dd Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/Lower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
/* these are built on the fly */
@ -206,29 +195,26 @@ static const GtkItemFactoryEntry image_entries[] =
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/_Tools"), "", NULL, 0, "<Branch>" },
{ N_("/Tools/_Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/_Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/_Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filte_rs"), "", NULL, 0, "<Branch>" },
{ N_("/Filters/_Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-_show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/_Dialogs"), "", NULL, 0, "<Branch>" },
{ N_("/Dialogs/_Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/_Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/_Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/I_nput Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
};
static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]);
static GtkItemFactory *image_factory = NULL;

View File

@ -50,130 +50,119 @@ static GSList *last_opened_raw_filenames = NULL;
static const GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Dialogs"), "", NULL, 0, "<Branch>" },
{ 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/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/_Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/_Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/D_ocument Index..."), NULL, raise_idea_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/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ 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/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_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/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
};
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
static GtkItemFactory *toolbox_factory = NULL;
static const GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "<Separator>" };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry image_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save _as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/_Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/_Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Edit"), "", NULL, 0, "<Branch>" },
{ N_("/Edit/Cu_t"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/_Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/_Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste _Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/C_lear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/_Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/_Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/_Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/_Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/Clear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/Cut _Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Cop_y Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Past_e Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/Cut Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Copy Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Select"), "", NULL, 0, "<Branch>" },
{ N_("/Select/_Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/_Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/_All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/_None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/_Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/_Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/_Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/F_eather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/_Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/S_hrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To _Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/Feather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/_View"), "", NULL, 0, "<Branch>" },
{ N_("/View/Zoom _In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom _Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/1_6:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/_8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/_4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/_2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/_1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 },
{ N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 },
{ N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 },
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/_Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/_Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle _Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle S_tatusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle _Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/_Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/_New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/S_hrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/_Image"), "", NULL, 0, "<Branch>" },
{ N_("/Image/_Colors"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Colors/_Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/_Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/_Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/C_hannel Ops"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Channel Ops/_Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/_Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/_Alpha"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Alpha/_Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/_RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/_Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/_Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/R_esize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/_Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Layers"), "", NULL, 0, "<Branch>" },
{ N_("/Layers/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/_Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/L_ower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/_Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/_Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/_Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Al_pha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Ma_sk To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/A_dd Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/Lower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
/* these are built on the fly */
@ -206,29 +195,26 @@ static const GtkItemFactoryEntry image_entries[] =
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/_Tools"), "", NULL, 0, "<Branch>" },
{ N_("/Tools/_Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/_Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/_Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filte_rs"), "", NULL, 0, "<Branch>" },
{ N_("/Filters/_Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-_show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/_Dialogs"), "", NULL, 0, "<Branch>" },
{ N_("/Dialogs/_Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/_Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/_Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/I_nput Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
};
static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]);
static GtkItemFactory *image_factory = NULL;

View File

@ -55,6 +55,9 @@ text_xlfd_insert_size (gchar *fontname,
if (antialias)
size *= SUPERSAMPLE;
if (metric == PIXELS)
size *= 10;
sprintf (buffer, "%d", (int) size);
newfont = workfont = g_new (char, strlen (fontname) + 16);

View File

@ -50,130 +50,119 @@ static GSList *last_opened_raw_filenames = NULL;
static const GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Dialogs"), "", NULL, 0, "<Branch>" },
{ 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/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/_Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/_Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/D_ocument Index..."), NULL, raise_idea_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/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
{ 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/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_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/Module Browser..."), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
};
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
static GtkItemFactory *toolbox_factory = NULL;
static const GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "<Separator>" };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 };
static const GtkItemFactoryEntry image_entries[] =
{
{ N_("/_File"), "", NULL, 0, "<Branch>" },
{ N_("/File/_New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/_Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/_Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save _as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/_Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/_Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
{ N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 },
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/_Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/_Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Edit"), "", NULL, 0, "<Branch>" },
{ N_("/Edit/Cu_t"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/_Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/_Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste _Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/C_lear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/_Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/_Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/_Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/_Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
{ N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 },
{ N_("/Edit/Clear"), "<control>K", edit_clear_cmd_callback, 0 },
{ N_("/Edit/Fill"), "<control>period", edit_fill_cmd_callback, 0 },
{ N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 },
{ N_("/Edit/Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
{ N_("/Edit/Redo"), "<control>R", edit_redo_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/Cut _Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Cop_y Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Past_e Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/Cut Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
{ N_("/Edit/Copy Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Select"), "", NULL, 0, "<Branch>" },
{ N_("/Select/_Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/_Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/_All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/_None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/_Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/_Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/_Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/F_eather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/_Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/S_hrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To _Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
{ N_("/Select/Float"), "<control><shift>L", select_float_cmd_callback, 0 },
{ N_("/Select/Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
{ N_("/Select/Border"), "<control><shift>B", select_border_cmd_callback, 0 },
{ N_("/Select/Feather"), "<control><shift>F", select_feather_cmd_callback, 0 },
{ N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 },
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/_View"), "", NULL, 0, "<Branch>" },
{ N_("/View/Zoom _In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom _Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/1_6:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/_8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/_4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/_2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/_1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
{ N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 },
{ N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 },
{ N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 },
{ N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 },
{ N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 },
{ N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 },
{ N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 },
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/_Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/_Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle _Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle S_tatusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle _Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/_Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/_New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/S_hrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/_Image"), "", NULL, 0, "<Branch>" },
{ N_("/Image/_Colors"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Colors/_Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/_Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/_Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/C_hannel Ops"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Channel Ops/_Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/_Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/_Alpha"), "", NULL, 0, "<Branch>" },
{ N_("/Image/Alpha/_Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/_RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/_Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/_Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 },
{ N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 },
{ N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/R_esize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/_Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/_Layers"), "", NULL, 0, "<Branch>" },
{ N_("/Layers/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/_Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/L_ower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/_Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/_Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/_Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Al_pha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Ma_sk To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/A_dd Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
{ N_("/Layers/Lower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
{ N_("/Layers/Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
{ N_("/Layers/Merge Visible Layers"), "<control>M", layers_merge_cmd_callback, 0 },
{ N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 },
{ N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
/* these are built on the fly */
@ -206,29 +195,26 @@ static const GtkItemFactoryEntry image_entries[] =
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/_Tools"), "", NULL, 0, "<Branch>" },
{ N_("/Tools/_Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/_Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/_Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filte_rs"), "", NULL, 0, "<Branch>" },
{ N_("/Filters/_Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-_show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/_Dialogs"), "", NULL, 0, "<Branch>" },
{ N_("/Dialogs/_Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/_Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/P_alette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/_Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/_Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/_Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/I_nput Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/_Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
{ N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
{ N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
};
static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]);
static GtkItemFactory *image_factory = NULL;

View File

@ -264,7 +264,10 @@ text_xlfd_insert_size (gchar *fontname,
if (antialias)
size *= SUPERSAMPLE;
sprintf (buffer, "%d", (int) (metric == PIXELS ? size : size * 10));
if (metric == PIXELS)
size *= 10;
sprintf (buffer, "%d", (int) size);
newfont = workfont = g_new (char, strlen (fontname) + 16);