From fba1122a3c292fd2a8f79df5ce07611d553811c6 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 5 Jun 2020 22:39:55 +0200 Subject: [PATCH] clutter: Add ClutterSeat::query_state() vmethod This will query a device state; position and modifiers. Note that ClutterSeat subclasses don't implement the vmethod yet, so calling clutter_seat_query_state() may crash ATM. Part-of: --- clutter/clutter/clutter-seat.c | 17 +++++++++++++++++ clutter/clutter/clutter-seat.h | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/clutter/clutter/clutter-seat.c b/clutter/clutter/clutter-seat.c index 96bb0e930..77d8d5231 100644 --- a/clutter/clutter/clutter-seat.c +++ b/clutter/clutter/clutter-seat.c @@ -776,3 +776,20 @@ clutter_seat_has_touchscreen (ClutterSeat *seat) return has_touchscreen; } + +gboolean +clutter_seat_query_state (ClutterSeat *seat, + ClutterInputDevice *device, + ClutterEventSequence *sequence, + graphene_point_t *coords, + ClutterModifierType *modifiers) +{ + g_return_val_if_fail (CLUTTER_IS_SEAT (seat), FALSE); + g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE); + + return CLUTTER_SEAT_GET_CLASS (seat)->query_state (seat, + device, + sequence, + coords, + modifiers); +} diff --git a/clutter/clutter/clutter-seat.h b/clutter/clutter/clutter-seat.h index 33497a43f..36bcd49cb 100644 --- a/clutter/clutter/clutter-seat.h +++ b/clutter/clutter/clutter-seat.h @@ -113,6 +113,12 @@ struct _ClutterSeatClass int x, int y); + gboolean (* query_state) (ClutterSeat *seat, + ClutterInputDevice *device, + ClutterEventSequence *sequence, + graphene_point_t *coords, + ClutterModifierType *modifiers); + /* Event platform data */ void (* copy_event_data) (ClutterSeat *seat, const ClutterEvent *src, @@ -197,4 +203,11 @@ gboolean clutter_seat_get_touch_mode (ClutterSeat *seat); CLUTTER_EXPORT gboolean clutter_seat_has_touchscreen (ClutterSeat *seat); +CLUTTER_EXPORT +gboolean clutter_seat_query_state (ClutterSeat *seat, + ClutterInputDevice *device, + ClutterEventSequence *sequence, + graphene_point_t *coords, + ClutterModifierType *modifiers); + #endif /* CLUTTER_SEAT_H */