mirror of https://github.com/GNOME/gimp.git
Fixed bug #165618:
2005-03-04 Michael Natterer <mitch@gimp.org> Fixed bug #165618: * app/tools/gimptoolcontrol.[ch]: added new functions gimp_tool_control_set/get_action_value_1/2/3/4() which allow tools to specify their primary, secondary etc. "values" using action-identifying strings like "context/context-brush-radius-set". * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcolortool.c * app/tools/gimpinktool.c * app/tools/gimppainttool.c: set actions where appropriate. Still needs some way to document the mapping in a user-visible way. * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c: tab removal and minor cleanups. * app/actions/actions.[ch]: added utility function action_select_property(). * app/actions/tools-actions.c * app/actions/tools-commands.[ch]: added actions and callbacks for setting the ink blob size, aspect and angle. Also added actions and callbacks for the new generic tool values.
This commit is contained in:
parent
e6d4e36906
commit
a303b44c62
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
|||
2005-03-04 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Fixed bug #165618:
|
||||
|
||||
* app/tools/gimptoolcontrol.[ch]: added new functions
|
||||
gimp_tool_control_set/get_action_value_1/2/3/4() which allow tools
|
||||
to specify their primary, secondary etc. "values" using
|
||||
action-identifying strings like "context/context-brush-radius-set".
|
||||
|
||||
* app/tools/gimpblendtool.c
|
||||
* app/tools/gimpbucketfilltool.c
|
||||
* app/tools/gimpcolortool.c
|
||||
* app/tools/gimpinktool.c
|
||||
* app/tools/gimppainttool.c: set actions where appropriate. Still
|
||||
needs some way to document the mapping in a user-visible way.
|
||||
|
||||
* app/tools/gimpblendtool.c
|
||||
* app/tools/gimpbucketfilltool.c: tab removal and minor cleanups.
|
||||
|
||||
* app/actions/actions.[ch]: added utility function
|
||||
action_select_property().
|
||||
|
||||
* app/actions/tools-actions.c
|
||||
* app/actions/tools-commands.[ch]: added actions and callbacks for
|
||||
setting the ink blob size, aspect and angle. Also added actions
|
||||
and callbacks for the new generic tool values.
|
||||
|
||||
2005-03-03 Helvetix Victorinox <helvetix@gimp.org>
|
||||
|
||||
* app/composite/make-installer.py:Applied patch from
|
||||
|
|
|
@ -412,6 +412,36 @@ action_select_value (GimpActionSelectType select_type,
|
|||
return value;
|
||||
}
|
||||
|
||||
void
|
||||
action_select_property (GimpActionSelectType select_type,
|
||||
GObject *object,
|
||||
const gchar *property_name,
|
||||
gdouble inc,
|
||||
gdouble skip_inc,
|
||||
gboolean wrap)
|
||||
{
|
||||
GParamSpec *pspec;
|
||||
gdouble value;
|
||||
|
||||
g_return_if_fail (G_IS_OBJECT (object));
|
||||
g_return_if_fail (property_name != NULL);
|
||||
|
||||
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),
|
||||
property_name);
|
||||
|
||||
g_return_if_fail (G_IS_PARAM_SPEC_DOUBLE (pspec));
|
||||
|
||||
g_object_get (object, property_name, &value, NULL);
|
||||
|
||||
value = action_select_value (select_type,
|
||||
value,
|
||||
G_PARAM_SPEC_DOUBLE (pspec)->minimum,
|
||||
G_PARAM_SPEC_DOUBLE (pspec)->maximum,
|
||||
inc, skip_inc, wrap);
|
||||
|
||||
g_object_set (object, property_name, value, NULL);
|
||||
}
|
||||
|
||||
GimpObject *
|
||||
action_select_object (GimpActionSelectType select_type,
|
||||
GimpContainer *container,
|
||||
|
|
|
@ -39,6 +39,12 @@ gdouble action_select_value (GimpActionSelectType select_type,
|
|||
gdouble inc,
|
||||
gdouble skip_inc,
|
||||
gboolean wrap);
|
||||
void action_select_property (GimpActionSelectType select_type,
|
||||
GObject *object,
|
||||
const gchar *property_name,
|
||||
gdouble inc,
|
||||
gdouble skip_inc,
|
||||
gboolean wrap);
|
||||
GimpObject * action_select_object (GimpActionSelectType select_type,
|
||||
GimpContainer *container,
|
||||
GimpObject *current);
|
||||
|
|
|
@ -140,6 +140,230 @@ static GimpEnumActionEntry tools_color_average_radius_actions[] =
|
|||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_ink_blob_size_actions[] =
|
||||
{
|
||||
{ "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,
|
||||
"Minumum 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,
|
||||
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 },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
|
||||
{
|
||||
{ "tools-ink-blob-aspect-set", GIMP_STOCK_TOOL_INK,
|
||||
"Set Ink Blob Aspect", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SET, TRUE,
|
||||
NULL },
|
||||
{ "tools-ink-blob-aspect-minimum", GIMP_STOCK_TOOL_INK,
|
||||
"Minumum 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,
|
||||
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 },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_ink_blob_angle_actions[] =
|
||||
{
|
||||
{ "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,
|
||||
"Minumum 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,
|
||||
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 },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_1_actions[] =
|
||||
{
|
||||
{ "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 1", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SET, TRUE,
|
||||
NULL },
|
||||
{ "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,
|
||||
"Decrease Value 1", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
||||
NULL },
|
||||
{ "tools-value-1-increase", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Increase Value 1", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_NEXT, FALSE,
|
||||
NULL },
|
||||
{ "tools-value-1-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Decrease Value 1 More", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
||||
NULL },
|
||||
{ "tools-value-1-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Increase Value 1 More", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_2_actions[] =
|
||||
{
|
||||
{ "tools-value-2-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 2", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SET, TRUE,
|
||||
NULL },
|
||||
{ "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,
|
||||
"Decrease Value 2", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
|
||||
NULL },
|
||||
{ "tools-value-2-increase", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Increase Value 2", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_NEXT, FALSE,
|
||||
NULL },
|
||||
{ "tools-value-2-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Decrease Value 2 More", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
|
||||
NULL },
|
||||
{ "tools-value-2-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Increase Value 2 More", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_3_actions[] =
|
||||
{
|
||||
{ "tools-value-3-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 3", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SET, TRUE,
|
||||
NULL },
|
||||
{ "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 },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_4_actions[] =
|
||||
{
|
||||
{ "tools-value-4-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 4", NULL, NULL,
|
||||
GIMP_ACTION_SELECT_SET, TRUE,
|
||||
NULL },
|
||||
{ "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 },
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
tools_actions_setup (GimpActionGroup *group)
|
||||
|
@ -173,6 +397,36 @@ tools_actions_setup (GimpActionGroup *group)
|
|||
G_N_ELEMENTS (tools_color_average_radius_actions),
|
||||
G_CALLBACK (tools_color_average_radius_cmd_callback));
|
||||
|
||||
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));
|
||||
|
||||
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));
|
||||
|
||||
for (list = GIMP_LIST (group->gimp->tool_info_list)->list;
|
||||
list;
|
||||
list = g_list_next (list))
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "actions-types.h"
|
||||
|
@ -27,9 +29,15 @@
|
|||
#include "core/gimpcontext.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "paint/gimpinkoptions.h"
|
||||
|
||||
#include "widgets/gimpenumaction.h"
|
||||
#include "widgets/gimpuimanager.h"
|
||||
|
||||
#include "tools/gimp-tools.h"
|
||||
#include "tools/gimpcoloroptions.h"
|
||||
#include "tools/gimpimagemaptool.h"
|
||||
#include "tools/gimptoolcontrol.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "actions.h"
|
||||
|
@ -231,21 +239,193 @@ tools_color_average_radius_cmd_callback (GtkAction *action,
|
|||
|
||||
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);
|
||||
action_select_property ((GimpActionSelectType) value,
|
||||
G_OBJECT (tool_info->tool_options),
|
||||
"average-radius",
|
||||
1.0, 10.0, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tools_ink_blob_size_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_INK_OPTIONS (tool_info->tool_options))
|
||||
{
|
||||
action_select_property ((GimpActionSelectType) value,
|
||||
G_OBJECT (tool_info->tool_options),
|
||||
"size",
|
||||
1.0, 10.0, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tools_ink_blob_aspect_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_INK_OPTIONS (tool_info->tool_options))
|
||||
{
|
||||
action_select_property ((GimpActionSelectType) value,
|
||||
G_OBJECT (tool_info->tool_options),
|
||||
"blob-aspect",
|
||||
0.1, 1.0, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tools_ink_blob_angle_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_INK_OPTIONS (tool_info->tool_options))
|
||||
{
|
||||
action_select_property ((GimpActionSelectType) value,
|
||||
G_OBJECT (tool_info->tool_options),
|
||||
"blob-angle",
|
||||
1.0, 15.0, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
tools_activate_value_action (const gchar *action_desc,
|
||||
gint value)
|
||||
{
|
||||
gchar *group_name;
|
||||
gchar *action_name;
|
||||
|
||||
group_name = g_strdup (action_desc);
|
||||
action_name = strchr (group_name, '/');
|
||||
|
||||
if (action_name)
|
||||
{
|
||||
GList *managers;
|
||||
GtkAction *action;
|
||||
|
||||
*action_name++ = '\0';
|
||||
|
||||
managers = gimp_ui_managers_from_name ("<Image>");
|
||||
|
||||
action = gimp_ui_manager_find_action (managers->data,
|
||||
group_name, action_name);
|
||||
|
||||
if (GIMP_IS_ENUM_ACTION (action))
|
||||
{
|
||||
gint old_value;
|
||||
|
||||
old_value = GIMP_ENUM_ACTION (action)->value;
|
||||
GIMP_ENUM_ACTION (action)->value = value;
|
||||
gtk_action_activate (action);
|
||||
GIMP_ENUM_ACTION (action)->value = old_value;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (group_name);
|
||||
}
|
||||
|
||||
void
|
||||
tools_value_1_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpTool *tool;
|
||||
return_if_no_context (context, data);
|
||||
|
||||
tool = tool_manager_get_active (context->gimp);
|
||||
|
||||
if (tool)
|
||||
{
|
||||
const gchar *action_desc;
|
||||
|
||||
action_desc = gimp_tool_control_get_action_value_1 (tool->control);
|
||||
|
||||
if (action_desc)
|
||||
tools_activate_value_action (action_desc, value);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tools_value_2_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpTool *tool;
|
||||
return_if_no_context (context, data);
|
||||
|
||||
tool = tool_manager_get_active (context->gimp);
|
||||
|
||||
if (tool)
|
||||
{
|
||||
const gchar *action_desc;
|
||||
|
||||
action_desc = gimp_tool_control_get_action_value_2 (tool->control);
|
||||
|
||||
if (action_desc)
|
||||
tools_activate_value_action (action_desc, value);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tools_value_3_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpTool *tool;
|
||||
return_if_no_context (context, data);
|
||||
|
||||
tool = tool_manager_get_active (context->gimp);
|
||||
|
||||
if (tool)
|
||||
{
|
||||
const gchar *action_desc;
|
||||
|
||||
action_desc = gimp_tool_control_get_action_value_3 (tool->control);
|
||||
|
||||
if (action_desc)
|
||||
tools_activate_value_action (action_desc, value);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tools_value_4_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpTool *tool;
|
||||
return_if_no_context (context, data);
|
||||
|
||||
tool = tool_manager_get_active (context->gimp);
|
||||
|
||||
if (tool)
|
||||
{
|
||||
const gchar *action_desc;
|
||||
|
||||
action_desc = gimp_tool_control_get_action_value_4 (tool->control);
|
||||
|
||||
if (action_desc)
|
||||
tools_activate_value_action (action_desc, value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,5 +42,28 @@ void tools_color_average_radius_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_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);
|
||||
|
||||
|
||||
#endif /* __TOOLS_COMMANDS_H__ */
|
||||
|
|
|
@ -58,22 +58,22 @@ static void gimp_blend_tool_init (GimpBlendTool *blend_tool
|
|||
static void gimp_blend_tool_button_press (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
static void gimp_blend_tool_button_release (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
static void gimp_blend_tool_motion (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
static void gimp_blend_tool_cursor_update (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
|
||||
static void gimp_blend_tool_draw (GimpDrawTool *draw_tool);
|
||||
|
||||
|
@ -116,18 +116,18 @@ gimp_blend_tool_get_type (void)
|
|||
static const GTypeInfo tool_info =
|
||||
{
|
||||
sizeof (GimpBlendToolClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_blend_tool_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpBlendTool),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_blend_tool_init,
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_blend_tool_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpBlendTool),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_blend_tool_init,
|
||||
};
|
||||
|
||||
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
|
||||
"GimpBlendTool",
|
||||
"GimpBlendTool",
|
||||
&tool_info, 0);
|
||||
}
|
||||
|
||||
|
@ -140,13 +140,8 @@ gimp_blend_tool_get_type (void)
|
|||
static void
|
||||
gimp_blend_tool_class_init (GimpBlendToolClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
GimpToolClass *tool_class;
|
||||
GimpDrawToolClass *draw_tool_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
tool_class = GIMP_TOOL_CLASS (klass);
|
||||
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
|
||||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
|
@ -161,13 +156,12 @@ gimp_blend_tool_class_init (GimpBlendToolClass *klass)
|
|||
static void
|
||||
gimp_blend_tool_init (GimpBlendTool *blend_tool)
|
||||
{
|
||||
GimpTool *tool;
|
||||
|
||||
tool = GIMP_TOOL (blend_tool);
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_BLEND);
|
||||
GimpTool *tool = GIMP_TOOL (blend_tool);
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_BLEND);
|
||||
gimp_tool_control_set_action_value_1 (tool->control,
|
||||
"context/context-opacity-set");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -177,12 +171,10 @@ gimp_blend_tool_button_press (GimpTool *tool,
|
|||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpBlendTool *blend_tool;
|
||||
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
|
||||
GimpDrawable *drawable;
|
||||
gint off_x, off_y;
|
||||
|
||||
blend_tool = GIMP_BLEND_TOOL (tool);
|
||||
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
switch (gimp_drawable_type (drawable))
|
||||
|
@ -219,13 +211,12 @@ gimp_blend_tool_button_release (GimpTool *tool,
|
|||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpBlendTool *blend_tool;
|
||||
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
|
||||
GimpPaintOptions *paint_options;
|
||||
GimpBlendOptions *options;
|
||||
GimpContext *context;
|
||||
GimpImage *gimage;
|
||||
|
||||
blend_tool = GIMP_BLEND_TOOL (tool);
|
||||
paint_options = GIMP_PAINT_OPTIONS (tool->tool_info->tool_options);
|
||||
options = GIMP_BLEND_OPTIONS (paint_options);
|
||||
context = GIMP_CONTEXT (options);
|
||||
|
@ -281,10 +272,8 @@ gimp_blend_tool_motion (GimpTool *tool,
|
|||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpBlendTool *blend_tool;
|
||||
gint off_x, off_y;
|
||||
|
||||
blend_tool = GIMP_BLEND_TOOL (tool);
|
||||
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
|
||||
|
||||
|
@ -336,9 +325,7 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
|
|||
static void
|
||||
gimp_blend_tool_draw (GimpDrawTool *draw_tool)
|
||||
{
|
||||
GimpBlendTool *blend_tool;
|
||||
|
||||
blend_tool = GIMP_BLEND_TOOL (draw_tool);
|
||||
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (draw_tool);
|
||||
|
||||
/* Draw start target */
|
||||
gimp_draw_tool_draw_handle (draw_tool,
|
||||
|
|
|
@ -184,6 +184,14 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
|
|||
GimpTool *tool = GIMP_TOOL (paint_tool);
|
||||
|
||||
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
|
||||
gimp_tool_control_set_action_value_1 (tool->control,
|
||||
"context/context-opacity-set");
|
||||
gimp_tool_control_set_action_value_2 (tool->control,
|
||||
"context/context-brush-radius-set");
|
||||
gimp_tool_control_set_action_value_3 (tool->control,
|
||||
"context/context-brush-aspect-set");
|
||||
gimp_tool_control_set_action_value_4 (tool->control,
|
||||
"context/context-brush-angle-set");
|
||||
|
||||
paint_tool->pick_colors = FALSE;
|
||||
paint_tool->draw_line = FALSE;
|
||||
|
|
|
@ -55,22 +55,22 @@ static void gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_
|
|||
static void gimp_bucket_fill_tool_button_press (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
static void gimp_bucket_fill_tool_button_release (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
static void gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
|
||||
GdkModifierType key,
|
||||
gboolean press,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
static void gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -106,18 +106,18 @@ gimp_bucket_fill_tool_get_type (void)
|
|||
static const GTypeInfo tool_info =
|
||||
{
|
||||
sizeof (GimpBucketFillToolClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_bucket_fill_tool_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpBucketFillTool),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_bucket_fill_tool_init,
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_bucket_fill_tool_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpBucketFillTool),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_bucket_fill_tool_init,
|
||||
};
|
||||
|
||||
tool_type = g_type_register_static (GIMP_TYPE_TOOL,
|
||||
"GimpBucketFillTool",
|
||||
"GimpBucketFillTool",
|
||||
&tool_info, 0);
|
||||
}
|
||||
|
||||
|
@ -130,9 +130,7 @@ gimp_bucket_fill_tool_get_type (void)
|
|||
static void
|
||||
gimp_bucket_fill_tool_class_init (GimpBucketFillToolClass *klass)
|
||||
{
|
||||
GimpToolClass *tool_class;
|
||||
|
||||
tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
|
@ -145,27 +143,26 @@ gimp_bucket_fill_tool_class_init (GimpBucketFillToolClass *klass)
|
|||
static void
|
||||
gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_fill_tool)
|
||||
{
|
||||
GimpTool *tool;
|
||||
GimpTool *tool = GIMP_TOOL (bucket_fill_tool);
|
||||
|
||||
tool = GIMP_TOOL (bucket_fill_tool);
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_BUCKET_FILL);
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_BUCKET_FILL);
|
||||
gimp_tool_control_set_action_value_1 (tool->control,
|
||||
"context/context-opacity-set");
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_bucket_fill_tool_button_press (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpBucketFillTool *bucket_tool;
|
||||
GimpBucketFillTool *bucket_tool = GIMP_BUCKET_FILL_TOOL (tool);
|
||||
GimpBucketFillOptions *options;
|
||||
|
||||
bucket_tool = GIMP_BUCKET_FILL_TOOL (tool);
|
||||
options = GIMP_BUCKET_FILL_OPTIONS (tool->tool_info->tool_options);
|
||||
options = GIMP_BUCKET_FILL_OPTIONS (tool->tool_info->tool_options);
|
||||
|
||||
bucket_tool->target_x = coords->x;
|
||||
bucket_tool->target_y = coords->y;
|
||||
|
@ -189,16 +186,15 @@ static void
|
|||
gimp_bucket_fill_tool_button_release (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpBucketFillTool *bucket_tool;
|
||||
GimpBucketFillTool *bucket_tool = GIMP_BUCKET_FILL_TOOL (tool);
|
||||
GimpBucketFillOptions *options;
|
||||
GimpContext *context;
|
||||
|
||||
bucket_tool = GIMP_BUCKET_FILL_TOOL (tool);
|
||||
options = GIMP_BUCKET_FILL_OPTIONS (tool->tool_info->tool_options);
|
||||
context = GIMP_CONTEXT (options);
|
||||
options = GIMP_BUCKET_FILL_OPTIONS (tool->tool_info->tool_options);
|
||||
context = GIMP_CONTEXT (options);
|
||||
|
||||
/* if the 3rd button isn't pressed, fill the selected region */
|
||||
if (! (state & GDK_BUTTON3_MASK))
|
||||
|
@ -257,8 +253,8 @@ gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
|
|||
static void
|
||||
gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpBucketFillOptions *options;
|
||||
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
|
||||
|
|
|
@ -169,6 +169,11 @@ gimp_color_tool_finalize (GObject *object)
|
|||
static void
|
||||
gimp_color_tool_init (GimpColorTool *color_tool)
|
||||
{
|
||||
GimpTool *tool = GIMP_TOOL (color_tool);
|
||||
|
||||
gimp_tool_control_set_action_value_1 (tool->control,
|
||||
"tools/tools-color-average-radius-set");
|
||||
|
||||
color_tool->enabled = FALSE;
|
||||
color_tool->center_x = 0;
|
||||
color_tool->center_y = 0;
|
||||
|
|
|
@ -111,6 +111,12 @@ gimp_ink_tool_init (GimpInkTool *ink_tool)
|
|||
GimpTool *tool = GIMP_TOOL (ink_tool);
|
||||
|
||||
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_INK);
|
||||
gimp_tool_control_set_action_value_2 (tool->control,
|
||||
"tools/tools-ink-blob-size-set");
|
||||
gimp_tool_control_set_action_value_3 (tool->control,
|
||||
"tools/tools-ink-blob-aspect-set");
|
||||
gimp_tool_control_set_action_value_4 (tool->control,
|
||||
"tools/tools-ink-blob-angle-set");
|
||||
|
||||
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (ink_tool),
|
||||
GIMP_COLOR_PICK_MODE_FOREGROUND);
|
||||
|
|
|
@ -184,6 +184,14 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
|
|||
GimpTool *tool = GIMP_TOOL (paint_tool);
|
||||
|
||||
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
|
||||
gimp_tool_control_set_action_value_1 (tool->control,
|
||||
"context/context-opacity-set");
|
||||
gimp_tool_control_set_action_value_2 (tool->control,
|
||||
"context/context-brush-radius-set");
|
||||
gimp_tool_control_set_action_value_3 (tool->control,
|
||||
"context/context-brush-aspect-set");
|
||||
gimp_tool_control_set_action_value_4 (tool->control,
|
||||
"context/context-brush-angle-set");
|
||||
|
||||
paint_tool->pick_colors = FALSE;
|
||||
paint_tool->draw_line = FALSE;
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
static void gimp_tool_control_class_init (GimpToolControlClass *klass);
|
||||
static void gimp_tool_control_init (GimpToolControl *tool);
|
||||
|
||||
static void gimp_tool_control_finalize (GObject *object);
|
||||
|
||||
|
||||
static GimpObjectClass *parent_class = NULL;
|
||||
|
||||
|
@ -63,7 +65,11 @@ gimp_tool_control_get_type (void)
|
|||
static void
|
||||
gimp_tool_control_class_init (GimpToolControlClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gimp_tool_control_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -93,8 +99,29 @@ gimp_tool_control_init (GimpToolControl *control)
|
|||
control->toggle_cursor = GIMP_CURSOR_MOUSE;
|
||||
control->toggle_tool_cursor = GIMP_TOOL_CURSOR_NONE;
|
||||
control->toggle_cursor_modifier = GIMP_CURSOR_MODIFIER_NONE;
|
||||
|
||||
control->action_value_1 = NULL;
|
||||
control->action_value_2 = NULL;
|
||||
control->action_value_3 = NULL;
|
||||
control->action_value_4 = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_tool_control_finalize (GObject *object)
|
||||
{
|
||||
GimpToolControl *control = GIMP_TOOL_CONTROL (object);
|
||||
|
||||
g_free (control->action_value_1);
|
||||
g_free (control->action_value_2);
|
||||
g_free (control->action_value_3);
|
||||
g_free (control->action_value_4);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
gimp_tool_control_pause (GimpToolControl *control)
|
||||
{
|
||||
|
@ -400,3 +427,87 @@ gimp_tool_control_get_toggle_cursor_modifier (GimpToolControl *control)
|
|||
|
||||
return control->toggle_cursor_modifier;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_set_action_value_1 (GimpToolControl *control,
|
||||
const gchar *action_name)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
|
||||
|
||||
if (action_name != control->action_value_1)
|
||||
{
|
||||
g_free (control->action_value_1);
|
||||
control->action_value_1 = g_strdup (action_name);
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_tool_control_get_action_value_1 (GimpToolControl *control)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), NULL);
|
||||
|
||||
return control->action_value_1;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_set_action_value_2 (GimpToolControl *control,
|
||||
const gchar *action_name)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
|
||||
|
||||
if (action_name != control->action_value_2)
|
||||
{
|
||||
g_free (control->action_value_2);
|
||||
control->action_value_2 = g_strdup (action_name);
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_tool_control_get_action_value_2 (GimpToolControl *control)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), NULL);
|
||||
|
||||
return control->action_value_2;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_set_action_value_3 (GimpToolControl *control,
|
||||
const gchar *action_name)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
|
||||
|
||||
if (action_name != control->action_value_3)
|
||||
{
|
||||
g_free (control->action_value_3);
|
||||
control->action_value_3 = g_strdup (action_name);
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_tool_control_get_action_value_3 (GimpToolControl *control)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), NULL);
|
||||
|
||||
return control->action_value_3;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_set_action_value_4 (GimpToolControl *control,
|
||||
const gchar *action_name)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
|
||||
|
||||
if (action_name != control->action_value_4)
|
||||
{
|
||||
g_free (control->action_value_4);
|
||||
control->action_value_4 = g_strdup (action_name);
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_tool_control_get_action_value_4 (GimpToolControl *control)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), NULL);
|
||||
|
||||
return control->action_value_4;
|
||||
}
|
||||
|
|
|
@ -64,6 +64,11 @@ struct _GimpToolControl
|
|||
GimpCursorModifier toggle_cursor_modifier;
|
||||
|
||||
gboolean toggled;
|
||||
|
||||
gchar *action_value_1;
|
||||
gchar *action_value_2;
|
||||
gchar *action_value_3;
|
||||
gchar *action_value_4;
|
||||
};
|
||||
|
||||
struct _GimpToolControlClass
|
||||
|
@ -146,5 +151,18 @@ GimpCursorModifier gimp_tool_control_get_toggle_cursor_modifier (GimpToolControl
|
|||
void gimp_tool_control_set_toggle_cursor_modifier (GimpToolControl *control,
|
||||
GimpCursorModifier cmodifier);
|
||||
|
||||
void gimp_tool_control_set_action_value_1 (GimpToolControl *control,
|
||||
const gchar *action_name);
|
||||
const gchar * gimp_tool_control_get_action_value_1 (GimpToolControl *control);
|
||||
void gimp_tool_control_set_action_value_2 (GimpToolControl *control,
|
||||
const gchar *action_name);
|
||||
const gchar * gimp_tool_control_get_action_value_2 (GimpToolControl *control);
|
||||
void gimp_tool_control_set_action_value_3 (GimpToolControl *control,
|
||||
const gchar *action_name);
|
||||
const gchar * gimp_tool_control_get_action_value_3 (GimpToolControl *control);
|
||||
void gimp_tool_control_set_action_value_4 (GimpToolControl *control,
|
||||
const gchar *action_name);
|
||||
const gchar * gimp_tool_control_get_action_value_4 (GimpToolControl *control);
|
||||
|
||||
|
||||
#endif /* __GIMP_TOOL_CONTROL_H__ */
|
||||
|
|
Loading…
Reference in New Issue