From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40876 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pdmd4-0002Y4-SJ for qemu-devel@nongnu.org; Fri, 14 Jan 2011 11:35:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pdmd3-0006i4-RX for qemu-devel@nongnu.org; Fri, 14 Jan 2011 11:35:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pdmd3-0006hx-K4 for qemu-devel@nongnu.org; Fri, 14 Jan 2011 11:35:57 -0500 Message-ID: <4D307B69.1030801@redhat.com> Date: Fri, 14 Jan 2011 17:35:53 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000205060100020702030805" Subject: [Qemu-devel] paravirtual tablet v3 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" , spice-devel This is a multi-part message in MIME format. --------------000205060100020702030805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Now v3 featuring multitouch ;) cheers, Gerd --------------000205060100020702030805 Content-Type: text/x-chdr; name="pvtablet.h" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pvtablet.h" #ifndef __QEMU_PVTABLET__ #define __QEMU_PVTABLET__ 1 /* * qemu patavirtual tablet interface */ #include /* * 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_POSITION, QEMU_PVTABLET_MSG_BTN_DOWN, QEMU_PVTABLET_MSG_BTN_UP, QEMU_PVTABLET_MSG_SYNC, }; 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 ;) */ }; #define QEMU_PVTABLET_BTN_MASK_LEFT (1< guest * First message. Sent before any other event. */ typedef struct qemu_pvtablet_init { uint32_t features; /* qemu_pvtablet_features */ uint32_t res_x; /* x axis resolution */ uint32_t res_y; /* y axis resolution */ uint32_t buttons_mask; /* mouse buttons available */ uint32_t max_pressure; /* 0 == no pressure supported */ uint32_t max_points; /* 1 == no multitouch */ uint8_t have_point_ids; } 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; /* which button was pressed/released */ uint32_t mask; /* which buttons are currently pressed */ } qemu_pvtablet_button; /* * QEMU_PVTABLET_MSG_POSITION, host -> guest * Send pointer/finger move events. * * Multitouch devices without point id support send one message per * touch point in each message group in unspecified order. * * Multitouch devices with point id support send messages only for * touch points which did change. IDs are added by just using them * for the first time. IDs are invalidated by using them in a "lift" * message (aka pressure == 0). */ typedef struct qemu_pvtablet_position { uint32_t pos_x; uint32_t pos_y; uint32_t pressure; uint32_t point_id; } qemu_pvtablet_position; /* * QEMU_PVTABLET_MSG_SYNC, host -> guest * Marks the end of a message group which belongs together * and carries the time stamp for all those events. * * The 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. */ typedef struct qemu_pvtablet_sync { uint64_t timestamp; }; typedef struct qemu_pvtablet_header { uint32_t size; /* whole message size */ uint32_t type; /* qemu_pvtablet_type */ } 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__ */ --------------000205060100020702030805--