aboutsummaryrefslogtreecommitdiff
path: root/console.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-03-09 20:52:22 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-19 15:27:38 -0500
commit6fef28ee6e5e0a443857e67aa026d49b6bbdc1b6 (patch)
tree44ca8b9340ab1b8de2fefa84706ebbdcfe262c8f /console.h
parentd1e70c5e6d1472856c52969301247fe8c3c8389d (diff)
Rewrite mouse handlers to use QTAILQ and to have an activation function
And convert usb-hid to use it (to avoid regression with bisection) Right now, when we do info mice and we've added a usb tablet, we don't see it until the guest starts using the tablet. We implement this behavior in order to provide a means to delay registration of a mouse handler since we treat the last registered handler as the current handler. This is a usability problem though as we would like to give the user feedback that they've either 1) not added an absolute device 2) there is an absolute device but the guest isn't using it 3) we have an absolute device and it's active. By using QTAILQ and having an explicit activation function that moves the handler to the front of the queue, we can implement the same semantics as before with respect to automatically switching to usb tablet while providing the user with a whole lot more information. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'console.h')
-rw-r--r--console.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/console.h b/console.h
index 71e8ff230c..94d9caea1f 100644
--- a/console.h
+++ b/console.h
@@ -28,8 +28,10 @@ typedef struct QEMUPutMouseEntry {
int qemu_put_mouse_event_absolute;
char *qemu_put_mouse_event_name;
+ int index;
+
/* used internally by qemu for handling mice */
- struct QEMUPutMouseEntry *next;
+ QTAILQ_ENTRY(QEMUPutMouseEntry) node;
} QEMUPutMouseEntry;
typedef struct QEMUPutLEDEntry {
@@ -43,6 +45,8 @@ QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
void *opaque, int absolute,
const char *name);
void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry);
+void qemu_activate_mouse_event_handler(QEMUPutMouseEntry *entry);
+
QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func, void *opaque);
void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);