clutter: Add pad event types

And their management along the pipeline.
This commit is contained in:
Carlos Garnacho 2016-05-10 16:59:34 +02:00
parent fc5af32cdc
commit 379c6fb81a
3 changed files with 46 additions and 0 deletions

View File

@ -794,6 +794,10 @@ typedef enum { /*< prefix=CLUTTER >*/
CLUTTER_TOUCHPAD_SWIPE, CLUTTER_TOUCHPAD_SWIPE,
CLUTTER_PROXIMITY_IN, CLUTTER_PROXIMITY_IN,
CLUTTER_PROXIMITY_OUT, CLUTTER_PROXIMITY_OUT,
CLUTTER_PAD_BUTTON_PRESS,
CLUTTER_PAD_BUTTON_RELEASE,
CLUTTER_PAD_STRIP,
CLUTTER_PAD_RING,
CLUTTER_EVENT_LAST /* helper */ CLUTTER_EVENT_LAST /* helper */
} ClutterEventType; } ClutterEventType;

View File

@ -413,6 +413,10 @@ clutter_event_get_position (const ClutterEvent *event,
case CLUTTER_EVENT_LAST: case CLUTTER_EVENT_LAST:
case CLUTTER_PROXIMITY_IN: case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT: 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); clutter_point_init (position, 0.f, 0.f);
break; break;
@ -483,6 +487,10 @@ clutter_event_set_coords (ClutterEvent *event,
case CLUTTER_EVENT_LAST: case CLUTTER_EVENT_LAST:
case CLUTTER_PROXIMITY_IN: case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT: case CLUTTER_PROXIMITY_OUT:
case CLUTTER_PAD_BUTTON_PRESS:
case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING:
break; break;
case CLUTTER_ENTER: case CLUTTER_ENTER:
@ -1133,6 +1141,19 @@ clutter_event_set_device (ClutterEvent *event,
case CLUTTER_PROXIMITY_OUT: case CLUTTER_PROXIMITY_OUT:
event->proximity.device = device; event->proximity.device = device;
break; 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: case CLUTTER_PROXIMITY_OUT:
device = event->proximity.device; device = event->proximity.device;
break; 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; return device;
@ -1708,6 +1742,10 @@ clutter_event_get_axes (const ClutterEvent *event,
case CLUTTER_TOUCHPAD_PINCH: case CLUTTER_TOUCHPAD_PINCH:
case CLUTTER_TOUCHPAD_SWIPE: case CLUTTER_TOUCHPAD_SWIPE:
case CLUTTER_PAD_BUTTON_PRESS:
case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING:
break; break;
} }

View File

@ -2163,6 +2163,10 @@ _clutter_process_event_details (ClutterActor *stage,
case CLUTTER_KEY_PRESS: case CLUTTER_KEY_PRESS:
case CLUTTER_KEY_RELEASE: 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; ClutterActor *actor = NULL;