Event controller/gestures branch


I've just pushed a redone gestures branch, the code in there has been
first developed as a standalone mini-library on Sugar, and then carried
on and refined on personal experiments. 

The branch contains a basic GtkEventController abstract object that
mainly has a handle_event vfunc and a more specific GtkGesture object
that is made to handle 1..N pointer/touch sequences. On top of that
object there are 4 implementations for long press/swipe/zoom/rotate.

The way to currently operate with those is creating specific instances
and feeding events to those through gtk_event_controller_handle_event(),
and connect to the signals those emit. 

While it's tempting to add a gtk_widget_add_controller() call, there's
none yet. I think there should be a decision first about captured events
and whether they'll definitely stay private. There's a question about
how multiple gestures within the same widget or on the widget hierarchy
should interoperate to claim/yield entire event sequences. But for now,
just funneling GtkWidget::event to the controllers will make things work
for the basic cases, so this is already quite useful.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]