2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-04-19 22:54:24 +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"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "actions-types.h"
|
|
|
|
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpdatafactory.h"
|
|
|
|
#include "core/gimpgradient.h"
|
|
|
|
|
|
|
|
#include "widgets/gimpactiongroup.h"
|
|
|
|
#include "widgets/gimpgradienteditor.h"
|
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
|
2005-10-26 05:38:00 +08:00
|
|
|
#include "data-editor-commands.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
#include "gradient-editor-actions.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
#include "gradient-editor-commands.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpActionEntry gradient_editor_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2004-10-18 19:29:58 +08:00
|
|
|
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT,
|
|
|
|
N_("Gradient Editor Menu"), NULL, NULL, NULL,
|
2004-05-02 16:56:07 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
|
2004-04-22 00:10:00 +08:00
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
{ "gradient-editor-left-color-type", NULL,
|
|
|
|
N_("Left Color Type") },
|
2004-05-20 04:56:37 +08:00
|
|
|
{ "gradient-editor-load-left-color", GTK_STOCK_REVERT_TO_SAVED,
|
|
|
|
N_("_Load Left Color From") },
|
|
|
|
{ "gradient-editor-save-left-color", GTK_STOCK_SAVE,
|
|
|
|
N_("_Save Left Color To") },
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
{ "gradient-editor-right-color-type", NULL,
|
|
|
|
N_("Right Color Type") },
|
2004-05-20 04:56:37 +08:00
|
|
|
{ "gradient-editor-load-right-color", GTK_STOCK_REVERT_TO_SAVED,
|
|
|
|
N_("Load Right Color Fr_om") },
|
|
|
|
{ "gradient-editor-save-right-color", GTK_STOCK_SAVE,
|
|
|
|
N_("Sa_ve Right Color To") },
|
|
|
|
|
|
|
|
{ "gradient-editor-blending-func", NULL, "blending-function" },
|
|
|
|
{ "gradient-editor-coloring-type", NULL, "coloring-type" },
|
2004-04-29 20:52:29 +08:00
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
{ "gradient-editor-left-color", NULL,
|
|
|
|
N_("L_eft Endpoint's Color..."), NULL, NULL,
|
|
|
|
G_CALLBACK (gradient_editor_left_color_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-right-color", NULL,
|
|
|
|
N_("R_ight Endpoint's Color..."), NULL, NULL,
|
|
|
|
G_CALLBACK (gradient_editor_right_color_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
|
|
|
|
|
2004-05-20 04:56:37 +08:00
|
|
|
{ "gradient-editor-flip", GIMP_STOCK_FLIP_HORIZONTAL,
|
|
|
|
"flip", NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_flip_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_FLIP },
|
|
|
|
|
2004-05-20 04:56:37 +08:00
|
|
|
{ "gradient-editor-replicate", GIMP_STOCK_DUPLICATE,
|
|
|
|
"replicate", NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_replicate_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_FLIP },
|
|
|
|
|
|
|
|
{ "gradient-editor-split-midpoint", NULL,
|
2004-05-20 04:56:37 +08:00
|
|
|
"splitmidpoint", NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_split_midpoint_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_SPLIT_MIDPOINT },
|
|
|
|
|
|
|
|
{ "gradient-editor-split-uniform", NULL,
|
2004-05-20 04:56:37 +08:00
|
|
|
"splituniform", NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_split_uniformly_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM },
|
|
|
|
|
2004-05-20 04:56:37 +08:00
|
|
|
{ "gradient-editor-delete", GTK_STOCK_DELETE,
|
|
|
|
"delete", "", NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_delete_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_DELETE },
|
|
|
|
|
|
|
|
{ "gradient-editor-recenter", NULL,
|
2004-05-20 04:56:37 +08:00
|
|
|
"recenter", NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_recenter_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RECENTER },
|
|
|
|
|
|
|
|
{ "gradient-editor-redistribute", NULL,
|
2004-05-20 04:56:37 +08:00
|
|
|
"redistribute", NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_redistribute_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_REDISTRIBUTE },
|
|
|
|
|
|
|
|
{ "gradient-editor-blend-color", NULL,
|
2004-05-20 04:56:37 +08:00
|
|
|
N_("Ble_nd Endpoints' Colors"), NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_blend_color_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLEND_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-blend-opacity", NULL,
|
2004-05-20 04:56:37 +08:00
|
|
|
N_("Blend Endpoints' Opacit_y"), NULL, NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (gradient_editor_blend_opacity_cmd_callback),
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
|
2005-10-26 05:38:00 +08:00
|
|
|
{
|
|
|
|
{ "gradient-editor-edit-active", GIMP_STOCK_LINKED,
|
|
|
|
N_("Edit Active Gradient"), NULL, NULL,
|
|
|
|
G_CALLBACK (data_editor_edit_active_cmd_callback),
|
|
|
|
FALSE,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE }
|
|
|
|
};
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
#define LOAD_LEFT_FROM(num,magic) \
|
|
|
|
{ "gradient-editor-load-left-" num, NULL, \
|
|
|
|
num, NULL, NULL, \
|
2004-11-19 00:04:41 +08:00
|
|
|
(magic), FALSE, \
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD }
|
|
|
|
#define SAVE_LEFT_TO(num,magic) \
|
|
|
|
{ "gradient-editor-save-left-" num, NULL, \
|
|
|
|
num, NULL, NULL, \
|
2004-11-19 00:04:41 +08:00
|
|
|
(magic), FALSE, \
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_SAVE }
|
|
|
|
#define LOAD_RIGHT_FROM(num,magic) \
|
|
|
|
{ "gradient-editor-load-right-" num, NULL, \
|
|
|
|
num, NULL, NULL, \
|
2004-11-19 00:04:41 +08:00
|
|
|
(magic), FALSE, \
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD }
|
|
|
|
#define SAVE_RIGHT_TO(num,magic) \
|
|
|
|
{ "gradient-editor-save-right-" num, NULL, \
|
|
|
|
num, NULL, NULL, \
|
2004-11-19 00:04:41 +08:00
|
|
|
(magic), FALSE, \
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_SAVE }
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry gradient_editor_load_left_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
{ "gradient-editor-load-left-left-neighbor", NULL,
|
|
|
|
N_("_Left Neighbor's Right Endpoint"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
|
|
|
|
|
|
|
{ "gradient-editor-load-left-right-endpoint", NULL,
|
|
|
|
N_("_Right Endpoint"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
|
|
|
|
|
|
|
{ "gradient-editor-load-left-fg", NULL,
|
2006-03-24 19:01:24 +08:00
|
|
|
N_("_Foreground Color"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
|
|
|
|
|
|
|
{ "gradient-editor-load-left-bg", NULL,
|
2006-03-24 19:01:24 +08:00
|
|
|
N_("_Background Color"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
|
|
|
|
2005-05-06 23:07:34 +08:00
|
|
|
LOAD_LEFT_FROM ("01", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 0),
|
|
|
|
LOAD_LEFT_FROM ("02", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 1),
|
|
|
|
LOAD_LEFT_FROM ("03", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 2),
|
|
|
|
LOAD_LEFT_FROM ("04", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 3),
|
|
|
|
LOAD_LEFT_FROM ("05", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 4),
|
|
|
|
LOAD_LEFT_FROM ("06", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 5),
|
|
|
|
LOAD_LEFT_FROM ("07", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 6),
|
|
|
|
LOAD_LEFT_FROM ("08", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 7),
|
|
|
|
LOAD_LEFT_FROM ("09", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 8),
|
|
|
|
LOAD_LEFT_FROM ("10", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 9)
|
2004-04-19 22:54:24 +08:00
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry gradient_editor_save_left_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
SAVE_LEFT_TO ("01", 0),
|
|
|
|
SAVE_LEFT_TO ("02", 1),
|
|
|
|
SAVE_LEFT_TO ("03", 2),
|
|
|
|
SAVE_LEFT_TO ("04", 3),
|
|
|
|
SAVE_LEFT_TO ("05", 4),
|
|
|
|
SAVE_LEFT_TO ("06", 5),
|
|
|
|
SAVE_LEFT_TO ("07", 6),
|
|
|
|
SAVE_LEFT_TO ("08", 7),
|
|
|
|
SAVE_LEFT_TO ("09", 8),
|
|
|
|
SAVE_LEFT_TO ("10", 9)
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry gradient_editor_load_right_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
{ "gradient-editor-load-right-right-neighbor", NULL,
|
|
|
|
N_("_Right Neighbor's Left Endpoint"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
|
|
|
|
|
|
|
{ "gradient-editor-load-right-left-endpoint", NULL,
|
|
|
|
N_("_Left Endpoint"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
|
|
|
|
|
|
|
{ "gradient-editor-load-right-fg", NULL,
|
2006-03-24 19:01:24 +08:00
|
|
|
N_("_Foreground Color"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
|
|
|
|
|
|
|
{ "gradient-editor-load-right-bg", NULL,
|
2006-03-24 19:01:24 +08:00
|
|
|
N_("_Background Color"), NULL, NULL,
|
2005-05-06 23:07:34 +08:00
|
|
|
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
|
|
|
|
2005-05-06 23:07:34 +08:00
|
|
|
LOAD_RIGHT_FROM ("01", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 0),
|
|
|
|
LOAD_RIGHT_FROM ("02", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 1),
|
|
|
|
LOAD_RIGHT_FROM ("03", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 2),
|
|
|
|
LOAD_RIGHT_FROM ("04", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 3),
|
|
|
|
LOAD_RIGHT_FROM ("05", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 4),
|
|
|
|
LOAD_RIGHT_FROM ("06", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 5),
|
|
|
|
LOAD_RIGHT_FROM ("07", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 6),
|
|
|
|
LOAD_RIGHT_FROM ("08", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 7),
|
|
|
|
LOAD_RIGHT_FROM ("09", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 8),
|
|
|
|
LOAD_RIGHT_FROM ("10", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 9)
|
2004-04-19 22:54:24 +08:00
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry gradient_editor_save_right_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
SAVE_RIGHT_TO ("01", 0),
|
|
|
|
SAVE_RIGHT_TO ("02", 1),
|
|
|
|
SAVE_RIGHT_TO ("03", 2),
|
|
|
|
SAVE_RIGHT_TO ("04", 3),
|
|
|
|
SAVE_RIGHT_TO ("05", 4),
|
|
|
|
SAVE_RIGHT_TO ("06", 5),
|
|
|
|
SAVE_RIGHT_TO ("07", 6),
|
|
|
|
SAVE_RIGHT_TO ("08", 7),
|
|
|
|
SAVE_RIGHT_TO ("09", 8),
|
|
|
|
SAVE_RIGHT_TO ("10", 9)
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef LOAD_LEFT_FROM
|
|
|
|
#undef SAVE_LEFT_TO
|
|
|
|
#undef LOAD_RIGHT_FROM
|
|
|
|
#undef SAVE_RIGHT_TO
|
|
|
|
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
static const GimpRadioActionEntry gradient_editor_left_color_type_actions[] =
|
|
|
|
{
|
|
|
|
{ "gradient-editor-left-color-fixed", NULL,
|
|
|
|
N_("_Fixed"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_FIXED,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-left-color-foreground", NULL,
|
|
|
|
N_("F_oreground Color"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_FOREGROUND,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-left-color-foreground-transparent", NULL,
|
|
|
|
N_("Fo_reground Color (Transparent)"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-left-color-background", NULL,
|
|
|
|
N_("_Background Color"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_BACKGROUND,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-left-color-background-transparent", NULL,
|
|
|
|
N_("B_ackground Color (Transparent)"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const GimpRadioActionEntry gradient_editor_right_color_type_actions[] =
|
|
|
|
{
|
|
|
|
{ "gradient-editor-right-color-fixed", NULL,
|
|
|
|
N_("_Fixed"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_FIXED,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-right-color-foreground", NULL,
|
|
|
|
N_("F_oreground Color"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_FOREGROUND,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-right-color-foreground-transparent", NULL,
|
|
|
|
N_("Fo_reground Color (Transparent)"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-right-color-background", NULL,
|
|
|
|
N_("_Background Color"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_BACKGROUND,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
|
|
|
|
|
|
|
|
{ "gradient-editor-right-color-background-transparent", NULL,
|
|
|
|
N_("B_ackground Color (Transparent)"), NULL, NULL,
|
|
|
|
GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpRadioActionEntry gradient_editor_blending_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
{ "gradient-editor-blending-linear", NULL,
|
|
|
|
N_("_Linear"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_LINEAR,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
|
|
|
|
|
|
|
|
{ "gradient-editor-blending-curved", NULL,
|
|
|
|
N_("_Curved"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_CURVED,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
|
|
|
|
|
|
|
|
{ "gradient-editor-blending-sine", NULL,
|
2004-05-24 05:02:27 +08:00
|
|
|
N_("_Sinusoidal"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_SINE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
|
|
|
|
|
|
|
|
{ "gradient-editor-blending-sphere-increasing", NULL,
|
|
|
|
N_("Spherical (i_ncreasing)"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
|
|
|
|
|
|
|
|
{ "gradient-editor-blending-sphere-decreasing", NULL,
|
|
|
|
N_("Spherical (_decreasing)"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
|
|
|
|
|
|
|
|
{ "gradient-editor-blending-varies", NULL,
|
|
|
|
N_("(Varies)"), NULL, NULL,
|
2004-10-25 04:38:35 +08:00
|
|
|
-1,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_BLENDING }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpRadioActionEntry gradient_editor_coloring_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
{ "gradient-editor-coloring-rgb", NULL,
|
|
|
|
N_("_RGB"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_RGB,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_COLORING },
|
|
|
|
|
|
|
|
{ "gradient-editor-coloring-hsv-ccw", NULL,
|
|
|
|
N_("HSV (_counter-clockwise hue)"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_HSV_CCW,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_COLORING },
|
|
|
|
|
|
|
|
{ "gradient-editor-coloring-hsv-cw", NULL,
|
|
|
|
N_("HSV (clockwise _hue)"), NULL, NULL,
|
2004-06-02 02:49:50 +08:00
|
|
|
GIMP_GRADIENT_SEGMENT_HSV_CW,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_COLORING },
|
|
|
|
|
|
|
|
{ "gradient-editor-coloring-varies", NULL,
|
|
|
|
N_("(Varies)"), NULL, NULL,
|
2004-10-25 04:38:35 +08:00
|
|
|
-1,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_COLORING }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry gradient_editor_zoom_actions[] =
|
2004-10-25 04:38:35 +08:00
|
|
|
{
|
|
|
|
{ "gradient-editor-zoom-in", GTK_STOCK_ZOOM_IN,
|
|
|
|
N_("Zoom In"), NULL,
|
|
|
|
N_("Zoom in"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ZOOM_IN, FALSE,
|
2004-10-25 04:38:35 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_ZOOM_IN },
|
|
|
|
|
|
|
|
{ "gradient-editor-zoom-out", GTK_STOCK_ZOOM_OUT,
|
|
|
|
N_("Zoom Out"), NULL,
|
|
|
|
N_("Zoom out"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ZOOM_OUT, FALSE,
|
2004-10-25 04:38:35 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_ZOOM_OUT },
|
|
|
|
|
|
|
|
{ "gradient-editor-zoom-all", GTK_STOCK_ZOOM_FIT,
|
|
|
|
N_("Zoom All"), NULL,
|
|
|
|
N_("Zoom all"),
|
2006-11-25 08:13:08 +08:00
|
|
|
GIMP_ZOOM_OUT_MAX, FALSE,
|
2004-10-25 04:38:35 +08:00
|
|
|
GIMP_HELP_GRADIENT_EDITOR_ZOOM_ALL }
|
|
|
|
};
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
void
|
2004-04-27 21:55:26 +08:00
|
|
|
gradient_editor_actions_setup (GimpActionGroup *group)
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
gimp_action_group_add_actions (group,
|
|
|
|
gradient_editor_actions,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_N_ELEMENTS (gradient_editor_actions));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2005-10-26 05:38:00 +08:00
|
|
|
gimp_action_group_add_toggle_actions (group,
|
|
|
|
gradient_editor_toggle_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_toggle_actions));
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
gradient_editor_load_left_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_load_left_actions),
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (gradient_editor_load_left_cmd_callback));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
gradient_editor_save_left_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_save_left_actions),
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (gradient_editor_save_left_cmd_callback));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
gradient_editor_load_right_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_load_right_actions),
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (gradient_editor_load_right_cmd_callback));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
gradient_editor_save_right_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_save_right_actions),
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (gradient_editor_save_right_cmd_callback));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
gimp_action_group_add_radio_actions (group,
|
|
|
|
gradient_editor_left_color_type_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_left_color_type_actions),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
G_CALLBACK (gradient_editor_left_color_type_cmd_callback));
|
|
|
|
|
|
|
|
gimp_action_group_add_radio_actions (group,
|
|
|
|
gradient_editor_right_color_type_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_right_color_type_actions),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
G_CALLBACK (gradient_editor_right_color_type_cmd_callback));
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
gimp_action_group_add_radio_actions (group,
|
|
|
|
gradient_editor_blending_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_blending_actions),
|
2005-11-16 04:24:50 +08:00
|
|
|
NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
0,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (gradient_editor_blending_func_cmd_callback));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
gimp_action_group_add_radio_actions (group,
|
|
|
|
gradient_editor_coloring_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_coloring_actions),
|
2005-11-16 04:24:50 +08:00
|
|
|
NULL,
|
2004-04-19 22:54:24 +08:00
|
|
|
0,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_CALLBACK (gradient_editor_coloring_type_cmd_callback));
|
2004-10-25 04:38:35 +08:00
|
|
|
|
|
|
|
gimp_action_group_add_enum_actions (group,
|
|
|
|
gradient_editor_zoom_actions,
|
|
|
|
G_N_ELEMENTS (gradient_editor_zoom_actions),
|
|
|
|
G_CALLBACK (gradient_editor_zoom_cmd_callback));
|
2004-04-19 22:54:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gradient_editor_actions_update (GimpActionGroup *group,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2004-10-25 04:38:35 +08:00
|
|
|
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
|
|
|
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
|
|
|
|
GimpGradient *gradient;
|
|
|
|
gboolean editable = FALSE;
|
2006-09-01 06:35:19 +08:00
|
|
|
GimpRGB left_color;
|
|
|
|
GimpRGB right_color;
|
|
|
|
GimpRGB left_seg_color;
|
|
|
|
GimpRGB right_seg_color;
|
2004-04-19 22:54:24 +08:00
|
|
|
GimpRGB fg;
|
|
|
|
GimpRGB bg;
|
|
|
|
gboolean blending_equal = TRUE;
|
|
|
|
gboolean coloring_equal = TRUE;
|
2006-09-01 06:35:19 +08:00
|
|
|
gboolean left_editable = TRUE;
|
|
|
|
gboolean right_editable = TRUE;
|
2004-10-25 04:38:35 +08:00
|
|
|
gboolean selection = FALSE;
|
|
|
|
gboolean delete = FALSE;
|
2005-10-26 05:38:00 +08:00
|
|
|
gboolean edit_active = FALSE;
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
gradient = GIMP_GRADIENT (data_editor->data);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
if (gradient)
|
2004-05-23 18:04:41 +08:00
|
|
|
{
|
2004-10-25 04:38:35 +08:00
|
|
|
GimpGradientSegmentType type;
|
|
|
|
GimpGradientSegmentColor color;
|
2006-09-01 06:35:19 +08:00
|
|
|
GimpGradientSegment *left_seg;
|
|
|
|
GimpGradientSegment *right_seg;
|
2004-10-25 04:38:35 +08:00
|
|
|
GimpGradientSegment *seg, *aseg;
|
|
|
|
|
|
|
|
if (data_editor->data_editable)
|
|
|
|
editable = TRUE;
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
gimp_gradient_get_color_at (gradient, data_editor->context,
|
|
|
|
editor->control_sel_l,
|
|
|
|
editor->control_sel_l->left, FALSE,
|
|
|
|
&left_color);
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
if (editor->control_sel_l->prev)
|
|
|
|
left_seg = editor->control_sel_l->prev;
|
|
|
|
else
|
|
|
|
left_seg = gimp_gradient_segment_get_last (editor->control_sel_l);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
gimp_gradient_get_color_at (gradient, data_editor->context,
|
|
|
|
left_seg, left_seg->right, FALSE,
|
|
|
|
&left_seg_color);
|
|
|
|
|
|
|
|
gimp_gradient_get_color_at (gradient, data_editor->context,
|
|
|
|
editor->control_sel_r,
|
|
|
|
editor->control_sel_r->right, FALSE,
|
|
|
|
&right_color);
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
if (editor->control_sel_r->next)
|
|
|
|
right_seg = editor->control_sel_r->next;
|
|
|
|
else
|
|
|
|
right_seg = gimp_gradient_segment_get_first (editor->control_sel_r);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
gimp_gradient_get_color_at (gradient, data_editor->context,
|
|
|
|
right_seg, right_seg->left, FALSE,
|
|
|
|
&right_seg_color);
|
|
|
|
|
|
|
|
left_editable = (editor->control_sel_l->left_color_type ==
|
|
|
|
GIMP_GRADIENT_COLOR_FIXED);
|
|
|
|
right_editable = (editor->control_sel_r->right_color_type ==
|
|
|
|
GIMP_GRADIENT_COLOR_FIXED);
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
type = editor->control_sel_l->type;
|
|
|
|
color = editor->control_sel_l->color;
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
seg = editor->control_sel_l;
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
do
|
|
|
|
{
|
|
|
|
blending_equal = blending_equal && (seg->type == type);
|
|
|
|
coloring_equal = coloring_equal && (seg->color == color);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
aseg = seg;
|
|
|
|
seg = seg->next;
|
|
|
|
}
|
|
|
|
while (aseg != editor->control_sel_r);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
selection = (editor->control_sel_l != editor->control_sel_r);
|
|
|
|
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
|
|
|
|
}
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
if (data_editor->context)
|
2004-10-25 04:38:35 +08:00
|
|
|
{
|
2006-09-01 06:35:19 +08:00
|
|
|
gimp_context_get_foreground (data_editor->context, &fg);
|
|
|
|
gimp_context_get_background (data_editor->context, &bg);
|
2004-10-25 04:38:35 +08:00
|
|
|
}
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-12-21 08:01:47 +08:00
|
|
|
/* pretend the gradient not being editable while the dialog is
|
|
|
|
* insensitive. prevents the gradient from being modified while a
|
|
|
|
* dialog is running. bug #161411 --mitch
|
|
|
|
*/
|
|
|
|
if (! GTK_WIDGET_SENSITIVE (editor))
|
|
|
|
editable = FALSE;
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
if (! editable)
|
|
|
|
{
|
|
|
|
left_editable = FALSE;
|
|
|
|
right_editable = FALSE;
|
|
|
|
}
|
|
|
|
|
2005-10-26 05:38:00 +08:00
|
|
|
edit_active = gimp_data_editor_get_edit_active (data_editor);
|
|
|
|
|
2004-10-18 19:29:58 +08:00
|
|
|
#define SET_ACTIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
2004-04-19 22:54:24 +08:00
|
|
|
#define SET_COLOR(action,color,set_label) \
|
|
|
|
gimp_action_group_set_action_color (group, action, (color), (set_label))
|
|
|
|
#define SET_LABEL(action,label) \
|
|
|
|
gimp_action_group_set_action_label (group, action, (label))
|
|
|
|
#define SET_SENSITIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
|
|
|
#define SET_VISIBLE(action,condition) \
|
|
|
|
gimp_action_group_set_action_visible (group, action, (condition) != 0)
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-left-color-fixed", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-left-color-foreground", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-left-color-foreground-transparent", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-left-color-background", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-left-color-background-transparent", editable);
|
|
|
|
|
|
|
|
if (gradient)
|
|
|
|
{
|
|
|
|
switch (editor->control_sel_l->left_color_type)
|
|
|
|
{
|
|
|
|
case GIMP_GRADIENT_COLOR_FIXED:
|
|
|
|
SET_ACTIVE ("gradient-editor-left-color-fixed", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_FOREGROUND:
|
|
|
|
SET_ACTIVE ("gradient-editor-left-color-foreground", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT:
|
|
|
|
SET_ACTIVE ("gradient-editor-left-color-foreground-transparent", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_BACKGROUND:
|
|
|
|
SET_ACTIVE ("gradient-editor-left-color-background", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT:
|
|
|
|
SET_ACTIVE ("gradient-editor-left-color-background-transparent", TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_SENSITIVE ("gradient-editor-left-color", left_editable);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-left-neighbor", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-right-endpoint", editable);
|
|
|
|
|
|
|
|
if (gradient)
|
|
|
|
{
|
|
|
|
SET_COLOR ("gradient-editor-left-color",
|
2006-09-01 06:35:19 +08:00
|
|
|
&left_color, FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_COLOR ("gradient-editor-load-left-left-neighbor",
|
2006-09-01 06:35:19 +08:00
|
|
|
&left_seg_color, FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_COLOR ("gradient-editor-load-left-right-endpoint",
|
2006-09-01 06:35:19 +08:00
|
|
|
&right_color, FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
}
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-fg", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-bg", left_editable);
|
|
|
|
|
|
|
|
SET_COLOR ("gradient-editor-load-left-fg",
|
|
|
|
data_editor->context ? &fg : NULL, FALSE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-bg",
|
|
|
|
data_editor->context ? &bg : NULL, FALSE);
|
|
|
|
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-01", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-02", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-03", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-04", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-05", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-06", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-07", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-08", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-09", left_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-left-10", left_editable);
|
2004-10-25 04:38:35 +08:00
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_COLOR ("gradient-editor-load-left-01", &editor->saved_colors[0], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-02", &editor->saved_colors[1], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-03", &editor->saved_colors[2], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-04", &editor->saved_colors[3], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-05", &editor->saved_colors[4], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-06", &editor->saved_colors[5], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-07", &editor->saved_colors[6], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-08", &editor->saved_colors[7], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-09", &editor->saved_colors[8], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-left-10", &editor->saved_colors[9], TRUE);
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-01", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-02", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-03", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-04", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-05", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-06", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-07", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-08", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-09", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-left-10", gradient);
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_COLOR ("gradient-editor-save-left-01", &editor->saved_colors[0], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-02", &editor->saved_colors[1], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-03", &editor->saved_colors[2], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-04", &editor->saved_colors[3], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-05", &editor->saved_colors[4], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-06", &editor->saved_colors[5], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-07", &editor->saved_colors[6], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-08", &editor->saved_colors[7], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-09", &editor->saved_colors[8], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-left-10", &editor->saved_colors[9], TRUE);
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-right-color-fixed", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-right-color-foreground", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-right-color-foreground-transparent", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-right-color-background", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-right-color-background-transparent", editable);
|
|
|
|
|
|
|
|
if (gradient)
|
|
|
|
{
|
|
|
|
switch (editor->control_sel_r->right_color_type)
|
|
|
|
{
|
|
|
|
case GIMP_GRADIENT_COLOR_FIXED:
|
|
|
|
SET_ACTIVE ("gradient-editor-right-color-fixed", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_FOREGROUND:
|
|
|
|
SET_ACTIVE ("gradient-editor-right-color-foreground", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT:
|
|
|
|
SET_ACTIVE ("gradient-editor-right-color-foreground-transparent", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_BACKGROUND:
|
|
|
|
SET_ACTIVE ("gradient-editor-right-color-background", TRUE);
|
|
|
|
break;
|
|
|
|
case GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT:
|
|
|
|
SET_ACTIVE ("gradient-editor-right-color-background-transparent", TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_SENSITIVE ("gradient-editor-right-color", right_editable);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-right-neighbor", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-left-endpoint", editable);
|
|
|
|
|
|
|
|
if (gradient)
|
|
|
|
{
|
|
|
|
SET_COLOR ("gradient-editor-right-color",
|
2006-09-01 06:35:19 +08:00
|
|
|
&right_color, FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_COLOR ("gradient-editor-load-right-right-neighbor",
|
2006-09-01 06:35:19 +08:00
|
|
|
&right_seg_color, FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_COLOR ("gradient-editor-load-right-left-endpoint",
|
2006-09-01 06:35:19 +08:00
|
|
|
&left_color, FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
}
|
|
|
|
|
2006-09-01 06:35:19 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-fg", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-bg", right_editable);
|
|
|
|
|
|
|
|
SET_COLOR ("gradient-editor-load-right-fg",
|
|
|
|
data_editor->context ? &fg : NULL, FALSE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-bg",
|
|
|
|
data_editor->context ? &bg : NULL, FALSE);
|
|
|
|
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-01", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-02", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-03", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-04", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-05", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-06", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-07", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-08", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-09", right_editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-load-right-10", right_editable);
|
2004-10-25 04:38:35 +08:00
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_COLOR ("gradient-editor-load-right-01", &editor->saved_colors[0], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-02", &editor->saved_colors[1], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-03", &editor->saved_colors[2], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-04", &editor->saved_colors[3], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-05", &editor->saved_colors[4], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-06", &editor->saved_colors[5], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-07", &editor->saved_colors[6], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-08", &editor->saved_colors[7], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-09", &editor->saved_colors[8], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-load-right-10", &editor->saved_colors[9], TRUE);
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-01", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-02", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-03", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-04", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-05", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-06", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-07", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-08", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-09", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-save-right-10", gradient);
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_COLOR ("gradient-editor-save-right-01", &editor->saved_colors[0], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-02", &editor->saved_colors[1], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-03", &editor->saved_colors[2], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-04", &editor->saved_colors[3], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-05", &editor->saved_colors[4], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-06", &editor->saved_colors[5], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-07", &editor->saved_colors[6], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-08", &editor->saved_colors[7], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-09", &editor->saved_colors[8], TRUE);
|
|
|
|
SET_COLOR ("gradient-editor-save-right-10", &editor->saved_colors[9], TRUE);
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-flip", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-replicate", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-split-midpoint", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-split-uniform", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-delete", editable && delete);
|
|
|
|
SET_SENSITIVE ("gradient-editor-recenter", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-redistribute", editable);
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
if (! selection)
|
|
|
|
{
|
|
|
|
SET_LABEL ("gradient-editor-blending-func",
|
|
|
|
_("_Blending Function for Segment"));
|
|
|
|
SET_LABEL ("gradient-editor-coloring-type",
|
|
|
|
_("Coloring _Type for Segment"));
|
|
|
|
|
|
|
|
SET_LABEL ("gradient-editor-flip",
|
|
|
|
_("_Flip Segment"));
|
|
|
|
SET_LABEL ("gradient-editor-replicate",
|
|
|
|
_("_Replicate Segment..."));
|
|
|
|
SET_LABEL ("gradient-editor-split-midpoint",
|
|
|
|
_("Split Segment at _Midpoint"));
|
|
|
|
SET_LABEL ("gradient-editor-split-uniform",
|
|
|
|
_("Split Segment _Uniformly..."));
|
|
|
|
SET_LABEL ("gradient-editor-delete",
|
|
|
|
_("_Delete Segment"));
|
|
|
|
SET_LABEL ("gradient-editor-recenter",
|
|
|
|
_("Re-_center Segment's Midpoint"));
|
2004-04-29 20:52:29 +08:00
|
|
|
SET_LABEL ("gradient-editor-redistribute",
|
|
|
|
_("Re-distribute _Handles in Segment"));
|
2004-04-19 22:54:24 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SET_LABEL ("gradient-editor-blending-func",
|
|
|
|
_("_Blending Function for Selection"));
|
|
|
|
SET_LABEL ("gradient-editor-coloring-type",
|
|
|
|
_("Coloring _Type for Selection"));
|
|
|
|
|
|
|
|
SET_LABEL ("gradient-editor-flip",
|
|
|
|
_("_Flip Selection"));
|
|
|
|
SET_LABEL ("gradient-editor-replicate",
|
|
|
|
_("_Replicate Selection..."));
|
|
|
|
SET_LABEL ("gradient-editor-split-midpoint",
|
|
|
|
_("Split Segments at _Midpoints"));
|
|
|
|
SET_LABEL ("gradient-editor-split-uniform",
|
|
|
|
_("Split Segments _Uniformly..."));
|
|
|
|
SET_LABEL ("gradient-editor-delete",
|
|
|
|
_("_Delete Selection"));
|
|
|
|
SET_LABEL ("gradient-editor-recenter",
|
|
|
|
_("Re-_center Midpoints in Selection"));
|
|
|
|
SET_LABEL ("gradient-editor-redistribute",
|
|
|
|
_("Re-distribute _Handles in Selection"));
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_SENSITIVE ("gradient-editor-blending-varies", FALSE);
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_VISIBLE ("gradient-editor-blending-varies", ! blending_equal);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-blending-linear", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-blending-curved", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-blending-sine", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-blending-sphere-increasing", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-blending-sphere-decreasing", editable);
|
2004-06-02 02:49:50 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
if (blending_equal && gradient)
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
switch (editor->control_sel_l->type)
|
|
|
|
{
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_LINEAR:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-blending-linear", TRUE);
|
|
|
|
break;
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_CURVED:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-blending-curved", TRUE);
|
|
|
|
break;
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_SINE:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-blending-sine", TRUE);
|
|
|
|
break;
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-blending-sphere-increasing", TRUE);
|
|
|
|
break;
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-blending-sphere-decreasing", TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SET_ACTIVE ("gradient-editor-blending-varies", TRUE);
|
|
|
|
}
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-coloring-varies", FALSE);
|
|
|
|
SET_VISIBLE ("gradient-editor-coloring-varies", ! coloring_equal);
|
2004-06-02 02:49:50 +08:00
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-coloring-rgb", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-coloring-hsv-ccw", editable);
|
|
|
|
SET_SENSITIVE ("gradient-editor-coloring-hsv-cw", editable);
|
|
|
|
|
|
|
|
if (coloring_equal && gradient)
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
|
|
|
switch (editor->control_sel_l->color)
|
|
|
|
{
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_RGB:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-coloring-rgb", TRUE);
|
|
|
|
break;
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_HSV_CCW:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-coloring-hsv-ccw", TRUE);
|
|
|
|
break;
|
2004-06-02 02:49:50 +08:00
|
|
|
case GIMP_GRADIENT_SEGMENT_HSV_CW:
|
2004-04-19 22:54:24 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-coloring-hsv-cw", TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SET_ACTIVE ("gradient-editor-coloring-varies", TRUE);
|
|
|
|
}
|
|
|
|
|
2004-10-25 04:38:35 +08:00
|
|
|
SET_SENSITIVE ("gradient-editor-blend-color", editable && selection);
|
|
|
|
SET_SENSITIVE ("gradient-editor-blend-opacity", editable && selection);
|
|
|
|
|
|
|
|
SET_SENSITIVE ("gradient-editor-zoom-out", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-zoom-in", gradient);
|
|
|
|
SET_SENSITIVE ("gradient-editor-zoom-all", gradient);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2005-10-26 05:38:00 +08:00
|
|
|
SET_ACTIVE ("gradient-editor-edit-active", edit_active);
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
#undef SET_ACTIVE
|
|
|
|
#undef SET_COLOR
|
|
|
|
#undef SET_LABEL
|
|
|
|
#undef SET_SENSITIVE
|
|
|
|
#undef SET_VISIBLE
|
|
|
|
}
|