[mutter/wip/tablet-protocol-v2: 13/65] clutter: Add pad event structs



commit a65863d7b817e0050b56e6efd2335b7c18e63b50
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 10 16:54:41 2016 +0200

    clutter: Add pad event structs
    
    Those map closely what we get from libinput. Button events have
    been made its own separate struct, its semantics fall somewhere
    in between of ClutterButtonEvent and ClutterKeyEvent, so is better
    emitted as its own set.

 clutter/clutter/clutter-enums.h |    5 ++++
 clutter/clutter/clutter-event.h |   49 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h
index adcd08c..3a261f7 100644
--- a/clutter/clutter/clutter-enums.h
+++ b/clutter/clutter/clutter-enums.h
@@ -1522,6 +1522,11 @@ typedef enum {
   CLUTTER_INPUT_DEVICE_TOOL_LENS
 } ClutterInputDeviceToolType;
 
+typedef enum {
+  CLUTTER_INPUT_DEVICE_PAD_SOURCE_UNKNOWN,
+  CLUTTER_INPUT_DEVICE_PAD_SOURCE_FINGER,
+} ClutterInputDevicePadSource;
+
 G_END_DECLS
 
 #endif /* __CLUTTER_ENUMS_H__ */
diff --git a/clutter/clutter/clutter-event.h b/clutter/clutter/clutter-event.h
index 0202104..73d67ff 100644
--- a/clutter/clutter/clutter-event.h
+++ b/clutter/clutter/clutter-event.h
@@ -118,6 +118,9 @@ typedef struct _ClutterTouchEvent       ClutterTouchEvent;
 typedef struct _ClutterTouchpadPinchEvent ClutterTouchpadPinchEvent;
 typedef struct _ClutterTouchpadSwipeEvent ClutterTouchpadSwipeEvent;
 typedef struct _ClutterProximityEvent   ClutterProximityEvent;
+typedef struct _ClutterPadButtonEvent   ClutterPadButtonEvent;
+typedef struct _ClutterPadStripEvent    ClutterPadStripEvent;
+typedef struct _ClutterPadRingEvent     ClutterPadRingEvent;
 
 /**
  * ClutterAnyEvent:
@@ -493,6 +496,49 @@ struct _ClutterTouchpadSwipeEvent
   gfloat dy;
 };
 
+struct _ClutterPadButtonEvent
+{
+  ClutterEventType type;
+  guint32 time;
+  ClutterEventFlags flags;
+  ClutterStage *stage;
+  ClutterActor *source;
+
+  guint32 button;
+  guint32 group;
+  ClutterInputDevice *device;
+};
+
+struct _ClutterPadStripEvent
+{
+  ClutterEventType type;
+  guint32 time;
+  ClutterEventFlags flags;
+  ClutterStage *stage;
+  ClutterActor *source;
+
+  ClutterInputDevice *device;
+  ClutterInputDevicePadSource strip_source;
+  guint32 strip_number;
+  guint32 group;
+  gdouble value;
+};
+
+struct _ClutterPadRingEvent
+{
+  ClutterEventType type;
+  guint32 time;
+  ClutterEventFlags flags;
+  ClutterStage *stage;
+  ClutterActor *source;
+
+  ClutterInputDevice *device;
+  ClutterInputDevicePadSource ring_source;
+  guint32 ring_number;
+  guint32 group;
+  gdouble angle;
+};
+
 /**
  * ClutterEvent:
  *
@@ -516,6 +562,9 @@ union _ClutterEvent
   ClutterTouchpadPinchEvent touchpad_pinch;
   ClutterTouchpadSwipeEvent touchpad_swipe;
   ClutterProximityEvent proximity;
+  ClutterPadButtonEvent pad_button;
+  ClutterPadStripEvent pad_strip;
+  ClutterPadRingEvent pad_ring;
 };
 
 /**


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