app/actions/context-actions.c removed the newly added color picker radius

2005-02-21  Michael Natterer  <mitch@gimp.org>

	* app/actions/context-actions.c
	* app/actions/context-commands.[ch]: removed the newly added color
	picker radius actions...

	* app/actions/tools-actions.c
	* app/actions/tools-commands.[ch]: ...and added them here.
This commit is contained in:
Michael Natterer 2005-02-21 11:55:39 +00:00 committed by Michael Natterer
parent da56b5305f
commit 5ea3baa090
7 changed files with 100 additions and 92 deletions

View File

@ -1,3 +1,12 @@
2005-02-21 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: removed the newly added color
picker radius actions...
* app/actions/tools-actions.c
* app/actions/tools-commands.[ch]: ...and added them here.
2005-02-20 Manish Singh <yosh@gimp.org>
Support for custom plug-in interpreters, independent of OS support.

View File

@ -612,40 +612,6 @@ static GimpEnumActionEntry context_brush_angle_actions[] =
NULL },
};
static GimpEnumActionEntry context_color_tool_average_radius_actions[] =
{
{ "context-color-tool-average-radius-set", GIMP_STOCK_TOOL_COLOR_PICKER,
"Set Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-color-tool-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Minumum Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-color-tool-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Maximum Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-color-tool-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER,
"Decrease Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-color-tool-average-radius-increase", GIMP_STOCK_TOOL_COLOR_PICKER,
"Increase Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-color-tool-average-radius-decrease-skip",
GIMP_STOCK_TOOL_COLOR_PICKER,
"Decrease Color Picker Radius More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-color-tool-average-radius-increase-skip",
GIMP_STOCK_TOOL_COLOR_PICKER,
"Increase Color Picker Radius More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
void
context_actions_setup (GimpActionGroup *group)
@ -738,10 +704,6 @@ context_actions_setup (GimpActionGroup *group)
context_brush_angle_actions,
G_N_ELEMENTS (context_brush_angle_actions),
G_CALLBACK (context_brush_angle_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_color_tool_average_radius_actions,
G_N_ELEMENTS (context_color_tool_average_radius_actions),
G_CALLBACK (context_color_tool_average_radius_cmd_callback));
}
void

View File

@ -31,9 +31,6 @@
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "tools/gimpcoloroptions.h"
#include "actions.h"
#include "context-commands.h"
@ -462,38 +459,6 @@ context_brush_angle_cmd_callback (GtkAction *action,
}
}
void
context_color_tool_average_radius_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_COLOR_OPTIONS (tool_info->tool_options))
{
GimpToolOptions *options = tool_info->tool_options;
GParamSpec *pspec;
gdouble radius;
g_object_get (options, "average-radius", &radius, NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (options),
"average-radius");
radius = action_select_value ((GimpActionSelectType) value,
radius,
G_PARAM_SPEC_DOUBLE (pspec)->minimum,
G_PARAM_SPEC_DOUBLE (pspec)->maximum,
1.0, 10.0, FALSE);
g_object_set (options, "average-radius", radius, NULL);
}
}
/* private functions */

View File

@ -90,9 +90,5 @@ void context_brush_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_color_tool_average_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __CONTEXT_COMMANDS_H__ */

View File

@ -106,6 +106,40 @@ static GimpStringActionEntry tools_alternative_actions[] =
GIMP_HELP_TOOL_ROTATE }
};
static GimpEnumActionEntry tools_color_average_radius_actions[] =
{
{ "tools-color-average-radius-set", GIMP_STOCK_TOOL_COLOR_PICKER,
"Set Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-color-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Minumum 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,
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 },
};
void
tools_actions_setup (GimpActionGroup *group)
@ -134,6 +168,11 @@ tools_actions_setup (GimpActionGroup *group)
"tools-rotate-arbitrary");
gtk_action_set_accel_path (action, "<Actions>/tools/tools-rotate");
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));
for (list = GIMP_LIST (group->gimp->tool_info_list)->list;
list;
list = g_list_next (list))

View File

@ -28,6 +28,7 @@
#include "core/gimptoolinfo.h"
#include "tools/gimp-tools.h"
#include "tools/gimpcoloroptions.h"
#include "tools/gimpimagemaptool.h"
#include "tools/tool_manager.h"
@ -216,3 +217,35 @@ tools_reset_cmd_callback (GtkAction *action,
}
}
}
void
tools_color_average_radius_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_COLOR_OPTIONS (tool_info->tool_options))
{
GimpToolOptions *options = tool_info->tool_options;
GParamSpec *pspec;
gdouble radius;
g_object_get (options, "average-radius", &radius, NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (options),
"average-radius");
radius = action_select_value ((GimpActionSelectType) value,
radius,
G_PARAM_SPEC_DOUBLE (pspec)->minimum,
G_PARAM_SPEC_DOUBLE (pspec)->maximum,
1.0, 10.0, FALSE);
g_object_set (options, "average-radius", radius, NULL);
}
}

View File

@ -20,23 +20,27 @@
#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);
#endif /* __TOOLS_COMMANDS_H__ */