From patchwork Tue May 4 16:56:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Jorsch X-Patchwork-Id: 51654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C7517B7D2F for ; Wed, 5 May 2010 15:36:01 +1000 (EST) Received: from localhost ([127.0.0.1]:35014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9XH4-00071e-CC for incoming@patchwork.ozlabs.org; Wed, 05 May 2010 01:35:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9LQi-0003OA-0T for qemu-devel@nongnu.org; Tue, 04 May 2010 12:57:08 -0400 Received: from [140.186.70.92] (port=47886 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9LQf-0003NO-Ew for qemu-devel@nongnu.org; Tue, 04 May 2010 12:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9LQa-0005ez-1h for qemu-devel@nongnu.org; Tue, 04 May 2010 12:57:03 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:49519) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9LQZ-0005dc-7q for qemu-devel@nongnu.org; Tue, 04 May 2010 12:56:59 -0400 X-Authority-Analysis: v=1.1 cv=Ebn0m7KaSvUJV60GCOzUqyhjUj7QmnsyUUVbVvk8w6o= c=1 sm=0 a=bF4fml8UZqMA:10 a=KM8nfJeeGFAA:10 a=sFBlSW20FPk1v4aQxZ+5uA==:17 a=FP58Ms26AAAA:8 a=uGQOD_1HMXOOK6dFGFEA:9 a=D8CA2EC0hEWSUz94K-MA:7 a=M1gLZAcRBkNV5Co7EIUqKjJOut8A:4 a=sFBlSW20FPk1v4aQxZ+5uA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 66.26.236.130 Received: from [66.26.236.130] ([66.26.236.130:37493] helo=anomie.yi.org) by hrndva-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 9C/A0-07101-5D150EB4; Tue, 04 May 2010 16:56:53 +0000 Received: from [10.230.46.10] (helo=ataxia) by anomie.yi.org with esmtp (Exim 4.71) (envelope-from ) id 1O9LQS-0002vP-Lw for qemu-devel@nongnu.org; Tue, 04 May 2010 12:56:52 -0400 Received: from brad by ataxia with local (Exim 4.71) (envelope-from ) id 1O9LQI-00070v-N7 for qemu-devel@nongnu.org; Tue, 04 May 2010 12:56:42 -0400 From: Brad Jorsch To: qemu-devel@nongnu.org Date: Tue, 4 May 2010 12:56:37 -0400 Message-Id: <1272992201-26911-2-git-send-email-anomie@users.sourceforge.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1272992201-26911-1-git-send-email-anomie@users.sourceforge.net> References: <1272992201-26911-1-git-send-email-anomie@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 1/5] Add function parameters for hwheel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add a parameter for the hwheel delta to QEMUPutMouseEntry and kbd_mouse_event, and adjust all users of those to match. At the moment, all calls to kbd_mouse_event will pass 0 for the delta. Signed-off-by: Brad Jorsch --- cocoa.m | 6 +++--- console.h | 4 ++-- hw/adb.c | 3 ++- hw/ads7846.c | 2 +- hw/escc.c | 3 ++- hw/msmouse.c | 2 +- hw/ps2.c | 4 ++-- hw/syborg_pointer.c | 2 +- hw/tsc2005.c | 2 +- hw/tsc210x.c | 2 +- hw/usb-hid.c | 5 +++-- hw/usb-wacom.c | 5 +++-- hw/vmmouse.c | 3 ++- hw/xenfb.c | 2 +- input.c | 6 +++--- monitor.c | 4 ++-- sdl.c | 10 ++++++---- vnc.c | 6 +++--- 18 files changed, 39 insertions(+), 32 deletions(-) diff --git a/cocoa.m b/cocoa.m index 56c789a..c247833 100644 --- a/cocoa.m +++ b/cocoa.m @@ -47,9 +47,9 @@ #define cgrect(nsrect) (*(CGRect *)&(nsrect)) #define COCOA_MOUSE_EVENT \ if (isTabletEnabled) { \ - kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, buttons); \ + kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, 0, buttons); \ } else if (isMouseGrabed) { \ - kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \ + kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, 0, buttons); \ } else { \ [NSApp sendEvent:event]; \ } @@ -649,7 +649,7 @@ static int cocoa_keycode_to_qemu(int keycode) break; case NSScrollWheel: if (isTabletEnabled || isMouseGrabed) { - kbd_mouse_event(0, 0, -[event deltaY], 0); + kbd_mouse_event(0, 0, -[event deltaY], 0, 0); } else { [NSApp sendEvent:event]; } diff --git a/console.h b/console.h index 6def115..7ec693d 100644 --- a/console.h +++ b/console.h @@ -21,7 +21,7 @@ typedef void QEMUPutKBDEvent(void *opaque, int keycode); typedef void QEMUPutLEDEvent(void *opaque, int ledstate); -typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state); +typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int dw, int buttons_state); typedef struct QEMUPutMouseEntry { QEMUPutMouseEvent *qemu_put_mouse_event; @@ -53,7 +53,7 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry); void kbd_put_keycode(int keycode); void kbd_put_ledstate(int ledstate); -void kbd_mouse_event(int dx, int dy, int dz, int buttons_state); +void kbd_mouse_event(int dx, int dy, int dz, int dw, int buttons_state); /* Does the current mouse generate absolute events */ int kbd_mouse_is_absolute(void); diff --git a/hw/adb.c b/hw/adb.c index 4fb7a62..88be567 100644 --- a/hw/adb.c +++ b/hw/adb.c @@ -318,7 +318,8 @@ typedef struct MouseState { } MouseState; static void adb_mouse_event(void *opaque, - int dx1, int dy1, int dz1, int buttons_state) + int dx1, int dy1, int dz1, int dw1, + int buttons_state) { ADBDevice *d = opaque; MouseState *s = d->opaque; diff --git a/hw/ads7846.c b/hw/ads7846.c index 184b3dd..544db09 100644 --- a/hw/ads7846.c +++ b/hw/ads7846.c @@ -86,7 +86,7 @@ static uint32_t ads7846_transfer(SSISlave *dev, uint32_t value) } static void ads7846_ts_event(void *opaque, - int x, int y, int z, int buttons_state) + int x, int y, int z, int w, int buttons_state) { ADS7846State *s = opaque; diff --git a/hw/escc.c b/hw/escc.c index 6d2fd36..c7b420d 100644 --- a/hw/escc.c +++ b/hw/escc.c @@ -827,7 +827,8 @@ static void handle_kbd_command(ChannelState *s, int val) } static void sunmouse_event(void *opaque, - int dx, int dy, int dz, int buttons_state) + int dx, int dy, int dz, int dw, + int buttons_state) { ChannelState *s = opaque; int ch; diff --git a/hw/msmouse.c b/hw/msmouse.c index 05f893c..f1bfd0d 100644 --- a/hw/msmouse.c +++ b/hw/msmouse.c @@ -31,7 +31,7 @@ #define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6) static void msmouse_event(void *opaque, - int dx, int dy, int dz, int buttons_state) + int dx, int dy, int dz, int dw, int buttons_state) { CharDriverState *chr = (CharDriverState *)opaque; diff --git a/hw/ps2.c b/hw/ps2.c index f0b206a..db5605d 100644 --- a/hw/ps2.c +++ b/hw/ps2.c @@ -330,7 +330,7 @@ static void ps2_mouse_send_packet(PS2MouseState *s) } static void ps2_mouse_event(void *opaque, - int dx, int dy, int dz, int buttons_state) + int dx, int dy, int dz, int dw, int buttons_state) { PS2MouseState *s = opaque; @@ -361,7 +361,7 @@ static void ps2_mouse_event(void *opaque, void ps2_mouse_fake_event(void *opaque) { - ps2_mouse_event(opaque, 1, 0, 0, 0); + ps2_mouse_event(opaque, 1, 0, 0, 0, 0); } void ps2_write_mouse(void *opaque, int val) diff --git a/hw/syborg_pointer.c b/hw/syborg_pointer.c index 563d730..04aa55b 100644 --- a/hw/syborg_pointer.c +++ b/hw/syborg_pointer.c @@ -122,7 +122,7 @@ static CPUWriteMemoryFunc * const syborg_pointer_writefn[] = { syborg_pointer_write }; -static void syborg_pointer_event(void *opaque, int dx, int dy, int dz, +static void syborg_pointer_event(void *opaque, int dx, int dy, int dz, int dw, int buttons_state) { SyborgPointerState *s = (SyborgPointerState *)opaque; diff --git a/hw/tsc2005.c b/hw/tsc2005.c index b75cc86..6bf991d 100644 --- a/hw/tsc2005.c +++ b/hw/tsc2005.c @@ -412,7 +412,7 @@ static void tsc2005_timer_tick(void *opaque) } static void tsc2005_touchscreen_event(void *opaque, - int x, int y, int z, int buttons_state) + int x, int y, int z, int dw, int buttons_state) { TSC2005State *s = opaque; int p = s->pressure; diff --git a/hw/tsc210x.c b/hw/tsc210x.c index e851ca1..c97aaf2 100644 --- a/hw/tsc210x.c +++ b/hw/tsc210x.c @@ -968,7 +968,7 @@ static void tsc210x_timer_tick(void *opaque) } static void tsc210x_touchscreen_event(void *opaque, - int x, int y, int z, int buttons_state) + int x, int y, int z, int w, int buttons_state) { TSC210xState *s = opaque; int p = s->pressure; diff --git a/hw/usb-hid.c b/hw/usb-hid.c index 476fcfd..deb4731 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -414,7 +414,8 @@ static void usb_hid_changed(USBHIDState *hs) } static void usb_mouse_event(void *opaque, - int dx1, int dy1, int dz1, int buttons_state) + int dx1, int dy1, int dz1, int dw1, + int buttons_state) { USBHIDState *hs = opaque; USBMouseState *s = &hs->ptr; @@ -428,7 +429,7 @@ static void usb_mouse_event(void *opaque, } static void usb_tablet_event(void *opaque, - int x, int y, int dz, int buttons_state) + int x, int y, int dz, int dw, int buttons_state) { USBHIDState *hs = opaque; USBMouseState *s = &hs->ptr; diff --git a/hw/usb-wacom.c b/hw/usb-wacom.c index fe052eb..b14e58b 100644 --- a/hw/usb-wacom.c +++ b/hw/usb-wacom.c @@ -119,7 +119,8 @@ static const uint8_t qemu_wacom_config_descriptor[] = { }; static void usb_mouse_event(void *opaque, - int dx1, int dy1, int dz1, int buttons_state) + int dx1, int dy1, int dz1, int dw1, + int buttons_state) { USBWacomState *s = opaque; @@ -131,7 +132,7 @@ static void usb_mouse_event(void *opaque, } static void usb_wacom_event(void *opaque, - int x, int y, int dz, int buttons_state) + int x, int y, int dz, int dw, int buttons_state) { USBWacomState *s = opaque; diff --git a/hw/vmmouse.c b/hw/vmmouse.c index bb6e605..b619170 100644 --- a/hw/vmmouse.c +++ b/hw/vmmouse.c @@ -67,7 +67,8 @@ static uint32_t vmmouse_get_status(VMMouseState *s) return (s->status << 16) | s->nb_queue; } -static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int buttons_state) +static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int dw, + int buttons_state) { VMMouseState *s = opaque; int buttons = 0; diff --git a/hw/xenfb.c b/hw/xenfb.c index 422cd53..0d83810 100644 --- a/hw/xenfb.c +++ b/hw/xenfb.c @@ -320,7 +320,7 @@ static void xenfb_key_event(void *opaque, int scancode) * the button state. */ static void xenfb_mouse_event(void *opaque, - int dx, int dy, int dz, int button_state) + int dx, int dy, int dz, int dz2, int button_state) { struct XenInput *xenfb = opaque; int dw = ds_get_width(xenfb->c.ds); diff --git a/input.c b/input.c index 8f0941e..ea7c246 100644 --- a/input.c +++ b/input.c @@ -137,7 +137,7 @@ void kbd_put_ledstate(int ledstate) } } -void kbd_mouse_event(int dx, int dy, int dz, int buttons_state) +void kbd_mouse_event(int dx, int dy, int dz, int dw, int buttons_state) { QEMUPutMouseEntry *entry; QEMUPutMouseEvent *mouse_event; @@ -160,10 +160,10 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state) else width = graphic_width - 1; mouse_event(mouse_event_opaque, - width - dy, dx, dz, buttons_state); + width - dy, dx, dz, dw, buttons_state); } else mouse_event(mouse_event_opaque, - dx, dy, dz, buttons_state); + dx, dy, dz, dw, buttons_state); } } diff --git a/monitor.c b/monitor.c index 46d0b47..520d48d 100644 --- a/monitor.c +++ b/monitor.c @@ -1841,14 +1841,14 @@ static void do_mouse_move(Monitor *mon, const QDict *qdict) dz = 0; if (dz_str) dz = strtol(dz_str, NULL, 0); - kbd_mouse_event(dx, dy, dz, mouse_button_state); + kbd_mouse_event(dx, dy, dz, 0, mouse_button_state); } static void do_mouse_button(Monitor *mon, const QDict *qdict) { int button_state = qdict_get_int(qdict, "button_state"); mouse_button_state = button_state; - kbd_mouse_event(0, 0, 0, mouse_button_state); + kbd_mouse_event(0, 0, 0, 0, mouse_button_state); } static void do_ioport_read(Monitor *mon, const QDict *qdict) diff --git a/sdl.c b/sdl.c index 16a48e9..616a7eb 100644 --- a/sdl.c +++ b/sdl.c @@ -503,7 +503,8 @@ static void sdl_mouse_mode_change(Notifier *notify) } } -static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state) +static void sdl_send_mouse_event(int dx, int dy, int dz, int dw, + int x, int y, int state) { int buttons; buttons = 0; @@ -526,7 +527,7 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state dy = y; } - kbd_mouse_event(dx, dy, dz, buttons); + kbd_mouse_event(dx, dy, dz, dw, buttons); } static void toggle_full_screen(DisplayState *ds) @@ -684,7 +685,7 @@ static void sdl_refresh(DisplayState *ds) case SDL_MOUSEMOTION: if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) { - sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0, + sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0, 0, ev->motion.x, ev->motion.y, ev->motion.state); } break; @@ -713,7 +714,8 @@ static void sdl_refresh(DisplayState *ds) dz = 1; } #endif - sdl_send_mouse_event(0, 0, dz, bev->x, bev->y, buttonstate); + sdl_send_mouse_event(0, 0, dz, 0, bev->x, bev->y, + buttonstate); } } break; diff --git a/vnc.c b/vnc.c index 5241a6a..332c14a 100644 --- a/vnc.c +++ b/vnc.c @@ -1292,17 +1292,17 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y) x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000, ds_get_height(vs->ds) > 1 ? y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000, - dz, buttons); + dz, 0, buttons); } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) { x -= 0x7FFF; y -= 0x7FFF; - kbd_mouse_event(x, y, dz, buttons); + kbd_mouse_event(x, y, dz, 0, buttons); } else { if (vs->last_x != -1) kbd_mouse_event(x - vs->last_x, y - vs->last_y, - dz, buttons); + dz, 0, buttons); vs->last_x = x; vs->last_y = y; }