From: Evgeny Voevodin Date: Mon, 9 Jul 2012 06:57:06 +0000 (+0400) Subject: Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0-develop X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1405^2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3948efa02b456d8e40c5676a084c322c743d251;p=sdk%2Femulator%2Fqemu.git Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0-develop Conflicts: tcg/i386/tcg-target.c Left untouched ld/st optimization from upstream patches. tizen/qemu_configure.sh vl.c Left untouched our implementation of switching between enabled or disable VirtioGL for target. Signed-off-by: Evgeny Voevodin --- diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 798ccb5690..967cd43e04 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Package: emulator -Version: 1.2.95 +Version: 1.2.100 OS: linux Build-host-os: linux Maintainer: Yeong-Kyoon Lee @@ -8,7 +8,7 @@ Source: emulator Description: Tizen Emulator Package: emulator -Version: 1.2.95 +Version: 1.2.100 OS: windows Build-host-os: windows Maintainer: Yeong-Kyoon Lee diff --git a/target-i386/hax-all.c b/target-i386/hax-all.c index 6c3354aad3..39e43c419c 100644 --- a/target-i386/hax-all.c +++ b/target-i386/hax-all.c @@ -573,7 +573,7 @@ static int hax_vcpu_hax_exec(CPUState *env) } - hax_cpu_synchronize_state(env); + //hax_cpu_synchronize_state(env); do { int hax_ret; @@ -584,10 +584,12 @@ static int hax_vcpu_hax_exec(CPUState *env) break; } +#if 0 if (env->hax_vcpu_dirty) { hax_vcpu_sync_state(env, 1); env->hax_vcpu_dirty = 0; } +#endif hax_vcpu_interrupt(env); diff --git a/tizen/qemu_configure.sh b/tizen/qemu_configure.sh index cd766944a0..35795b4cfd 100755 --- a/tizen/qemu_configure.sh +++ b/tizen/qemu_configure.sh @@ -15,6 +15,8 @@ exec ./configure \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ + --disable-vnc-jpeg \ + --disable-vnc-png \ --enable-opengles \ --enable-gl \ --disable-pie @@ -30,6 +32,8 @@ exec ./configure \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ + --disable-vnc-jpeg \ + --disable-vnc-png \ --enable-opengles \ --enable-gl ;; diff --git a/tizen/src/hw/opengl_exec.c b/tizen/src/hw/opengl_exec.c index 4721199d37..118380d972 100755 --- a/tizen/src/hw/opengl_exec.c +++ b/tizen/src/hw/opengl_exec.c @@ -1343,8 +1343,13 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args int i; for (i = 0; i < process->nb_states; i ++) { if (process->glstates[i]->fake_ctxt == fake_ctxt) { + /*XXX: DestroyContext should not switch current context, or + * else guest still try to access it and cause qemu + * segfalt. But not sure if any corner case, so comment it + * for now and will remove it completely in future. + */ // this was our GLState... - process->current_state = &process->default_state; + // process->current_state = &process->default_state; int fake_shareList = process->glstates[i]->fake_shareList; diff --git a/tizen/src/maru_finger.c b/tizen/src/maru_finger.c index 9f03ba34f2..cc37f59706 100644 --- a/tizen/src/maru_finger.c +++ b/tizen/src/maru_finger.c @@ -279,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 touch_type, int origin_x, int origin_y, int x, int y) +void maru_finger_processing_A(int touch_type, int origin_x, int origin_y, int x, int y) { MultiTouchState *mts = get_emul_multi_touch_state(); FingerPoint *finger = NULL; @@ -339,7 +339,72 @@ void maru_finger_processing(int touch_type, int origin_x, int origin_y, int x, i } else if (touch_type == MOUSE_UP) { /* released */ _grab_finger_id = 0; } +} + +void maru_finger_processing_B(int touch_type, int origin_x, int origin_y, int x, int y) +{ + MultiTouchState *mts = get_emul_multi_touch_state(); + FingerPoint *finger = NULL; + if (touch_type == MOUSE_DOWN || touch_type == MOUSE_DRAG) { /* pressed */ + if (_grab_finger_id > 0) { + finger = get_finger_point_from_slot(_grab_finger_id - 1); + if (finger != NULL) { + int origin_distance_x = origin_x - finger->origin_x; + int origin_distance_y = origin_y - finger->origin_y; + int distance_x = x - finger->x; + int distance_y = y - finger->y; + + int i = 0; + for( ; i < get_emul_multi_touch_state()->finger_cnt; i++) { + finger = get_finger_point_from_slot(i); + + if (finger != NULL) { + finger->origin_x += origin_distance_x; + finger->origin_y += origin_distance_y; + finger->x += distance_x; + finger->y += distance_y; + if (finger->id != 0) { + kbd_mouse_event(finger->x, finger->y, i, QEMU_MOUSE_PRESSED); + TRACE("id %d finger multi-touch dragging = (%d, %d)\n", i + 1, finger->x, finger->y); + } +#ifdef _WIN32 + Sleep(2); +#else + usleep(2000); +#endif + } + } + } + return; + } + + if (mts->finger_cnt == 0) + { //first finger touch input + if (_add_finger_point(origin_x, origin_y, x, y) == -1) { + return; + } + kbd_mouse_event(x, y, 0, QEMU_MOUSE_PRESSED); + } + else if ((finger = get_finger_point_search(x, y)) != NULL) //check the position of previous touch event + { + //finger point is selected + _grab_finger_id = finger->id; + TRACE("id %d finger is grabbed\n", _grab_finger_id); + } + else if (mts->finger_cnt == mts->finger_cnt_max) //Let's assume that this event is last finger touch input + { + //do nothing + } + else //one more finger + { + _add_finger_point(origin_x, origin_y, x, y) ; + kbd_mouse_event(x, y, mts->finger_cnt - 1, QEMU_MOUSE_PRESSED); + } + + } else if (touch_type == MOUSE_UP) { /* released */ + _grab_finger_id = 0; + } } void clear_finger_slot(void) diff --git a/tizen/src/maru_finger.h b/tizen/src/maru_finger.h index a8a40c091d..53cc43a59e 100644 --- a/tizen/src/maru_finger.h +++ b/tizen/src/maru_finger.h @@ -34,7 +34,7 @@ /* definitions relating to multi-touch */ //TODO : from arg -#define MAX_FINGER_CNT 2 +#define MAX_FINGER_CNT 3 #define DEFAULT_FINGER_POINT_SIZE 32 #define DEFAULT_FINGER_POINT_COLOR 0x7E0F0F0F #define DEFAULT_FINGER_POINT_OUTLINE_COLOR 0xDDDDDDDD @@ -65,7 +65,8 @@ 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 touch_type, int origin_x, int origin_y, int x, int y); +void maru_finger_processing_A(int touch_type, int origin_x, int origin_y, int x, int y); +void maru_finger_processing_B(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 5ee2122268..0d810299b0 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -83,7 +83,7 @@ static void qemu_update(void) /* draw multi-touch finger points */ MultiTouchState *mts = get_emul_multi_touch_state(); - if (mts->multitouch_enable == 1 && mts->finger_point_surface != NULL) { + if (mts->multitouch_enable != 0 && mts->finger_point_surface != NULL) { FingerPoint *finger = NULL; int finger_point_size_half = mts->finger_point_size / 2; SDL_Rect 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 b58101376e..336a289ad7 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 @@ -142,6 +142,7 @@ public class EmulatorSkin { private int currentLcdWidth; private int currentLcdHeight; private SkinRegion currentHoverRegion; + private SkinRegion currentPressedRegion; private int pressedMouseX; private int pressedMouseY; @@ -529,7 +530,6 @@ public class EmulatorSkin { shell.addMouseTrackListener( shellMouseTrackListener ); shellMouseMoveListener = new MouseMoveListener() { - @Override public void mouseMove( MouseEvent e ) { if ( EmulatorSkin.this.isMousePressed ) { @@ -547,7 +547,6 @@ public class EmulatorSkin { } } else { - SkinRegion region = SkinUtil.getHardKeyArea( e.x, e.y, currentRotationId, currentScale ); if ( null == region ) { @@ -569,23 +568,30 @@ public class EmulatorSkin { } isHoverState = true; - GC gc = new GC( shell ); - gc.setLineWidth( 1 ); - gc.setForeground( hoverColor ); - gc.drawRectangle( region.x, region.y, region.width, region.height ); currentHoverRegion = region; - gc.dispose(); - } + /* draw hover */ + shell.getDisplay().asyncExec(new Runnable() { + public void run() { + if (currentHoverRegion.width != 0 && currentHoverRegion.height != 0) { + GC gc = new GC(shell); + gc.setLineWidth(1); + gc.setForeground(hoverColor); + gc.drawRectangle(currentHoverRegion.x, currentHoverRegion.y, currentHoverRegion.width, currentHoverRegion.height); + + gc.dispose(); + } + } + }); + } } - } + } //end of mouseMove }; shell.addMouseMoveListener( shellMouseMoveListener ); shellMouseListener = new MouseListener() { - @Override public void mouseUp( MouseEvent e ) { if ( 1 == e.button ) { // left button @@ -597,9 +603,8 @@ public class EmulatorSkin { int keyCode = SkinUtil.getHardKeyCode( e.x, e.y, currentRotationId, currentScale ); if ( SkinUtil.UNKNOWN_KEYCODE != keyCode ) { - // null check : prevent from mouse up without a hover (ex. doing always on top in hardkey area) - if( null != currentHoverRegion ) { + if ( null != currentHoverRegion ) { if ( currentHoverRegion.width == 0 && currentHoverRegion.height == 0 ) { shell.redraw(); } else { @@ -607,7 +612,7 @@ public class EmulatorSkin { currentHoverRegion.height + 1, false ); } } - + SkinUtil.trimShell( shell, currentImage ); KeyEventData keyEventData = new KeyEventData( KeyEventType.RELEASED.value(), keyCode, 0 ); @@ -629,17 +634,39 @@ public class EmulatorSkin { int keyCode = SkinUtil.getHardKeyCode( e.x, e.y, currentRotationId, currentScale ); if ( SkinUtil.UNKNOWN_KEYCODE != keyCode ) { - // draw the button region as the cropped keyPressed image area - SkinRegion region = SkinUtil.getHardKeyArea( e.x, e.y, currentRotationId, currentScale ); - - if ( null != currentKeyPressedImage ) { - GC gc = new GC( shell ); - gc.drawImage( currentKeyPressedImage, region.x + 1, region.y + 1, region.width - 1, - region.height - 1, // src - region.x + 1, region.y + 1, region.width - 1, region.height - 1 ); // dst - gc.dispose(); - - SkinUtil.trimShell( shell, currentKeyPressedImage, region.x, region.y, region.width, region.height ); + shell.setToolTipText(null); + + /* draw the button region as the cropped keyPressed image area */ + currentPressedRegion = SkinUtil.getHardKeyArea( e.x, e.y, currentRotationId, currentScale ); + if (currentPressedRegion != null && currentPressedRegion.width != 0 && currentPressedRegion.height != 0) { + shell.getDisplay().asyncExec(new Runnable() { + public void run() { + if ( null != currentKeyPressedImage ) { + GC gc = new GC( shell ); + + /* button */ + gc.drawImage(currentKeyPressedImage, + currentPressedRegion.x + 1, currentPressedRegion.y + 1, + currentPressedRegion.width - 1, currentPressedRegion.height - 1, //src + currentPressedRegion.x + 1, currentPressedRegion.y + 1, + currentPressedRegion.width - 1, currentPressedRegion.height - 1); //dst + + /* hover */ + if (currentHoverRegion.width != 0 && currentHoverRegion.height != 0) { + gc.setLineWidth(1); + gc.setForeground(hoverColor); + gc.drawRectangle(currentHoverRegion.x, currentHoverRegion.y, currentHoverRegion.width, currentHoverRegion.height); + } + + gc.dispose(); + + SkinUtil.trimShell(shell, currentKeyPressedImage, + currentPressedRegion.x, currentPressedRegion.y, currentPressedRegion.width, currentPressedRegion.height); + + currentPressedRegion = null; + } + } + }); } KeyEventData keyEventData = new KeyEventData( KeyEventType.PRESSED.value(), keyCode, 0 ); @@ -1477,13 +1504,15 @@ public class EmulatorSkin { // readyToReopen( EmulatorSkin.this, isOnTop ); + //internal/Library.java::arch() String osArch = System.getProperty("os.arch"); //$NON-NLS-1$ - if (osArch.equals ("i386") || osArch.equals ("i686")) { //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ + logger.info(osArch); + if (osArch.equals("amd64") || osArch.equals("IA64N") || osArch.equals("IA64W")) { //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ + logger.info("64bit architecture"); + setTopMost64(isOnTop); //64bit + } else { logger.info("32bit architecture"); setTopMost32(isOnTop); - } else { //64bit OS - logger.info("64bit architecture"); - setTopMost64(isOnTop); } } } ); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java index 2442e3fdff..82acd19946 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java @@ -461,6 +461,7 @@ public class ScreenShotDialog { logger.warning( "Cannot find user home path int java System properties." ); } + fileDialog.setOverwrite(true); String filePath = fileDialog.open(); saveFile( filePath, fileDialog ); diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index d8f289b2c5..e38511b19b 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -80,7 +80,9 @@ void do_mouse_event( int event_type, int origin_x, int origin_y, int x, int y, i 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(event_type, origin_x, origin_y, x, y); + maru_finger_processing_A(event_type, origin_x, origin_y, x, y); + } else if (get_emul_multi_touch_state()->multitouch_enable == 2) { + maru_finger_processing_B(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); @@ -108,7 +110,7 @@ void do_key_event( int event_type, int keycode, int key_location ) if (keycode == JAVA_KEYCODE_BIT_CTRL) { if (KEY_PRESSED == event_type) { get_emul_multi_touch_state()->multitouch_enable = 1; - INFO("multi-touch enabled\n"); + INFO("multi-touch enabled = A\n"); } else if (KEY_RELEASED == event_type) { get_emul_multi_touch_state()->multitouch_enable = 0; clear_finger_slot(); @@ -121,6 +123,14 @@ void do_key_event( int event_type, int keycode, int key_location ) clear_finger_slot(); INFO("multi-touch disabled\n"); } + } else if (keycode == (JAVA_KEYCODE_BIT_SHIFT | JAVA_KEYCODE_BIT_CTRL)) { + if (KEY_PRESSED == event_type) { + get_emul_multi_touch_state()->multitouch_enable = 2; + INFO("multi-touch enabled = B\n"); + } else if (KEY_RELEASED == event_type) { + get_emul_multi_touch_state()->multitouch_enable = 1; + INFO("multi-touch enabled = A\n"); + } } }