[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 1/8] ui/input: Clean up QEMUPutMouseEntry struct
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH RFC 1/8] ui/input: Clean up QEMUPutMouseEntry struct |
Date: |
Sun, 16 Jun 2013 05:39:58 +0200 |
Shorten field names to not duplicate struct name.
Signed-off-by: Andreas Färber <address@hidden>
---
ui/input.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/ui/input.c b/ui/input.c
index 92c44ca..badf6c3 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -31,10 +31,10 @@
#include "ui/keymaps.h"
struct QEMUPutMouseEntry {
- QEMUPutMouseEvent *qemu_put_mouse_event;
- void *qemu_put_mouse_event_opaque;
- int qemu_put_mouse_event_absolute;
- char *qemu_put_mouse_event_name;
+ QEMUPutMouseEvent *put_event;
+ void *opaque;
+ int absolute;
+ char *name;
int index;
@@ -355,10 +355,10 @@ QEMUPutMouseEntry
*qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
s = g_malloc0(sizeof(QEMUPutMouseEntry));
- s->qemu_put_mouse_event = func;
- s->qemu_put_mouse_event_opaque = opaque;
- s->qemu_put_mouse_event_absolute = absolute;
- s->qemu_put_mouse_event_name = g_strdup(name);
+ s->put_event = func;
+ s->opaque = opaque;
+ s->absolute = absolute;
+ s->name = g_strdup(name);
s->index = mouse_index++;
QTAILQ_INSERT_TAIL(&mouse_handlers, s, node);
@@ -380,7 +380,7 @@ void qemu_remove_mouse_event_handler(QEMUPutMouseEntry
*entry)
{
QTAILQ_REMOVE(&mouse_handlers, entry, node);
- g_free(entry->qemu_put_mouse_event_name);
+ g_free(entry->name);
g_free(entry);
check_mode_change();
@@ -444,11 +444,11 @@ void kbd_mouse_event(int dx, int dy, int dz, int
buttons_state)
entry = QTAILQ_FIRST(&mouse_handlers);
- mouse_event = entry->qemu_put_mouse_event;
- mouse_event_opaque = entry->qemu_put_mouse_event_opaque;
+ mouse_event = entry->put_event;
+ mouse_event_opaque = entry->opaque;
if (mouse_event) {
- if (entry->qemu_put_mouse_event_absolute) {
+ if (entry->absolute) {
width = 0x7fff;
height = 0x7fff;
} else {
@@ -483,7 +483,7 @@ int kbd_mouse_is_absolute(void)
return 0;
}
- return QTAILQ_FIRST(&mouse_handlers)->qemu_put_mouse_event_absolute;
+ return QTAILQ_FIRST(&mouse_handlers)->absolute;
}
int kbd_mouse_has_absolute(void)
@@ -491,7 +491,7 @@ int kbd_mouse_has_absolute(void)
QEMUPutMouseEntry *entry;
QTAILQ_FOREACH(entry, &mouse_handlers, node) {
- if (entry->qemu_put_mouse_event_absolute) {
+ if (entry->absolute) {
return 1;
}
}
@@ -508,9 +508,9 @@ MouseInfoList *qmp_query_mice(Error **errp)
QTAILQ_FOREACH(cursor, &mouse_handlers, node) {
MouseInfoList *info = g_malloc0(sizeof(*info));
info->value = g_malloc0(sizeof(*info->value));
- info->value->name = g_strdup(cursor->qemu_put_mouse_event_name);
+ info->value->name = g_strdup(cursor->name);
info->value->index = cursor->index;
- info->value->absolute = !!cursor->qemu_put_mouse_event_absolute;
+ info->value->absolute = !!cursor->absolute;
info->value->current = current;
current = false;
--
1.8.1.4
- [Qemu-devel] [PATCH RFC 0/8] monitor: Fix mouse_button and improve mouse_move commands, Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 2/8] ui/input: Simplify kbd_mouse_event(), Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 1/8] ui/input: Clean up QEMUPutMouseEntry struct,
Andreas Färber <=
- [Qemu-devel] [PATCH RFC 3/8] ui/input: Use bool for qemu_add_mouse_event_handler(), Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 4/8] ui/input: Introduce MouseOps for qemu_add_mouse_event_handler(), Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 6/8] monitor: Eliminate global mouse buttons state for mouse_move, Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 8/8] monitor: Fix mouse_button command for absolute coordinates, Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 5/8] ui/input: Introduce MouseOps::get_buttons_state(), Andreas Färber, 2013/06/15
- [Qemu-devel] [PATCH RFC 7/8] ui/input: Introduce MouseOps::get_position(), Andreas Färber, 2013/06/15
- Re: [Qemu-devel] [PATCH RFC 0/8] monitor: Fix mouse_button and improve mouse_move commands, Gerd Hoffmann, 2013/06/17