Hook up TouchBegin/Update/End events

The are the same as device events internally but require the touch ID
separately from the detail.button field (the protocol uses the detail field
for the touch id).
For simpler integration of pointer emulation we need to set the
detail.button field while keeping the touchid around.

Add the three new touch event types to the various places in the server
where they need to be handled. The actual handling of the events is somewhat
more complicated in most places.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
Peter Hutterer 2011-12-14 12:45:28 +10:00
commit 84db813b9d
7 changed files with 53 additions and 3 deletions

View file

@ -50,6 +50,9 @@ enum EventType {
ET_ButtonPress,
ET_ButtonRelease,
ET_Motion,
ET_TouchBegin,
ET_TouchUpdate,
ET_TouchEnd,
ET_Enter,
ET_Leave,
ET_FocusIn,
@ -84,9 +87,11 @@ struct _DeviceEvent
int deviceid; /**< Device to post this event for */
int sourceid; /**< The physical source device */
union {
uint32_t button; /**< Button number */
uint32_t button; /**< Button number (also used in pointer emulating
touch events) */
uint32_t key; /**< Key code */
} detail;
uint32_t touchid; /**< Touch ID (client_id) */
int16_t root_x; /**< Pos relative to root window in integral data */
float root_x_frac; /**< Pos relative to root window in frac part */
int16_t root_y; /**< Pos relative to root window in integral part */