After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657384 - [introspection] missing accessors for GdkEvent structures
[introspection] missing accessors for GdkEvent structures
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-08-25 21:51 UTC by Cosimo Cecchi
Modified: 2011-08-28 23:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
API: add accessors for GdkEvent fields (6.87 KB, patch)
2011-08-28 19:29 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2011-08-25 21:51:56 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.
Comment 1 Matthias Clasen 2011-08-28 16:11:21 UTC
Is this was clutter does ? If yes, then I'm fine with moving in the same direction. A patch would be welcome.
Comment 2 Emmanuele Bassi (:ebassi) 2011-08-28 17:25:40 UTC
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);

see http://developer.gnome.org/clutter/1.7/clutter-Events.html
Comment 3 Cosimo Cecchi 2011-08-28 19:29:17 UTC
Created attachment 194987 [details] [review]
API: add accessors for GdkEvent fields

Add accessors for the following fields: button, keyval, keycode, scroll
direction, click count.
Comment 4 Matthias Clasen 2011-08-28 23:42:19 UTC
Review of attachment 194987 [details] [review]:

Looks fine, please commit after adding Since: tags for the new functions.
Comment 5 Cosimo Cecchi 2011-08-28 23:51:55 UTC
Attachment 194987 [details] pushed as f7c188c - API: add accessors for GdkEvent fields

Thanks for the review, pushed to master with Since: tags.