On Mon, 2009-06-22 at 21:41 +0200, Håvard Tørring wrote:
> OK, I'll give it a try,..
> I have a little problem getting into the code. I am new to the gtk
> environment, the event handling and much of the gui stuff, so
> unfortunately the learning curve is pretty steep. Anyhow, this is what
> I have found.
> As far as I can see, the following line in gimpcontrollerinfo.c emits
> the signal that initiates the scroll function
> g_signal_emit (info, info_signals[EVENT_MAPPED], 0,
> controller, event, action_name, &retval);
> event contains the value, so I would be happy if I could pick up this
> value later on, when the actual scrolling is performed.
This signal is then handled in gimp_controllers_event_mapped() as found
in gimpcontrollers.c. Here the event is translated into the activation
of a GtkAction. As you can see the event's value is multiplied by 1000
and passed with the action. Later this value is then passed to
action_select_value() where it is divided by 1000 again and interpreted
as an absolute value normalized to the scroll-bar range. This is all a
rather bad hack. To some extent it works for controllers that send
absolute events. The device you are trying to use there sends relative
events values though and all the assumptions that this code relies on
break badly. This will need a clever redesign.
Gimp-developer mailing list