Commit 1ce16fef authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/gimpenumaction.[ch] app/widgets/gimppluginaction.[ch] added

2004-06-23  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpenumaction.[ch]
	* app/widgets/gimppluginaction.[ch]
	* app/widgets/gimpstringaction.[ch]: added parameters to the
	gimp_*_action_selected() function so the "selected" signal can be
	emitted with value != action->value. Changed GtkAction::activate()
	implementations accordingly (pass action->value).

	* app/widgets/gimpcontrollers.c: call gimp_enum_action_selected()
	and pass the value of the GimpControllerEventValue instead of
	temporarily replacing action->value and calling
	gtk_action_activate().

	* app/widgets/gimpcontrollerinfo.c: fixed debugging output.
parent 7e52ed90
2004-06-23 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpenumaction.[ch]
* app/widgets/gimppluginaction.[ch]
* app/widgets/gimpstringaction.[ch]: added parameters to the
gimp_*_action_selected() function so the "selected" signal can be
emitted with value != action->value. Changed GtkAction::activate()
implementations accordingly (pass action->value).
* app/widgets/gimpcontrollers.c: call gimp_enum_action_selected()
and pass the value of the GimpControllerEventValue instead of
temporarily replacing action->value and calling
gtk_action_activate().
* app/widgets/gimpcontrollerinfo.c: fixed debugging output.
2004-06-23 Michael Natterer <mitch@gimp.org>
* app/paint/gimpbrushcore.[ch]: added signal "set-brush" which is
......
......@@ -448,7 +448,7 @@ gimp_controller_info_event (GimpController *controller,
if (! info->enabled)
{
g_print (" ignoring because controller is disabled\n");
g_print (" ignoring because controller is disabled\n\n");
return FALSE;
}
......
......@@ -311,19 +311,14 @@ gimp_controllers_event_mapped (GimpControllerInfo *info,
if (G_VALUE_HOLDS_DOUBLE (&event->value.value) &&
GIMP_IS_ENUM_ACTION (action))
{
gdouble value;
gint save = GIMP_ENUM_ACTION (action)->value;
gdouble value = g_value_get_double (&event->value.value);
value = g_value_get_double (&event->value.value);
GIMP_ENUM_ACTION (action)->value = value * 1000;
gtk_action_activate (action);
GIMP_ENUM_ACTION (action)->value = save;
gimp_enum_action_selected (GIMP_ENUM_ACTION (action),
value * 1000);
break;
}
/* else fallthru */
case GIMP_CONTROLLER_EVENT_TRIGGER:
default:
......
......@@ -185,13 +185,14 @@ gimp_enum_action_activate (GtkAction *action)
{
GimpEnumAction *enum_action = GIMP_ENUM_ACTION (action);
gimp_enum_action_selected (enum_action);
gimp_enum_action_selected (enum_action, enum_action->value);
}
void
gimp_enum_action_selected (GimpEnumAction *action)
gimp_enum_action_selected (GimpEnumAction *action,
gint value)
{
g_return_if_fail (GIMP_IS_ENUM_ACTION (action));
g_signal_emit (action, action_signals[SELECTED], 0, action->value);
g_signal_emit (action, action_signals[SELECTED], 0, value);
}
......@@ -58,7 +58,8 @@ GimpEnumAction * gimp_enum_action_new (const gchar *name,
const gchar *tooltip,
const gchar *stock_id,
gint value);
void gimp_enum_action_selected (GimpEnumAction *action);
void gimp_enum_action_selected (GimpEnumAction *action,
gint value);
#endif /* __GIMP_ENUM_ACTION_H__ */
......@@ -173,7 +173,7 @@ gimp_plug_in_action_activate (GtkAction *action)
{
GimpPlugInAction *plug_in_action = GIMP_PLUG_IN_ACTION (action);
gimp_plug_in_action_selected (plug_in_action);
gimp_plug_in_action_selected (plug_in_action, plug_in_action->proc_def);
}
static void
......@@ -239,9 +239,10 @@ gimp_plug_in_action_new (const gchar *name,
}
void
gimp_plug_in_action_selected (GimpPlugInAction *action)
gimp_plug_in_action_selected (GimpPlugInAction *action,
PlugInProcDef *proc_def)
{
g_return_if_fail (GIMP_IS_PLUG_IN_ACTION (action));
g_signal_emit (action, action_signals[SELECTED], 0, action->proc_def);
g_signal_emit (action, action_signals[SELECTED], 0, proc_def);
}
......@@ -58,7 +58,8 @@ GimpPlugInAction * gimp_plug_in_action_new (const gchar *name,
const gchar *tooltip,
const gchar *stock_id,
PlugInProcDef *proc_def);
void gimp_plug_in_action_selected (GimpPlugInAction *action);
void gimp_plug_in_action_selected (GimpPlugInAction *action,
PlugInProcDef *proc_def);
#endif /* __GIMP_PLUG_IN_ACTION_H__ */
......@@ -202,13 +202,14 @@ gimp_string_action_activate (GtkAction *action)
{
GimpStringAction *string_action = GIMP_STRING_ACTION (action);
gimp_string_action_selected (string_action);
gimp_string_action_selected (string_action, string_action->value);
}
void
gimp_string_action_selected (GimpStringAction *action)
gimp_string_action_selected (GimpStringAction *action,
const gchar *value)
{
g_return_if_fail (GIMP_IS_STRING_ACTION (action));
g_signal_emit (action, action_signals[SELECTED], 0, action->value);
g_signal_emit (action, action_signals[SELECTED], 0, value);
}
......@@ -58,7 +58,8 @@ GimpStringAction * gimp_string_action_new (const gchar *name,
const gchar *tooltip,
const gchar *stock_id,
const gchar *value);
void gimp_string_action_selected (GimpStringAction *action);
void gimp_string_action_selected (GimpStringAction *action,
const gchar *value);
#endif /* __GIMP_STRING_ACTION_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