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.
This commit is contained in:
Michael Natterer 2004-06-23 14:39:48 +00:00 committed by Michael Natterer
parent 7e52ed902a
commit 1ce16fefd7
9 changed files with 39 additions and 22 deletions

View file

@ -1,3 +1,19 @@
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

View file

@ -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;
}

View file

@ -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:

View file

@ -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);
}

View file

@ -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__ */

View file

@ -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);
}

View file

@ -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__ */

View file

@ -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);
}

View file

@ -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__ */