[mutter/wip/carlosg/input-thread: 30/91] clutter: Add ClutterSeat::query_state() vmethod




commit dba3f10cb4e7ec3c449588f3a3189ae450460431
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 5 22:39:55 2020 +0200

    clutter: Add ClutterSeat::query_state() vmethod
    
    This will query a device state; position and modifiers.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403

 clutter/clutter/clutter-seat.c | 17 +++++++++++++++++
 clutter/clutter/clutter-seat.h | 14 ++++++++++++++
 2 files changed, 31 insertions(+)
---
diff --git a/clutter/clutter/clutter-seat.c b/clutter/clutter/clutter-seat.c
index 13a862bf48..325470196e 100644
--- a/clutter/clutter/clutter-seat.c
+++ b/clutter/clutter/clutter-seat.c
@@ -749,3 +749,20 @@ clutter_seat_get_touch_mode (ClutterSeat *seat)
 
   return touch_mode;
 }
+
+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 aa88d73003..ddc946d137 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,
@@ -194,4 +200,12 @@ void clutter_seat_warp_pointer (ClutterSeat *seat,
 CLUTTER_EXPORT
 gboolean clutter_seat_get_touch_mode (ClutterSeat *seat);
 
+CLUTTER_EXPORT
+gboolean clutter_seat_query_state (ClutterSeat          *seat,
+                                   ClutterInputDevice   *device,
+                                   ClutterEventSequence *sequence,
+                                   double               *x,
+                                   double               *y,
+                                   ClutterModifierType  *modifiers);
+
 #endif /* CLUTTER_SEAT_H */


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