2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-04-20 21:25:55 +08:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2004-04-21 18:55:45 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2004-04-20 21:25:55 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "actions-types.h"
|
|
|
|
|
|
|
|
#include "core/gimp.h"
|
2008-11-03 05:34:14 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
2004-05-10 08:41:57 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
|
|
|
|
|
|
|
#include "widgets/gimpactiongroup.h"
|
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
#include "actions.h"
|
2004-09-20 22:43:46 +08:00
|
|
|
#include "tools-actions.h"
|
|
|
|
#include "tools-commands.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpActionEntry tools_actions[] =
|
2004-04-20 21:25:55 +08:00
|
|
|
{
|
2004-10-18 19:29:58 +08:00
|
|
|
{ "tools-popup", GIMP_STOCK_TOOLS,
|
|
|
|
N_("Tools Menu"), NULL, NULL, NULL,
|
2004-05-10 08:41:57 +08:00
|
|
|
GIMP_HELP_TOOLS_DIALOG },
|
|
|
|
|
2004-04-21 18:55:45 +08:00
|
|
|
{ "tools-menu", NULL, N_("_Tools") },
|
|
|
|
{ "tools-select-menu", NULL, N_("_Selection Tools") },
|
|
|
|
{ "tools-paint-menu", NULL, N_("_Paint Tools") },
|
|
|
|
{ "tools-transform-menu", NULL, N_("_Transform Tools") },
|
|
|
|
{ "tools-color-menu", NULL, N_("_Color Tools") },
|
2004-04-20 21:25:55 +08:00
|
|
|
|
2004-12-31 21:29:39 +08:00
|
|
|
{ "tools-raise", GTK_STOCK_GO_UP,
|
|
|
|
N_("R_aise Tool"), NULL,
|
|
|
|
N_("Raise tool"),
|
|
|
|
G_CALLBACK (tools_raise_cmd_callback),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ "tools-raise-to-top", GTK_STOCK_GOTO_TOP,
|
|
|
|
N_("Ra_ise to Top"), NULL,
|
|
|
|
N_("Raise tool to top"),
|
|
|
|
G_CALLBACK (tools_raise_to_top_cmd_callback),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ "tools-lower", GTK_STOCK_GO_DOWN,
|
|
|
|
N_("L_ower Tool"), NULL,
|
|
|
|
N_("Lower tool"),
|
|
|
|
G_CALLBACK (tools_lower_cmd_callback),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ "tools-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
|
|
|
|
N_("Lo_wer to Bottom"), NULL,
|
|
|
|
N_("Lower tool to bottom"),
|
|
|
|
G_CALLBACK (tools_lower_to_bottom_cmd_callback),
|
|
|
|
NULL },
|
|
|
|
|
2004-05-10 08:41:57 +08:00
|
|
|
{ "tools-reset", GIMP_STOCK_RESET,
|
2004-05-12 00:05:21 +08:00
|
|
|
N_("_Reset Order & Visibility"), NULL,
|
|
|
|
N_("Reset tool order and visibility"),
|
2004-05-10 08:41:57 +08:00
|
|
|
G_CALLBACK (tools_reset_cmd_callback),
|
|
|
|
NULL }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpToggleActionEntry tools_toggle_actions[] =
|
2004-05-10 08:41:57 +08:00
|
|
|
{
|
2004-07-21 02:13:49 +08:00
|
|
|
{ "tools-visibility", GIMP_STOCK_VISIBLE,
|
2004-10-18 19:29:58 +08:00
|
|
|
N_("_Show in Toolbox"), NULL, NULL,
|
2004-05-10 08:41:57 +08:00
|
|
|
G_CALLBACK (tools_toggle_visibility_cmd_callback),
|
|
|
|
TRUE,
|
|
|
|
NULL /* FIXME */ }
|
2004-04-20 21:25:55 +08:00
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpStringActionEntry tools_alternative_actions[] =
|
2004-05-05 09:17:23 +08:00
|
|
|
{
|
|
|
|
{ "tools-by-color-select-short", GIMP_STOCK_TOOL_BY_COLOR_SELECT,
|
2007-03-31 19:38:47 +08:00
|
|
|
N_("_By Color"), NULL,
|
|
|
|
N_("Select regions with similar colors"),
|
2004-05-05 09:17:23 +08:00
|
|
|
"gimp-by-color-select-tool",
|
|
|
|
GIMP_HELP_TOOL_BY_COLOR_SELECT },
|
|
|
|
|
|
|
|
{ "tools-rotate-arbitrary", GIMP_STOCK_TOOL_ROTATE,
|
2007-03-31 19:38:47 +08:00
|
|
|
N_("_Arbitrary Rotation..."), "",
|
|
|
|
N_("Rotate by an arbitrary angle"),
|
2005-10-13 20:29:46 +08:00
|
|
|
"gimp-rotate-layer",
|
2004-05-05 09:17:23 +08:00
|
|
|
GIMP_HELP_TOOL_ROTATE }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_color_average_radius_actions[] =
|
2005-02-21 19:55:39 +08:00
|
|
|
{
|
|
|
|
{ "tools-color-average-radius-set", GIMP_STOCK_TOOL_COLOR_PICKER,
|
|
|
|
"Set Color Picker Radius", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-03 03:15:51 +08:00
|
|
|
{ "tools-color-average-set-to-default", GIMP_STOCK_TOOL_COLOR_PICKER,
|
|
|
|
"Set Color Picker Radius To Default Value", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2005-02-21 19:55:39 +08:00
|
|
|
{ "tools-color-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Minimize Color Picker Radius", NULL, NULL,
|
2005-02-21 19:55:39 +08:00
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-color-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Maximize Color Picker Radius", NULL, NULL,
|
2005-02-21 19:55:39 +08:00
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-color-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER,
|
|
|
|
"Decrease Color Picker Radius", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-color-average-radius-increase", GIMP_STOCK_TOOL_COLOR_PICKER,
|
|
|
|
"Increase Color Picker Radius", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-color-average-radius-decrease-skip",
|
|
|
|
GIMP_STOCK_TOOL_COLOR_PICKER,
|
|
|
|
"Decrease Color Picker Radius More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-color-average-radius-increase-skip",
|
|
|
|
GIMP_STOCK_TOOL_COLOR_PICKER,
|
|
|
|
"Increase Color Picker Radius More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-11-17 21:06:00 +08:00
|
|
|
static const GimpEnumActionEntry tools_paint_brush_scale_actions[] =
|
|
|
|
{
|
|
|
|
{ "tools-paint-brush-scale-set", GIMP_STOCK_TOOL_PAINTBRUSH,
|
|
|
|
"Set Brush Scale", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-03 03:15:51 +08:00
|
|
|
{ "tools-paint-brush-scale-set-to-default", GIMP_STOCK_TOOL_PAINTBRUSH,
|
|
|
|
"Set Brush Scale To Default Value", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2006-11-17 21:06:00 +08:00
|
|
|
{ "tools-paint-brush-scale-minimum", GIMP_STOCK_TOOL_PAINTBRUSH,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Minimize Brush Scale", NULL, NULL,
|
2006-11-17 21:06:00 +08:00
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-paint-brush-scale-maximum", GIMP_STOCK_TOOL_PAINTBRUSH,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Maximize Brush Scale", NULL, NULL,
|
2006-11-17 21:06:00 +08:00
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-paint-brush-scale-decrease", GIMP_STOCK_TOOL_PAINTBRUSH,
|
|
|
|
"Decrease Brush Scale", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-paint-brush-scale-increase", GIMP_STOCK_TOOL_PAINTBRUSH,
|
|
|
|
"Increase Brush Scale", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-paint-brush-scale-decrease-skip", GIMP_STOCK_TOOL_PAINTBRUSH,
|
|
|
|
"Decrease Brush Scale More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-paint-brush-scale-increase-skip", GIMP_STOCK_TOOL_PAINTBRUSH,
|
|
|
|
"Increase Brush Scale More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-ink-blob-size-set", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Set Ink Blob Size", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-size-minimum", GIMP_STOCK_TOOL_INK,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Minimize Ink Blob Size", NULL, NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-size-maximum", GIMP_STOCK_TOOL_INK,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Maximize Ink Blob Size", NULL, NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-size-decrease", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Decrease Ink Blob Size", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-size-increase", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Increase Ink Blob Size", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-size-decrease-skip", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Decrease Ink Blob Size More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-size-increase-skip", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Increase Ink Blob Size More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-ink-blob-aspect-set", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Set Ink Blob Aspect", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-03 03:15:51 +08:00
|
|
|
{ "tools-ink-blob-aspect-set-to-default", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Set Ink Blob Aspect To Default Value", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2005-03-04 19:42:46 +08:00
|
|
|
{ "tools-ink-blob-aspect-minimum", GIMP_STOCK_TOOL_INK,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Minimize Ink Blob Aspect", NULL, NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-aspect-maximum", GIMP_STOCK_TOOL_INK,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Maximize Ink Blob Aspect", NULL, NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-aspect-decrease", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Decrease Ink Blob Aspect", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-aspect-increase", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Increase Ink Blob Aspect", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-aspect-decrease-skip", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Decrease Ink Blob Aspect More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-aspect-increase-skip", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Increase Ink Blob Aspect More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-ink-blob-angle-set", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Set Ink Blob Angle", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-angle-minimum", GIMP_STOCK_TOOL_INK,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Minimize Ink Blob Angle", NULL, NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-angle-maximum", GIMP_STOCK_TOOL_INK,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Maximize Ink Blob Angle", NULL, NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-angle-decrease", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Decrease Ink Blob Angle", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-angle-increase", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Increase Ink Blob Angle", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-angle-decrease-skip", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Decrease Ink Blob Angle More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-ink-blob-angle-increase-skip", GIMP_STOCK_TOOL_INK,
|
|
|
|
"Increase Ink Blob Angle More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-11-23 04:38:36 +08:00
|
|
|
static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
|
|
|
|
{
|
|
|
|
{ "tools-foreground-select-brush-size-set",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
|
|
|
"Set Foreground Select Brush Size", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-03 03:15:51 +08:00
|
|
|
{ "tools-foreground-select-brush-size-set-to-default",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
|
|
|
"Set Foreground Select Brush Size to Default Value", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2006-11-23 04:38:36 +08:00
|
|
|
{ "tools-foreground-select-brush-size-minimum",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Minimize Foreground Select Brush Size", NULL, NULL,
|
2006-11-23 04:38:36 +08:00
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-foreground-select-brush-size-maximum",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
2008-03-07 01:13:59 +08:00
|
|
|
"Maximize Foreground Select Brush Size", NULL, NULL,
|
2006-11-23 04:38:36 +08:00
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-foreground-select-brush-size-decrease",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
|
|
|
"Decrease Foreground Select Brush Size", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-foreground-select-brush-size-increase",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
|
|
|
"Increase Foreground Select Brush Size", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-foreground-select-brush-size-decrease-skip",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
|
|
|
"Decrease Foreground Select Brush Size More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-foreground-select-brush-size-increase-skip",
|
|
|
|
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
|
|
|
|
"Increase Foreground Select Brush Size More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2008-03-07 01:13:59 +08:00
|
|
|
static const GimpEnumActionEntry tools_transform_preview_opacity_actions[] =
|
|
|
|
{
|
|
|
|
{ "tools-transform-preview-opacity-set", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Set Transform Tool Preview Opacity", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-transform-preview-opacity-minimum", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Minimize Transform Tool Preview Opacity", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-transform-preview-opacity-maximum", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Maximize Transform Tool Preview Opacity", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-transform-preview-opacity-decrease", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Decrease Transform Tool Preview Opacity", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-transform-preview-opacity-increase", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Increase Transform Tool Preview Opacity", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-transform-preview-opacity-decrease-skip", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Decrease Transform Tool Preview Opacity More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-transform-preview-opacity-increase-skip", GIMP_STOCK_TOOL_PERSPECTIVE,
|
|
|
|
"Increase Transform Tool Preview Opacity More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2008-06-03 03:20:10 +08:00
|
|
|
/* tools-value-1 is effectively used to control
|
|
|
|
* opacity of the active tool
|
|
|
|
*/
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_value_1_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Set Value 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-01 04:05:03 +08:00
|
|
|
{ "tools-value-1-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
|
2008-06-03 03:15:51 +08:00
|
|
|
"Set Value 1 To Default Value", NULL, NULL,
|
2008-06-01 04:05:03 +08:00
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2005-03-04 19:42:46 +08:00
|
|
|
{ "tools-value-1-minimum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Minimize Value 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-1-maximum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Maximize Value 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-1-decrease", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Decrease Value 1", "less", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-1-increase", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Increase Value 1", "greater", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-1-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Decrease Value 1 More", "<control>less", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-1-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Increase Value 1 More", "<control>greater", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2008-06-03 03:20:10 +08:00
|
|
|
/* tools-value-2 is effectively used to control
|
|
|
|
* the tip size of the active tool
|
|
|
|
*/
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_value_2_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-value-2-set", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Set Value 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-01 04:05:03 +08:00
|
|
|
{ "tools-value-2-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
|
2008-06-03 03:15:51 +08:00
|
|
|
"Set Value 2 To Default Value", "backslash", NULL,
|
2008-06-01 04:05:03 +08:00
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2005-03-04 19:42:46 +08:00
|
|
|
{ "tools-value-2-minimum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Minimize Value 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-2-maximum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Maximize Value 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-2-decrease", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Decrease Value 2", "bracketleft", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-2-increase", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Increase Value 2", "bracketright", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-2-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Decrease Value 2 More", "<shift>bracketleft", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-2-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
|
2006-11-17 21:06:00 +08:00
|
|
|
"Increase Value 2 More", "<shift>bracketright", NULL,
|
2005-03-04 19:42:46 +08:00
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_value_3_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-value-3-set", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Set Value 3", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-01 04:05:03 +08:00
|
|
|
{ "tools-value-3-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
|
2008-06-03 03:15:51 +08:00
|
|
|
"Set Value 3 To Default Value", NULL, NULL,
|
2008-06-01 04:05:03 +08:00
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2005-03-04 19:42:46 +08:00
|
|
|
{ "tools-value-3-minimum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Minimize Value 3", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-3-maximum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Maximize Value 3", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-3-decrease", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Decrease Value 3", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-3-increase", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Increase Value 3", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-3-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Decrease Value 3 More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-3-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Increase Value 3 More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_value_4_actions[] =
|
2005-03-04 19:42:46 +08:00
|
|
|
{
|
|
|
|
{ "tools-value-4-set", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Set Value 4", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
2008-06-01 04:05:03 +08:00
|
|
|
{ "tools-value-4-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
|
2008-06-03 03:15:51 +08:00
|
|
|
"Set Value 4 To Default Value", NULL, NULL,
|
2008-06-01 04:05:03 +08:00
|
|
|
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
|
|
|
|
NULL },
|
2005-03-04 19:42:46 +08:00
|
|
|
{ "tools-value-4-minimum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Minimize Value 4", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-4-maximum", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Maximize Value 4", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-4-decrease", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Decrease Value 4", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-4-increase", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Increase Value 4", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-4-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Decrease Value 4 More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-value-4-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Increase Value 4 More", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
|
|
|
NULL },
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_object_1_actions[] =
|
2005-03-05 03:05:40 +08:00
|
|
|
{
|
|
|
|
{ "tools-object-1-set", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Select Object 1 by Index", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-1-first", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"First Object 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-1-last", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Last Object 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-1-previous", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Previous Object 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-1-next", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Next Object 1", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry tools_object_2_actions[] =
|
2005-03-05 03:05:40 +08:00
|
|
|
{
|
|
|
|
{ "tools-object-2-set", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Select Object 2 by Index", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_SET, TRUE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-2-first", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"First Object 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_FIRST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-2-last", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Last Object 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_LAST, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-2-previous", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Previous Object 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
|
|
|
NULL },
|
|
|
|
{ "tools-object-2-next", GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
"Next Object 2", NULL, NULL,
|
|
|
|
GIMP_ACTION_SELECT_NEXT, FALSE,
|
|
|
|
NULL }
|
|
|
|
};
|
|
|
|
|
2004-04-20 21:25:55 +08:00
|
|
|
|
|
|
|
void
|
2004-04-27 21:55:26 +08:00
|
|
|
tools_actions_setup (GimpActionGroup *group)
|
2004-04-20 21:25:55 +08:00
|
|
|
{
|
2004-05-05 09:17:23 +08:00
|
|
|
GtkAction *action;
|
|
|
|
GList *list;
|
2004-04-20 21:25:55 +08:00
|
|
|
|
|
|
|
gimp_action_group_add_actions (group,
|
|
|
|
tools_actions,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_N_ELEMENTS (tools_actions));
|
2004-04-20 21:25:55 +08:00
|
|
|
|
2004-05-10 08:41:57 +08:00
|
|
|
gimp_action_group_add_toggle_actions (group,
|
|
|
|
tools_toggle_actions,
|
|
|
|
G_N_ELEMENTS (tools_toggle_actions));
|
|
|
|
|
2004-05-05 09:17:23 +08:00
|
|
|
gimp_action_group_add_string_actions (group,
|
|
|
|
tools_alternative_actions,
|
|
|
|
G_N_ELEMENTS (tools_alternative_actions),
|
|
|
|
G_CALLBACK (tools_select_cmd_callback));
|
|
|
|
|
|
|
|
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
|
|
|
|
"tools-by-color-select-short");
|
|
|
|
gtk_action_set_accel_path (action, "<Actions>/tools/tools-by-color-select");
|
|
|
|
|
2005-02-21 19:55:39 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_color_average_radius_actions,
|
|
|
|
G_N_ELEMENTS (tools_color_average_radius_actions),
|
|
|
|
G_CALLBACK (tools_color_average_radius_cmd_callback));
|
|
|
|
|
2006-11-17 21:06:00 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_paint_brush_scale_actions,
|
|
|
|
G_N_ELEMENTS (tools_paint_brush_scale_actions),
|
|
|
|
G_CALLBACK (tools_paint_brush_scale_cmd_callback));
|
|
|
|
|
2005-03-04 19:42:46 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_ink_blob_size_actions,
|
|
|
|
G_N_ELEMENTS (tools_ink_blob_size_actions),
|
|
|
|
G_CALLBACK (tools_ink_blob_size_cmd_callback));
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_ink_blob_aspect_actions,
|
|
|
|
G_N_ELEMENTS (tools_ink_blob_aspect_actions),
|
|
|
|
G_CALLBACK (tools_ink_blob_aspect_cmd_callback));
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_ink_blob_angle_actions,
|
|
|
|
G_N_ELEMENTS (tools_ink_blob_angle_actions),
|
|
|
|
G_CALLBACK (tools_ink_blob_angle_cmd_callback));
|
|
|
|
|
2006-11-23 04:38:36 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_foreground_select_brush_size_actions,
|
|
|
|
G_N_ELEMENTS (tools_foreground_select_brush_size_actions),
|
|
|
|
G_CALLBACK (tools_fg_select_brush_size_cmd_callback));
|
|
|
|
|
2008-03-07 01:13:59 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_transform_preview_opacity_actions,
|
|
|
|
G_N_ELEMENTS (tools_transform_preview_opacity_actions),
|
|
|
|
G_CALLBACK (tools_transform_preview_opacity_cmd_callback));
|
|
|
|
|
2005-03-04 19:42:46 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_value_1_actions,
|
|
|
|
G_N_ELEMENTS (tools_value_1_actions),
|
|
|
|
G_CALLBACK (tools_value_1_cmd_callback));
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_value_2_actions,
|
|
|
|
G_N_ELEMENTS (tools_value_2_actions),
|
|
|
|
G_CALLBACK (tools_value_2_cmd_callback));
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_value_3_actions,
|
|
|
|
G_N_ELEMENTS (tools_value_3_actions),
|
|
|
|
G_CALLBACK (tools_value_3_cmd_callback));
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_value_4_actions,
|
|
|
|
G_N_ELEMENTS (tools_value_4_actions),
|
|
|
|
G_CALLBACK (tools_value_4_cmd_callback));
|
|
|
|
|
2005-03-05 03:05:40 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_object_1_actions,
|
|
|
|
G_N_ELEMENTS (tools_object_1_actions),
|
|
|
|
G_CALLBACK (tools_object_1_cmd_callback));
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
tools_object_2_actions,
|
|
|
|
G_N_ELEMENTS (tools_object_2_actions),
|
|
|
|
G_CALLBACK (tools_object_2_cmd_callback));
|
|
|
|
|
2008-11-03 05:34:14 +08:00
|
|
|
for (list = gimp_get_tool_info_iter (group->gimp);
|
2004-04-20 21:25:55 +08:00
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpToolInfo *tool_info = list->data;
|
|
|
|
|
|
|
|
if (tool_info->menu_path)
|
|
|
|
{
|
|
|
|
GimpStringActionEntry entry;
|
|
|
|
const gchar *stock_id;
|
|
|
|
const gchar *identifier;
|
2004-04-21 18:55:45 +08:00
|
|
|
gchar *tmp;
|
|
|
|
gchar *name;
|
2004-04-20 21:25:55 +08:00
|
|
|
|
|
|
|
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
|
|
|
|
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
|
|
|
|
|
2004-04-21 18:55:45 +08:00
|
|
|
tmp = g_strndup (identifier + strlen ("gimp-"),
|
|
|
|
strlen (identifier) - strlen ("gimp--tool"));
|
|
|
|
name = g_strdup_printf ("tools-%s", tmp);
|
|
|
|
g_free (tmp);
|
|
|
|
|
|
|
|
entry.name = name;
|
2004-04-20 21:25:55 +08:00
|
|
|
entry.stock_id = stock_id;
|
|
|
|
entry.label = tool_info->menu_path;
|
|
|
|
entry.accelerator = tool_info->menu_accel;
|
2005-09-16 08:46:21 +08:00
|
|
|
entry.tooltip = tool_info->help;
|
2004-05-04 06:36:59 +08:00
|
|
|
entry.help_id = tool_info->help_id;
|
2004-04-20 21:25:55 +08:00
|
|
|
entry.value = identifier;
|
|
|
|
|
|
|
|
gimp_action_group_add_string_actions (group,
|
|
|
|
&entry, 1,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (tools_select_cmd_callback));
|
2004-04-21 18:55:45 +08:00
|
|
|
|
|
|
|
g_free (name);
|
2004-04-20 21:25:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tools_actions_update (GimpActionGroup *group,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2004-12-31 21:29:39 +08:00
|
|
|
GimpContext *context = gimp_get_user_context (group->gimp);
|
|
|
|
GimpToolInfo *tool_info = gimp_context_get_tool (context);
|
|
|
|
GimpContainer *container = context->gimp->tool_info_list;
|
|
|
|
gboolean raise = FALSE;
|
|
|
|
gboolean lower = FALSE;
|
2004-05-10 08:41:57 +08:00
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
#define SET_SENSITIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
2004-05-10 08:41:57 +08:00
|
|
|
#define SET_ACTIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
SET_SENSITIVE ("tools-visibility", tool_info);
|
2004-05-13 21:52:18 +08:00
|
|
|
|
|
|
|
if (tool_info)
|
2004-12-31 21:29:39 +08:00
|
|
|
{
|
|
|
|
gint last_index;
|
|
|
|
gint index;
|
|
|
|
|
|
|
|
SET_ACTIVE ("tools-visibility", tool_info->visible);
|
|
|
|
|
|
|
|
last_index = gimp_container_num_children (container) -1;
|
|
|
|
index = gimp_container_get_child_index (container,
|
|
|
|
GIMP_OBJECT (tool_info));
|
|
|
|
|
|
|
|
raise = index != 0;
|
|
|
|
lower = index != last_index;
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_SENSITIVE ("tools-raise", raise);
|
|
|
|
SET_SENSITIVE ("tools-raise-to-top", raise);
|
|
|
|
SET_SENSITIVE ("tools-lower", lower);
|
|
|
|
SET_SENSITIVE ("tools-lower-to-bottom", lower);
|
2004-05-10 08:41:57 +08:00
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
#undef SET_SENSITIVE
|
2004-05-10 08:41:57 +08:00
|
|
|
#undef SET_ACTIVE
|
2004-04-20 21:25:55 +08:00
|
|
|
}
|