Commit 3720ce2e authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

start supporting GIMP_CONTROLLER_EVENT_VALUE of type gdouble. Assume the

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

	* app/widgets/gimpcontrollers.c (gimp_controllers_event_mapped):
	start supporting GIMP_CONTROLLER_EVENT_VALUE of type gdouble.
	Assume the double value is in a [0.0..1.0] range and temporarily
	change the value of the called GimpEnumAction to a range of
	[0..1000] when invoking it. All still very hackish...
parent 98e5e693
2004-06-19 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontrollers.c (gimp_controllers_event_mapped):
start supporting GIMP_CONTROLLER_EVENT_VALUE of type gdouble.
Assume the double value is in a [0.0..1.0] range and temporarily
change the value of the called GimpEnumAction to a range of
[0..1000] when invoking it. All still very hackish...
2004-06-19 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontrollerinfo.c (gimp_controller_info_event):
......
......@@ -39,6 +39,7 @@
#include "gimpcontrollerinfo.h"
#include "gimpcontrollers.h"
#include "gimpcontrollerwheel.h"
#include "gimpenumaction.h"
#include "gimpuimanager.h"
#include "gimp-intl.h"
......@@ -304,7 +305,32 @@ gimp_controllers_event_mapped (GimpControllerInfo *info,
if (action)
{
gtk_action_activate (action);
switch (event->type)
{
case GIMP_CONTROLLER_EVENT_VALUE:
if (G_VALUE_HOLDS_DOUBLE (&event->value.value) &&
GIMP_IS_ENUM_ACTION (action))
{
gdouble value;
gint save = GIMP_ENUM_ACTION (action)->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;
break;
}
case GIMP_CONTROLLER_EVENT_TRIGGER:
default:
gtk_action_activate (action);
break;
}
return TRUE;
}
}
......
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