From 379c6fb81aa7d062ffe52f5b40781522333039bf Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 10 May 2016 16:59:34 +0200 Subject: [PATCH] clutter: Add pad event types And their management along the pipeline. --- clutter/clutter/clutter-enums.h | 4 ++++ clutter/clutter/clutter-event.c | 38 +++++++++++++++++++++++++++++++++ clutter/clutter/clutter-main.c | 4 ++++ 3 files changed, 46 insertions(+) diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h index 3a261f7f4..6f779c5ec 100644 --- a/clutter/clutter/clutter-enums.h +++ b/clutter/clutter/clutter-enums.h @@ -794,6 +794,10 @@ typedef enum { /*< prefix=CLUTTER >*/ CLUTTER_TOUCHPAD_SWIPE, CLUTTER_PROXIMITY_IN, CLUTTER_PROXIMITY_OUT, + CLUTTER_PAD_BUTTON_PRESS, + CLUTTER_PAD_BUTTON_RELEASE, + CLUTTER_PAD_STRIP, + CLUTTER_PAD_RING, CLUTTER_EVENT_LAST /* helper */ } ClutterEventType; diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c index c489ab4da..3ba846759 100644 --- a/clutter/clutter/clutter-event.c +++ b/clutter/clutter/clutter-event.c @@ -413,6 +413,10 @@ clutter_event_get_position (const ClutterEvent *event, case CLUTTER_EVENT_LAST: case CLUTTER_PROXIMITY_IN: case CLUTTER_PROXIMITY_OUT: + case CLUTTER_PAD_BUTTON_PRESS: + case CLUTTER_PAD_BUTTON_RELEASE: + case CLUTTER_PAD_STRIP: + case CLUTTER_PAD_RING: clutter_point_init (position, 0.f, 0.f); break; @@ -483,6 +487,10 @@ clutter_event_set_coords (ClutterEvent *event, case CLUTTER_EVENT_LAST: case CLUTTER_PROXIMITY_IN: case CLUTTER_PROXIMITY_OUT: + case CLUTTER_PAD_BUTTON_PRESS: + case CLUTTER_PAD_BUTTON_RELEASE: + case CLUTTER_PAD_STRIP: + case CLUTTER_PAD_RING: break; case CLUTTER_ENTER: @@ -1133,6 +1141,19 @@ clutter_event_set_device (ClutterEvent *event, case CLUTTER_PROXIMITY_OUT: event->proximity.device = device; break; + + case CLUTTER_PAD_BUTTON_PRESS: + case CLUTTER_PAD_BUTTON_RELEASE: + event->pad_button.device = device; + break; + + case CLUTTER_PAD_STRIP: + event->pad_strip.device = device; + break; + + case CLUTTER_PAD_RING: + event->pad_ring.device = device; + break; } } @@ -1217,6 +1238,19 @@ clutter_event_get_device (const ClutterEvent *event) case CLUTTER_PROXIMITY_OUT: device = event->proximity.device; break; + + case CLUTTER_PAD_BUTTON_PRESS: + case CLUTTER_PAD_BUTTON_RELEASE: + device = event->pad_button.device; + break; + + case CLUTTER_PAD_STRIP: + device = event->pad_strip.device; + break; + + case CLUTTER_PAD_RING: + device = event->pad_ring.device; + break; } return device; @@ -1708,6 +1742,10 @@ clutter_event_get_axes (const ClutterEvent *event, case CLUTTER_TOUCHPAD_PINCH: case CLUTTER_TOUCHPAD_SWIPE: + case CLUTTER_PAD_BUTTON_PRESS: + case CLUTTER_PAD_BUTTON_RELEASE: + case CLUTTER_PAD_STRIP: + case CLUTTER_PAD_RING: break; } diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index a4f4c1fef..ba948438f 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -2163,6 +2163,10 @@ _clutter_process_event_details (ClutterActor *stage, case CLUTTER_KEY_PRESS: case CLUTTER_KEY_RELEASE: + case CLUTTER_PAD_BUTTON_PRESS: + case CLUTTER_PAD_BUTTON_RELEASE: + case CLUTTER_PAD_STRIP: + case CLUTTER_PAD_RING: { ClutterActor *actor = NULL;