qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] paravirtual tablet v2
@ 2011-01-14 12:02 Gerd Hoffmann
  2011-01-14 14:18 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2011-01-14 12:02 UTC (permalink / raw)
  To: qemu-devel@nongnu.org, spice-devel

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

   Hi,

Updated according to the feedback.  Multitouch not added (yet).

cheers,
   Gerd

[-- Attachment #2: pvtablet.h --]
[-- Type: text/x-chdr, Size: 2556 bytes --]

#ifndef __QEMU_PVTABLET__
#define __QEMU_PVTABLET__ 1

/*
 * qemu patavirtual tablet interface
 */

#include <inttypes.h>

/*
 * our virtio-serial channel name(s)
 */
#define QEMU_PVTABLET_FORMAT "org.qemu.pvtablet.%d"

enum qemu_pvtablet_type {
    QEMU_PVTABLET_MSG_INIT,
    QEMU_PVTABLET_MSG_ACK,
    QEMU_PVTABLET_MSG_MOVE,
    QEMU_PVTABLET_MSG_BTN_DOWN,
    QEMU_PVTABLET_MSG_BTN_UP,
};

typedef enum qemu_pvtablet_features {
    /* None yet */
};

typedef enum qemu_pvtablet_buttons {
    QEMU_PVTABLET_BTN_LEFT,
    QEMU_PVTABLET_BTN_RIGHT,
    QEMU_PVTABLET_BTN_MIDDLE,
    QEMU_PVTABLET_BTN_SCROLL_UP,
    QEMU_PVTABLET_BTN_SCROLL_DOWN,
    /*
     * we can handle up to 32 buttons although
     * not every has a individual name ;)
     */
};

/*
 * QEMU_PVTABLET_MSG_INIT, host -> guest
 * first message, sent before any other event
 */
typedef struct qemu_pvtablet_init {
    uint32_t res_x;        /* x axis resolution */
    uint32_t res_y;        /* y axis resolution */
    uint32_t features;     /* qemu_pvtablet_features */
    uint32_t buttons_mask; /* mouse buttons available */
} qemu_pvtablet_init;

/*
 * QEMU_PVTABLET_MSG_ACK, guest -> host
 * sent after pvtablet_init.  host will not send
 * additional messages until this is received
 */
typedef struct qemu_pvtablet_ack {
    uint32_t features; /* qemu_pvtable_features */
};

/*
 * QEMU_PVTABLET_MSG_BTN_{DOWN,UP}, host -> guest
 * send button press+release events
 */
typedef struct qemu_pvtablet_button {
    uint32_t button;
    uint32_t mask;
} qemu_pvtablet_button;

/*
 * QEMU_PVTABLET_MSG_MOVE, host -> guest
 * send pointer move events
 */
typedef struct qemu_pvtablet_position {
    uint32_t pos_x;
    uint32_t pos_y;
} qemu_pvtablet_position;


typedef struct qemu_pvtablet_header {
    uint32_t size;            /* whole message size */
    uint32_t type;            /* qemu_pvtablet_type */
    /*
     * Timestamp is specified in nanoseconds.  Timebase is undefined.
     * This is supposed to be used to figure how much time passed
     * between two events, to decide whenever two mouse clicks should
     * be interpreted as double click or not and simliar stuff.
     */
    uint64_t timestamp;
} qemu_pvtablet_header;

typedef union qemu_pvtablet_payload {
    qemu_pvtablet_init     init;
    qemu_pvtablet_ack      ack;
    qemu_pvtablet_position position;
    qemu_pvtablet_button   button;
};

typedef struct qemu_pvtablet_message {
    qemu_pvtablet_header  hdr;
    qemu_pvtablet_payload data;
} qemu_pvtablet_message;

#endif /* __QEMU_PVTABLET__ */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v2
  2011-01-14 12:02 [Qemu-devel] paravirtual tablet v2 Gerd Hoffmann
@ 2011-01-14 14:18 ` Anthony Liguori
  2011-01-14 14:23   ` Gerd Hoffmann
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2011-01-14 14:18 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: spice-devel, qemu-devel@nongnu.org

On 01/14/2011 06:02 AM, Gerd Hoffmann wrote:
>   Hi,
>
> Updated according to the feedback.  Multitouch not added (yet).
>
> cheers,
>   Gerd
> #ifndef __QEMU_PVTABLET__
> #define __QEMU_PVTABLET__ 1
>
> /*
>   * qemu patavirtual tablet interface
>   */
>
> #include<inttypes.h>
>
> /*
>   * our virtio-serial channel name(s)
>   */
> #define QEMU_PVTABLET_FORMAT "org.qemu.pvtablet.%d"
>
> enum qemu_pvtablet_type {
>      QEMU_PVTABLET_MSG_INIT,
>      QEMU_PVTABLET_MSG_ACK,
>      QEMU_PVTABLET_MSG_MOVE,
>      QEMU_PVTABLET_MSG_BTN_DOWN,
>      QEMU_PVTABLET_MSG_BTN_UP,
> };
>
> typedef enum qemu_pvtablet_features {
>      /* None yet */
> };
>
> typedef enum qemu_pvtablet_buttons {
>      QEMU_PVTABLET_BTN_LEFT,
>      QEMU_PVTABLET_BTN_RIGHT,
>      QEMU_PVTABLET_BTN_MIDDLE,
>      QEMU_PVTABLET_BTN_SCROLL_UP,
>      QEMU_PVTABLET_BTN_SCROLL_DOWN,
>      /*
>       * we can handle up to 32 buttons although
>       * not every has a individual name;)
>       */
> };
>
> /*
>   * QEMU_PVTABLET_MSG_INIT, host ->  guest
>   * first message, sent before any other event
>   */
> typedef struct qemu_pvtablet_init {
>      uint32_t res_x;        /* x axis resolution */
>      uint32_t res_y;        /* y axis resolution */
>      uint32_t features;     /* qemu_pvtablet_features */
>      uint32_t buttons_mask; /* mouse buttons available */
> } qemu_pvtablet_init;
>
> /*
>   * QEMU_PVTABLET_MSG_ACK, guest ->  host
>   * sent after pvtablet_init.  host will not send
>   * additional messages until this is received
>   */
> typedef struct qemu_pvtablet_ack {
>      uint32_t features; /* qemu_pvtable_features */
> };
>
> /*
>   * QEMU_PVTABLET_MSG_BTN_{DOWN,UP}, host ->  guest
>   * send button press+release events
>   */
> typedef struct qemu_pvtablet_button {
>      uint32_t button;
>      uint32_t mask;
> } qemu_pvtablet_button;
>    

What's the semantic of button and mask?  I'd assume that mask is the new 
button mask but then I'm not sure what button is used for.

> /*
>   * QEMU_PVTABLET_MSG_MOVE, host ->  guest
>   * send pointer move events
>   */
> typedef struct qemu_pvtablet_position {
>      uint32_t pos_x;
>      uint32_t pos_y;
> } qemu_pvtablet_position;
>
>
> typedef struct qemu_pvtablet_header {
>      uint32_t size;            /* whole message size */
>      uint32_t type;            /* qemu_pvtablet_type */
>      /*
>       * Timestamp is specified in nanoseconds.  Timebase is undefined.
>       * This is supposed to be used to figure how much time passed
>       * between two events, to decide whenever two mouse clicks should
>       * be interpreted as double click or not and simliar stuff.
>       */
>      uint64_t timestamp;
> } qemu_pvtablet_header;
>
> typedef union qemu_pvtablet_payload {
>      qemu_pvtablet_init     init;
>      qemu_pvtablet_ack      ack;
>      qemu_pvtablet_position position;
>      qemu_pvtablet_button   button;
> };
>
> typedef struct qemu_pvtablet_message {
>      qemu_pvtablet_header  hdr;
>      qemu_pvtablet_payload data;
> } qemu_pvtablet_message;
>    

Regards,

Anthony Liguori

> #endif /* __QEMU_PVTABLET__ */
>    

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v2
  2011-01-14 14:18 ` Anthony Liguori
@ 2011-01-14 14:23   ` Gerd Hoffmann
  0 siblings, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2011-01-14 14:23 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: spice-devel, qemu-devel@nongnu.org


>> /*
>> * QEMU_PVTABLET_MSG_BTN_{DOWN,UP}, host -> guest
>> * send button press+release events
>> */
>> typedef struct qemu_pvtablet_button {
>> uint32_t button;
>> uint32_t mask;
>> } qemu_pvtablet_button;
>
> What's the semantic of button and mask? I'd assume that mask is the new
> button mask but then I'm not sure what button is used for.

"button" is the index of the button which was pressed (BTN_DOWN) or 
released (BTN_UP).  "mask" is the new button mask.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-14 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 12:02 [Qemu-devel] paravirtual tablet v2 Gerd Hoffmann
2011-01-14 14:18 ` Anthony Liguori
2011-01-14 14:23   ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).