Initial batch of porting GdkEVent to Controllers
in preparation for GTK4, where event signals are gone, GdkEvent is an
opaque type & use of GdkEvent is discouraged in favour of Controllers
https://gitlab.com/inkscape/inkscape/-/merge_requests/5474
See MR for full details, unsquashed commits. Highlights for git blame...
ui/controller|ui/manage: new helpers for following
…commits. We have manage() to get gtkmm4-like behaviour here in gtkmm3,
get_current_event_state() to replicate a method that only GTK4 has, and
more importantly a pile of helpers to make gesture creation/adding nice
tool-base +get_latin_keyval for EventControllerKey
This will be used to replace GdkEvents in the following & future commits
dialog/align-dist ::button-press → Button::clicked
It is not really clear to me at all why we were listening to button
press events here, instead of just GtkButton::clicked, or in some cases
simply using GtkActionable. This moves to doing the former, works fine.
color-item ::button-press|enter|leave → Controller
Ditto previous commit, and we don't need to know about GdkEventButton
anymore, which is also nice. Also + #include for RefPtr, just in case.
Updated: Also replace ::enter|leave-event with GtkEventControllerMotion,
noting we seemingly need still to add_events(), and to use PHASE_TARGET.
dialog-notebook: mv from ::button-press to Gesture
Keep connecting after as before, and we need to NOT claim, else
primary-click does not switch tabs.
LPEeditor: Replace enter/leave w/ ControllerMotion
We can't use Utils::make_g_callback() because that only supports member
functions, and we have multiple LPEDrag per instance of ourself. And
it's not worth it anyway since GTK4 should make this far easier with
Widget.set_cursor(). So just do it the ugly way, via the C API.
widget/selected-style: ::button-press→GestureClick
and in doing so, make us consistently listen only for releases, like the
first two tools already did, in particular so that menus act as expected
widget/ink-spinscale: GdkEvents to Controllers and
simplify setting our cursor: use C++ API, don't set it for every motion
event but only on enter (and unset on leave), rm ineffective mask test.