From: Markus Armbruster <armbru@redhat.com>
To: Sergio Lopez <slp@redhat.com>
Cc: qemu-devel@nongnu.org, "Eric Blake" <eblake@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Pavel Dovgalyuk" <pavel.dovgaluk@ispras.ru>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v4 2/6] ui: add the infrastructure to support MT events
Date: Tue, 16 May 2023 17:15:16 +0200 [thread overview]
Message-ID: <87ilcsnw8r.fsf@pond.sub.org> (raw)
In-Reply-To: <20230509095345.42600-3-slp@redhat.com> (Sergio Lopez's message of "Tue, 9 May 2023 11:53:41 +0200")
Sergio Lopez <slp@redhat.com> writes:
> Add the required infrastructure to support generating multitouch events.
>
> Signed-off-by: Sergio Lopez <slp@redhat.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/ui/input.h | 3 +++
> qapi/ui.json | 58 ++++++++++++++++++++++++++++++++++++-------
> replay/replay-input.c | 18 ++++++++++++++
> ui/input.c | 6 +++++
> ui/trace-events | 1 +
> 5 files changed, 77 insertions(+), 9 deletions(-)
>
> diff --git a/include/ui/input.h b/include/ui/input.h
> index c86219a1c1..2a3dffd417 100644
> --- a/include/ui/input.h
> +++ b/include/ui/input.h
> @@ -8,9 +8,12 @@
> #define INPUT_EVENT_MASK_BTN (1<<INPUT_EVENT_KIND_BTN)
> #define INPUT_EVENT_MASK_REL (1<<INPUT_EVENT_KIND_REL)
> #define INPUT_EVENT_MASK_ABS (1<<INPUT_EVENT_KIND_ABS)
> +#define INPUT_EVENT_MASK_MTT (1<<INPUT_EVENT_KIND_MTT)
>
> #define INPUT_EVENT_ABS_MIN 0x0000
> #define INPUT_EVENT_ABS_MAX 0x7FFF
> +#define INPUT_EVENT_SLOTS_MIN 0x0
> +#define INPUT_EVENT_SLOTS_MAX 0xa
>
> typedef struct QemuInputHandler QemuInputHandler;
> typedef struct QemuInputHandlerState QemuInputHandlerState;
> diff --git a/qapi/ui.json b/qapi/ui.json
> index b5650974fc..d38143bbe1 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -1014,7 +1014,7 @@
Doc part is missing:
# @touch: bla bla (since 8.1)
> ##
> { 'enum' : 'InputButton',
> 'data' : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
> - 'extra', 'wheel-left', 'wheel-right' ] }
> + 'extra', 'wheel-left', 'wheel-right', 'touch' ] }
>
> ##
> # @InputAxis:
> @@ -1026,6 +1026,17 @@
> { 'enum' : 'InputAxis',
> 'data' : [ 'x', 'y' ] }
>
> +##
> +# @InputMultiTouchType:
> +#
> +# Type of a multi-touch event.
> +#
> +# Since: 8.1
> +##
> +{ 'enum' : 'InputMultiTouchType',
> + 'data' : [ 'begin', 'update', 'end', 'cancel', 'data' ] }
> +
> +
> ##
> # @InputKeyEvent:
> #
> @@ -1069,13 +1080,38 @@
> 'data' : { 'axis' : 'InputAxis',
> 'value' : 'int' } }
>
> +##
> +# @InputMultiTouchEvent:
> +#
> +# MultiTouch input event.
> +#
> +# @slot: Which slot has generated the event.
> +# @tracking-id: ID to correlate this event with previously generated events.
> +# @axis: Which axis is referenced by @value.
> +# @value: Contact position.
Please format like
# @slot: Which slot has generated the event.
#
# @tracking-id: ID to correlate this event with previously generated
# events.
#
# @axis: Which axis is referenced by @value.
#
# @value: Contact position.
to blend in with recent commit a937b6aa739 (qapi: Reformat doc comments
to conform to current conventions).
The blank lines help with catching certain errors. rST loves to
surprise...
> +#
> +# Since: 8.1
> +##
> +{ 'struct' : 'InputMultiTouchEvent',
> + 'data' : { 'type' : 'InputMultiTouchType',
> + 'slot' : 'int',
> + 'tracking-id': 'int',
> + 'axis' : 'InputAxis',
> + 'value' : 'int' } }
> +
> ##
> # @InputEventKind:
> #
> +# @key: a keyboard input event
> +# @btn: a pointer button input event
> +# @rel: a relative pointer motion input event
> +# @abs: an absolute pointer motion input event
> +# @mtt: a multi-touch input event
Please format like
# @key: a keyboard input event
#
# @btn: a pointer button input event
#
# @rel: a relative pointer motion input event
#
# @abs: an absolute pointer motion input event
#
# @mtt: a multi-touch input event
> +#
> # Since: 2.0
> ##
> { 'enum': 'InputEventKind',
> - 'data': [ 'key', 'btn', 'rel', 'abs' ] }
> + 'data': [ 'key', 'btn', 'rel', 'abs', 'mtt' ] }
>
> ##
> # @InputKeyEventWrapper:
> @@ -1101,17 +1137,20 @@
> { 'struct': 'InputMoveEventWrapper',
> 'data': { 'data': 'InputMoveEvent' } }
>
> +##
> +# @InputMultiTouchEventWrapper:
> +#
> +# Since: 8.1
> +##
> +{ 'struct': 'InputMultiTouchEventWrapper',
> + 'data': { 'data': 'InputMultiTouchEvent' } }
> +
> ##
> # @InputEvent:
> #
> # Input event union.
> #
> -# @type: the input type, one of:
> -#
> -# - 'key': Input event of Keyboard
> -# - 'btn': Input event of pointer buttons
> -# - 'rel': Input event of relative pointer motion
> -# - 'abs': Input event of absolute pointer motion
> +# @type: the type of input event
> #
> # Since: 2.0
> ##
> @@ -1121,7 +1160,8 @@
> 'data' : { 'key' : 'InputKeyEventWrapper',
> 'btn' : 'InputBtnEventWrapper',
> 'rel' : 'InputMoveEventWrapper',
> - 'abs' : 'InputMoveEventWrapper' } }
> + 'abs' : 'InputMoveEventWrapper',
> + 'mtt' : 'InputMultiTouchEventWrapper' } }
>
> ##
> # @input-send-event:
With these minor doc improvements
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[...]
next prev parent reply other threads:[~2023-05-16 15:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 9:53 [PATCH v4 0/6] Implement virtio-multitouch and enable GTK3 to use it Sergio Lopez
2023-05-09 9:53 ` [PATCH v4 1/6] virtio-input: generalize virtio_input_key_config() Sergio Lopez
2023-05-09 9:53 ` [PATCH v4 2/6] ui: add the infrastructure to support MT events Sergio Lopez
2023-05-16 15:15 ` Markus Armbruster [this message]
2023-05-09 9:53 ` [PATCH v4 3/6] virtio-input: add a virtio-mulitouch device Sergio Lopez
2023-05-09 9:53 ` [PATCH v4 4/6] virtio-input-pci: add virtio-multitouch-pci Sergio Lopez
2023-05-09 9:53 ` [PATCH v4 5/6] ui: add helpers for virtio-multitouch events Sergio Lopez
2023-05-09 9:53 ` [PATCH v4 6/6] ui/gtk: enable backend to send multi-touch events Sergio Lopez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ilcsnw8r.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=slp@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.