GNOME Bugzilla – Bug 657384
[introspection] missing accessors for GdkEvent structures
Last modified: 2011-08-28 23:51:58 UTC
GdkEvents are currently inaccessible from introspected bindings e.g. gjs.
We should add accessors for at least the commonly used fields (such as coordinates, button, keyval, ...) to facilitate JS app development.
Is this was clutter does ? If yes, then I'm fine with moving in the same direction. A patch would be welcome.
yes, in Clutter we provide accessors for all the fields, taking a ClutterEvent*, e.g.
void clutter_event_get_coords (const ClutterEvent *event, float *x, float *y);
guint clutter_event_get_button (const ClutterEvent *event);
ClutterScrollDirecton clutter_event_get_scroll_direction (const ClutterEvent *event);
Created attachment 194987 [details] [review]
API: add accessors for GdkEvent fields
Add accessors for the following fields: button, keyval, keycode, scroll
direction, click count.
Review of attachment 194987 [details] [review]:
Looks fine, please commit after adding Since: tags for the new functions.
Attachment 194987 [details] pushed as f7c188c - API: add accessors for GdkEvent fields
Thanks for the review, pushed to master with Since: tags.