Commit 5ea3baa0 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

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.
parent da56b530
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.
......
......@@ -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
......
......@@ -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 */
......
......@@ -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__ */
......@@ -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))
......
......@@ -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);
}
}
......@@ -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_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_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_reset_cmd_callback (GtkAction *action,
gpointer data);
void tools_color_average_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __TOOLS_COMMANDS_H__ */
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