From 5d9fab1a2bf63de167ed072f8d3bc7072c812da9 Mon Sep 17 00:00:00 2001 From: Igor Mitsyanko Date: Thu, 28 Jun 2012 15:40:25 +0400 Subject: [PATCH] Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0 --- hw/usb/dev-storage.c | 3 ++- package/pkginfo.manifest | 4 ++-- tizen/src/maru_finger.c | 21 ++++++++++++------- tizen/src/maru_finger.h | 4 +++- tizen/src/maru_sdl.c | 4 ++-- .../org/tizen/emulator/skin/EmulatorSkin.java | 11 +++++----- .../skin/comm/sock/data/MouseEventData.java | 18 ++++++++++++---- .../emulator/skin/dialog/AboutDialog.java | 7 ++++++- tizen/src/skin/maruskin_operation.c | 6 +++--- tizen/src/skin/maruskin_operation.h | 2 +- tizen/src/skin/maruskin_server.c | 10 ++++++++- 11 files changed, 62 insertions(+), 28 deletions(-) mode change 100755 => 100644 tizen/src/skin/maruskin_operation.c diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index db172615f1..1e88fad36c 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -596,7 +596,7 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename) /* parse -usbdevice disk: syntax into drive opts */ snprintf(id, sizeof(id), "usb%d", nr++); opts = qemu_opts_create(qemu_find_opts("drive"), id, 0); - +#ifndef CONFIG_MARU p1 = strchr(filename, ':'); if (p1++) { const char *p2; @@ -611,6 +611,7 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename) } filename = p1; } +#endif if (!*filename) { printf("block device specification needed\n"); return NULL; diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index b602970293..798ccb5690 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Package: emulator -Version: 1.2.94 +Version: 1.2.95 OS: linux Build-host-os: linux Maintainer: Yeong-Kyoon Lee @@ -8,7 +8,7 @@ Source: emulator Description: Tizen Emulator Package: emulator -Version: 1.2.94 +Version: 1.2.95 OS: windows Build-host-os: windows Maintainer: Yeong-Kyoon Lee diff --git a/tizen/src/maru_finger.c b/tizen/src/maru_finger.c index f90702f44e..9f03ba34f2 100644 --- a/tizen/src/maru_finger.c +++ b/tizen/src/maru_finger.c @@ -140,7 +140,7 @@ static void sdl_fill_circle(SDL_Surface *surface, int cx, int cy, int radius, Ui Uint8 *target_pixel_a = (Uint8 *)surface->pixels + ((int)(cy + r - dy)) * surface->pitch + x * bpp; Uint8 *target_pixel_b = (Uint8 *)surface->pixels + ((int)(cy - r + dy)) * surface->pitch + x * bpp; - for (; x <= cx + dx; x++) + for ( ; x <= cx + dx; x++) { *(Uint32 *)target_pixel_a = pixel; *(Uint32 *)target_pixel_b = pixel; @@ -178,7 +178,7 @@ void init_multi_touch_state(void) for (i = 0; i < mts->finger_cnt_max; i++) { finger = get_finger_point_from_slot(i); //finger->id = 0; - finger->x = finger->y = -1; + finger->origin_x = finger->origin_y = finger->x = finger->y = -1; } mts->finger_point_size = DEFAULT_FINGER_POINT_SIZE; //temp @@ -221,7 +221,7 @@ int get_multi_touch_enable(void) return get_emul_multi_touch_state()->multitouch_enable; } -static int _add_finger_point(int x, int y) +static int _add_finger_point(int origin_x, int origin_y, int x, int y) { MultiTouchState *mts = get_emul_multi_touch_state(); @@ -233,6 +233,8 @@ static int _add_finger_point(int x, int y) mts->finger_cnt += 1; mts->finger_slot[mts->finger_cnt - 1].id = mts->finger_cnt; + mts->finger_slot[mts->finger_cnt - 1].origin_x = origin_x; + mts->finger_slot[mts->finger_cnt - 1].origin_y = origin_y; mts->finger_slot[mts->finger_cnt - 1].x = x; mts->finger_slot[mts->finger_cnt - 1].y = y; INFO("%d finger touching\n", mts->finger_cnt); @@ -260,6 +262,7 @@ FingerPoint *get_finger_point_search(int x, int y) for (i = mts->finger_cnt - 1; i >= 0; i--) { finger = get_finger_point_from_slot(i); + if (finger != NULL) { if (x >= (finger->x - finger_point_size_half) && x < (finger->x + finger_point_size_half) && @@ -276,7 +279,7 @@ FingerPoint *get_finger_point_search(int x, int y) static int _grab_finger_id = 0; #define QEMU_MOUSE_PRESSED 1 #define QEMU_MOUSE_RELEASEED 0 -void maru_finger_processing(int x, int y, int touch_type) +void maru_finger_processing(int touch_type, int origin_x, int origin_y, int x, int y) { MultiTouchState *mts = get_emul_multi_touch_state(); FingerPoint *finger = NULL; @@ -285,6 +288,8 @@ void maru_finger_processing(int x, int y, int touch_type) if (_grab_finger_id > 0) { finger = get_finger_point_from_slot(_grab_finger_id - 1); if (finger != NULL) { + finger->origin_x = origin_x; + finger->origin_y = origin_y; finger->x = x; finger->y = y; if (finger->id != 0) { @@ -297,7 +302,7 @@ void maru_finger_processing(int x, int y, int touch_type) if (mts->finger_cnt == 0) { //first finger touch input - if (_add_finger_point(x, y) == -1) { + if (_add_finger_point(origin_x, origin_y, x, y) == -1) { return; } kbd_mouse_event(x, y, 0, QEMU_MOUSE_PRESSED); @@ -316,6 +321,8 @@ void maru_finger_processing(int x, int y, int touch_type) kbd_mouse_event(finger->x, finger->y, mts->finger_cnt_max - 1, 0); #endif + finger->origin_x = origin_x; + finger->origin_y = origin_y; finger->x = x; finger->y = y; if (finger->id != 0) { @@ -325,7 +332,7 @@ void maru_finger_processing(int x, int y, int touch_type) } else //one more finger { - _add_finger_point(x, y) ; + _add_finger_point(origin_x, origin_y, x, y) ; kbd_mouse_event(x, y, mts->finger_cnt - 1, QEMU_MOUSE_PRESSED); } @@ -348,7 +355,7 @@ void clear_finger_slot(void) } finger->id = 0; - finger->x = finger->y = -1; + finger->origin_x = finger->origin_y = finger->x = finger->y = -1; } _grab_finger_id = 0; diff --git a/tizen/src/maru_finger.h b/tizen/src/maru_finger.h index a37edb5c11..a8a40c091d 100644 --- a/tizen/src/maru_finger.h +++ b/tizen/src/maru_finger.h @@ -41,6 +41,8 @@ typedef struct FingerPoint { int id; + int origin_x; + int origin_y; int x; int y; } FingerPoint; @@ -63,7 +65,7 @@ void set_multi_touch_enable(int enable); int get_multi_touch_enable(void); FingerPoint *get_finger_point_from_slot(int index); FingerPoint *get_finger_point_search(int x, int y); -void maru_finger_processing(int x, int y, int touch_type); +void maru_finger_processing(int touch_type, int origin_x, int origin_y, int x, int y); void clear_finger_slot(void); void cleanup_multi_touch_state(void); diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index fead9b398f..5ee2122268 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -91,8 +91,8 @@ static void qemu_update(void) for (i = 0; i < mts->finger_cnt; i++) { finger = get_finger_point_from_slot(i); if (finger != NULL && finger->id != 0) { - rect.x = (finger->x * get_emul_win_scale()) - finger_point_size_half; - rect.y = (finger->y * get_emul_win_scale()) - finger_point_size_half; + rect.x = finger->origin_x - finger_point_size_half; + rect.y = finger->origin_y - finger_point_size_half; rect.w = rect.h = mts->finger_point_size; SDL_BlitSurface((SDL_Surface *)mts->finger_point_surface, NULL, surface_screen, &rect); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index 3898a9840a..b58101376e 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -744,7 +744,8 @@ public class EmulatorSkin { int[] geometry = SkinUtil.convertMouseGeometry( e.x, e.y, currentLcdWidth, currentLcdHeight, currentScale, currentAngle ); - MouseEventData mouseEventData = new MouseEventData( eventType, geometry[0], geometry[1], 0 ); + MouseEventData mouseEventData = new MouseEventData( eventType, + e.x, e.y, geometry[0], geometry[1], 0 ); communicator.sendToQEMU( SendCommand.SEND_MOUSE_EVENT, mouseEventData ); } } @@ -762,8 +763,8 @@ public class EmulatorSkin { currentScale, currentAngle ); logger.info( "mouseUp in LCD" + " x:" + geometry[0] + " y:" + geometry[1] ); - MouseEventData mouseEventData = new MouseEventData( MouseEventType.UP.value(), geometry[0], - geometry[1], 0 ); + MouseEventData mouseEventData = new MouseEventData( MouseEventType.UP.value(), + e.x, e.y, geometry[0], geometry[1], 0 ); communicator.sendToQEMU( SendCommand.SEND_MOUSE_EVENT, mouseEventData ); if ( true == EmulatorSkin.this.isDragStartedInLCD ) { EmulatorSkin.this.isDragStartedInLCD = false; @@ -779,8 +780,8 @@ public class EmulatorSkin { currentScale, currentAngle ); logger.info( "mouseDown in LCD" + " x:" + geometry[0] + " y:" + geometry[1] ); - MouseEventData mouseEventData = new MouseEventData( MouseEventType.DOWN.value(), geometry[0], - geometry[1], 0 ); + MouseEventData mouseEventData = new MouseEventData( MouseEventType.DOWN.value(), + e.x, e.y, geometry[0], geometry[1], 0 ); communicator.sendToQEMU( SendCommand.SEND_MOUSE_EVENT, mouseEventData ); if ( false == EmulatorSkin.this.isDragStartedInLCD ) { EmulatorSkin.this.isDragStartedInLCD = true; diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java index 1733b4d9f1..b247b49578 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java @@ -38,12 +38,16 @@ import java.io.IOException; public class MouseEventData extends AbstractSendData { int eventType; + int originX; + int originY; int x; int y; int z; - public MouseEventData(int eventType, int x, int y, int z) { + public MouseEventData(int eventType, int originX, int originY, int x, int y, int z) { this.eventType = eventType; + this.originX = originX; + this.originY = originY; this.x = x; this.y = y; this.z = z; @@ -52,6 +56,8 @@ public class MouseEventData extends AbstractSendData { @Override protected void write() throws IOException { writeInt(eventType); + writeInt(originX); + writeInt(originY); writeInt(x); writeInt(y); writeInt(z); @@ -62,11 +68,15 @@ public class MouseEventData extends AbstractSendData { StringBuilder builder = new StringBuilder(); builder.append("MouseEventData [eventType="); builder.append(eventType); - builder.append(", x="); + builder.append(", originX="); + builder.append(originX); + builder.append(", originY="); + builder.append(originY); + builder.append(", transposeX="); builder.append(x); - builder.append(", y="); + builder.append(", transposeY="); builder.append(y); - builder.append(", z="); + builder.append(", id="); builder.append(z); builder.append("]"); return builder.toString(); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java index bc765ba99b..edc0d2c6e1 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java @@ -49,6 +49,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.tizen.emulator.skin.log.SkinLogger; import org.tizen.emulator.skin.util.IOUtil; +import org.tizen.emulator.skin.util.SkinUtil; import org.tizen.emulator.skin.util.StringUtil; public class AboutDialog extends SkinDialog { @@ -96,7 +97,11 @@ public class AboutDialog extends SkinDialog { Text versionText = new Text( composite, SWT.NONE ); String version = getValue( properties, PROP_KEY_VERSION ); - versionText.setText( "Version" + " : " + version ); + if (SkinUtil.isWindowsPlatform()) { + versionText.setText("Version" + " : " + version); + } else { + versionText.setText("Version" + " : " + version); + } versionText.setEditable( false ); versionText.setBackground( shell.getDisplay().getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c old mode 100755 new mode 100644 index 3d60e28857..d8f289b2c5 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -70,17 +70,17 @@ void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height, do maruskin_sdl_init(handle_id, lcd_size_width, lcd_size_height); } -void do_mouse_event( int event_type, int x, int y, int z ) +void do_mouse_event( int event_type, int origin_x, int origin_y, int x, int y, int z ) { if( brightness_off ) { TRACE( "reject mouse touch in lcd off : %d, x:%d, y:%d, z:%d\n", event_type, x, y, z ); return; } - TRACE( "mouse_event event_type:%d, x:%d, y:%d, z:%d\n", event_type, x, y, z ); + TRACE( "mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n", event_type, origin_x, origin_y, x, y, z ); if (get_emul_multi_touch_state()->multitouch_enable == 1) { - maru_finger_processing(x, y, event_type); + maru_finger_processing(event_type, origin_x, origin_y, x, y); } else if ( MOUSE_DOWN == event_type || MOUSE_DRAG == event_type) { //single touch kbd_mouse_event(x, y, z, 1); diff --git a/tizen/src/skin/maruskin_operation.h b/tizen/src/skin/maruskin_operation.h index 43427e28e9..7409d7a69f 100644 --- a/tizen/src/skin/maruskin_operation.h +++ b/tizen/src/skin/maruskin_operation.h @@ -49,7 +49,7 @@ typedef struct DetailInfo DetailInfo; void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type); -void do_mouse_event( int event_type, int x, int y, int z ); +void do_mouse_event( int event_type, int origin_x, int origin_y, int x, int y, int z ); void do_key_event( int event_type, int keycode, int key_location ); diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index 25133f9d32..c6c87d9dfd 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -589,6 +589,8 @@ static void* run_skin_server( void* args ) { /* keep it consistent with emulator-skin definition */ int event_type = 0; + int origin_x = 0; + int origin_y = 0; int x = 0; int y = 0; int z = 0; @@ -596,6 +598,10 @@ static void* run_skin_server( void* args ) { char* p = recvbuf; memcpy( &event_type, p, sizeof( event_type ) ); p += sizeof( event_type ); + memcpy( &origin_x, p, sizeof( origin_x ) ); + p += sizeof( origin_x ); + memcpy( &origin_y, p, sizeof( origin_y ) ); + p += sizeof( origin_y ); memcpy( &x, p, sizeof( x ) ); p += sizeof( x ); memcpy( &y, p, sizeof( y ) ); @@ -603,11 +609,13 @@ static void* run_skin_server( void* args ) { memcpy( &z, p, sizeof( z ) ); event_type = ntohl( event_type ); + origin_x = ntohl( origin_x ); + origin_y = ntohl( origin_y ); x = ntohl( x ); y = ntohl( y ); z = ntohl( z ); - do_mouse_event( event_type, x, y, z ); + do_mouse_event( event_type, origin_x, origin_y, x, y, z ); break; } case RECV_KEY_EVENT: { -- 2.34.1