Commit 32d8cb9a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/actions/tools-actions.c app/actions/tools-commands.[ch] allow to

2008-03-06  Sven Neumann  <sven@gimp.org>

	* app/actions/tools-actions.c 
	* app/actions/tools-commands.[ch]
	* app/tools/gimptransformtool.c: allow to control the preview
	opacity by actions (defaults to < to > keys).

svn path=/trunk/; revision=25050
parent b870738a
2008-03-06 Sven Neumann <sven@gimp.org>
* app/actions/tools-actions.c
* app/actions/tools-commands.[ch]
* app/tools/gimptransformtool.c: allow to control the preview
opacity by actions (defaults to < to > keys).
2008-03-06 Sven Neumann <sven@gimp.org>
* app/tools/gimptransformtool.c
......
......@@ -115,11 +115,11 @@ static const GimpEnumActionEntry tools_color_average_radius_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-color-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
"M Color Picker Radius", NULL, NULL,
"Minimize Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-color-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Maximum Color Picker Radius", NULL, NULL,
"Maximize Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-color-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER,
......@@ -149,11 +149,11 @@ static const GimpEnumActionEntry tools_paint_brush_scale_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-paint-brush-scale-minimum", GIMP_STOCK_TOOL_PAINTBRUSH,
"M Brush Scale", NULL, NULL,
"Minimize Brush Scale", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-paint-brush-scale-maximum", GIMP_STOCK_TOOL_PAINTBRUSH,
"Maximum Brush Scale", NULL, NULL,
"Maximize Brush Scale", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-paint-brush-scale-decrease", GIMP_STOCK_TOOL_PAINTBRUSH,
......@@ -181,11 +181,11 @@ static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-ink-blob-size-minimum", GIMP_STOCK_TOOL_INK,
"M Ink Blob Size", NULL, NULL,
"Minimize Ink Blob Size", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-ink-blob-size-maximum", GIMP_STOCK_TOOL_INK,
"Maximum Ink Blob Size", NULL, NULL,
"Maximize Ink Blob Size", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-ink-blob-size-decrease", GIMP_STOCK_TOOL_INK,
......@@ -213,11 +213,11 @@ static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-ink-blob-aspect-minimum", GIMP_STOCK_TOOL_INK,
"M Ink Blob Aspect", NULL, NULL,
"Minimize Ink Blob Aspect", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-ink-blob-aspect-maximum", GIMP_STOCK_TOOL_INK,
"Maximum Ink Blob Aspect", NULL, NULL,
"Maximize Ink Blob Aspect", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-ink-blob-aspect-decrease", GIMP_STOCK_TOOL_INK,
......@@ -245,11 +245,11 @@ static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-ink-blob-angle-minimum", GIMP_STOCK_TOOL_INK,
"M Ink Blob Angle", NULL, NULL,
"Minimize Ink Blob Angle", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-ink-blob-angle-maximum", GIMP_STOCK_TOOL_INK,
"Maximum Ink Blob Angle", NULL, NULL,
"Maximize Ink Blob Angle", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-ink-blob-angle-decrease", GIMP_STOCK_TOOL_INK,
......@@ -279,12 +279,12 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
NULL },
{ "tools-foreground-select-brush-size-minimum",
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
"M Foreground Select Brush Size", NULL, NULL,
"Minimize Foreground Select Brush Size", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-foreground-select-brush-size-maximum",
GIMP_STOCK_TOOL_FOREGROUND_SELECT,
"Maximum Foreground Select Brush Size", NULL, NULL,
"Maximize Foreground Select Brush Size", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-foreground-select-brush-size-decrease",
......@@ -309,6 +309,38 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
NULL },
};
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 },
};
static const GimpEnumActionEntry tools_value_1_actions[] =
{
{ "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS,
......@@ -537,6 +569,11 @@ tools_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (tools_foreground_select_brush_size_actions),
G_CALLBACK (tools_fg_select_brush_size_cmd_callback));
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));
gimp_action_group_add_enum_actions (group,
tools_value_1_actions,
G_N_ELEMENTS (tools_value_1_actions),
......
......@@ -41,6 +41,7 @@
#include "tools/gimprectangleoptions.h"
#include "tools/gimpimagemaptool.h"
#include "tools/gimptoolcontrol.h"
#include "tools/gimptransformoptions.h"
#include "tools/tool_manager.h"
#include "actions.h"
......@@ -372,6 +373,26 @@ tools_fg_select_brush_size_cmd_callback (GtkAction *action,
}
}
void
tools_transform_preview_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpToolInfo *tool_info;
return_if_no_context (context, data);
tool_info = gimp_context_get_tool (context);
if (tool_info && GIMP_IS_TRANSFORM_OPTIONS (tool_info->tool_options))
{
action_select_property ((GimpActionSelectType) value,
G_OBJECT (tool_info->tool_options),
"preview-opacity",
0.01, 0.1, 0.5, FALSE);
}
}
void
tools_value_1_cmd_callback (GtkAction *action,
gint value,
......
......@@ -20,65 +20,68 @@
#define __TOOLS_COMMANDS_H__
void tools_select_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
void tools_toggle_visibility_cmd_callback (GtkAction *action,
gpointer data);
void tools_select_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
void tools_toggle_visibility_cmd_callback (GtkAction *action,
gpointer data);
void tools_raise_cmd_callback (GtkAction *action,
gpointer data);
void tools_raise_to_top_cmd_callback (GtkAction *action,
gpointer data);
void tools_lower_cmd_callback (GtkAction *action,
gpointer data);
void tools_lower_to_bottom_cmd_callback (GtkAction *action,
gpointer data);
void tools_raise_cmd_callback (GtkAction *action,
gpointer data);
void tools_raise_to_top_cmd_callback (GtkAction *action,
gpointer data);
void tools_lower_cmd_callback (GtkAction *action,
gpointer data);
void tools_lower_to_bottom_cmd_callback (GtkAction *action,
gpointer data);
void tools_reset_cmd_callback (GtkAction *action,
gpointer data);
void tools_reset_cmd_callback (GtkAction *action,
gpointer data);
void tools_color_average_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_color_average_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_paint_brush_scale_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_paint_brush_scale_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_ink_blob_size_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_ink_blob_aspect_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_ink_blob_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_ink_blob_size_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_ink_blob_aspect_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_ink_blob_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_fg_select_brush_size_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_fg_select_brush_size_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_transform_preview_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_1_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_2_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_3_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_4_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_1_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_2_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_3_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_4_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_object_1_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_object_2_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_object_1_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_object_2_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __TOOLS_COMMANDS_H__ */
......@@ -191,10 +191,11 @@ gimp_transform_tool_class_init (GimpTransformToolClass *klass)
static void
gimp_transform_tool_init (GimpTransformTool *tr_tool)
{
GimpTool *tool;
GimpTool *tool = GIMP_TOOL (tr_tool);
gint i;
tool = GIMP_TOOL (tr_tool);
gimp_tool_control_set_action_value_1 (tool->control,
"tools/tools-transform-preview-opacity-set");
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_preserve (tool->control, FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment