Update sdk version to tizen_2.2
authorSangjin Kim <sangjin3.kim@samsung.com>
Mon, 24 Jun 2013 09:54:43 +0000 (18:54 +0900)
committerSangjin Kim <sangjin3.kim@samsung.com>
Mon, 24 Jun 2013 10:46:06 +0000 (19:46 +0900)
Change-Id: I1809eee8d9850266ff6811ed982db676235214c8
Signed-off-by: Sangjin Kim <sangjin3.kim@samsung.com>
61 files changed:
Makefile.target
configure
hw/pci-hotplug.c
package/changelog
package/pkginfo.manifest
qemu-sockets.c
sysemu.h
tizen/src/Makefile.tizen
tizen/src/guest_server.c
tizen/src/hw/gloffscreen.h
tizen/src/hw/gloffscreen_agl.c
tizen/src/hw/gloffscreen_common.c
tizen/src/hw/gloffscreen_glx.c
tizen/src/hw/gloffscreen_wgl.c
tizen/src/hw/gloffscreen_xcomposite.c
tizen/src/hw/maru_camera_win32_pci.c
tizen/src/hw/maru_virtio_keyboard.c
tizen/src/hw/opengl_exec.c
tizen/src/maru_sdl.c
tizen/src/mloop_event.c
tizen/src/mloop_event.h
tizen/src/osutil-darwin.c
tizen/src/skin/client/skins/emul-320x480/info.ini
tizen/src/skin/client/skins/emul-480x800-3btn/default.dbi [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_0.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_0_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_180.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_180_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_L90.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_L90_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_R90.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/default_R90_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800-3btn/info.ini [new file with mode: 0644]
tizen/src/skin/client/skins/emul-480x800/info.ini [deleted file]
tizen/src/skin/client/skins/emul-480x800/info.ini.bak [new file with mode: 0644]
tizen/src/skin/client/skins/emul-600x1024/info.ini
tizen/src/skin/client/skins/emul-720x1280-3btn/default.dbi [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_0.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_0_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_180.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_180_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90_p.png [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280-3btn/info.ini [new file with mode: 0644]
tizen/src/skin/client/skins/emul-720x1280/info.ini [deleted file]
tizen/src/skin/client/skins/emul-720x1280/info.ini.bak [new file with mode: 0644]
tizen/src/skin/client/skins/emul-general-3btn/default.dbi [new file with mode: 0644]
tizen/src/skin/client/skins/emul-general-3btn/info.ini [new file with mode: 0644]
tizen/src/skin/client/skins/emul-general/info.ini [deleted file]
tizen/src/skin/client/skins/emul-general/info.ini.bak [new file with mode: 0644]
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java
tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomButton.java
tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java
tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java
tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java
tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java
tizen/src/skin/maruskin_operation.c

index 437199188cf1394624d08f3ce3b5bdd8787335b3..7a9b9939eda374a298c47d098607935962e3e696 100755 (executable)
@@ -327,7 +327,9 @@ CHECK_GL_LDFLAGS =
 CHECK_GL_TARGET =
 ifdef CONFIG_LINUX
 CHECK_GL_OBJS += gloffscreen_xcomposite.o
-CHECK_GL_LDFLAGS += -lGL -lXcomposite -lXext -lglib-2.0
+#CHECK_GL_LDFLAGS += -lGL -lXcomposite -lXext -lglib-2.0
+# Fix linking error on Ubuntu 13.04
+CHECK_GL_LDFLAGS += -lGL -lXcomposite -lX11 -lXext -lglib-2.0
 CHECK_GL_TARGET = check-gl
 endif
 ifdef CONFIG_WIN32
index d04beb4c7f5f3fe74b4c45c79be6a22656b408f3..1015d9dac68039da7e9e51343e758f4a25445de9 100755 (executable)
--- a/configure
+++ b/configure
@@ -543,6 +543,8 @@ Haiku)
   if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
     audio_possible_drivers="$audio_possible_drivers fmod"
   fi
+# fix linking error on Ubuntu 13.04
+  libs_qga="-lrt $libs_qga"
 ;;
 esac
 
@@ -2216,6 +2218,22 @@ else
     exit 1
 fi
 
+##########################################
+# pixman support probe
+
+if test "$shm" = no; then
+    if $pkg_config pixman-1 > /dev/null 2>&1; then
+        pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null`
+        pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null`
+        QEMU_CFLAGS="$pixman_cflags $QEMU_CFLAGS"
+        LIBS="$pixman_libs $LIBS"
+    else
+        echo "Error: pixman-1 check failed"
+        echo "Make sure to have the pixman-1 libs and headers installed"
+        exit 1
+    fi
+fi
+
 ##########################################
 # libcap probe
 
@@ -2748,7 +2766,10 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
+/* Fix linking error on Ubuntu 13.04
 int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); }
+*/
+int main(void) { return timer_gettime(CLOCK_REALTIME, NULL); }
 EOF
 
 if compile_prog "" "" ; then
index 73badc15ad4d72369ed213849b42bc3cf1f52071..33d1baceeebf634f0b91c5284d3bec351639c480 100644 (file)
@@ -246,7 +246,11 @@ static PCIDevice *qemu_pci_hot_add_keyboard(Monitor *mon,
 }
 #endif /* CONFIG_MARU */
 
+#ifdef CONFIG_MARU
+PCIDevice *pci_device_hot_add(Monitor *mon, const QDict *qdict)
+#else
 void pci_device_hot_add(Monitor *mon, const QDict *qdict)
+#endif
 {
     PCIDevice *dev = NULL;
     const char *pci_addr = qdict_get_str(qdict, "pci_addr");
@@ -284,6 +288,9 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict)
                        PCI_FUNC(dev->devfn));
     } else
         monitor_printf(mon, "failed to add %s\n", opts);
+#ifdef CONFIG_MARU
+    return dev;
+#endif
 }
 #endif
 
index fb518c60f83e4a2826c2e1cb2ea3bfe4cdecc303..f996f8d642b8bdc2020be4c01742babb674530f7 100644 (file)
@@ -1,3 +1,7 @@
+* 2.2.0
+- tizen_2.2 source update
+== Sangjin Kim <sangjin3.kim@samsung.com> 2013-06-24
+
 * 1.5.38
 - modified process of using virtio keyboard queue and added key release event when context menu is activated
 == Sungmin Ha <sungmin82.ha@samsung.com> 2013-05-14
index 1c22f7c0283799717d7f0d8db83c351d0e1f2b05..b14c1a4687b2d3269e465dc49f081a59c458a75a 100644 (file)
@@ -1,4 +1,4 @@
-Version: 1.5.38
+Version: 2.2.0
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 Source: emulator
 
@@ -43,7 +43,7 @@ Description: Tizen x86 Emulator
 Package: emulator-qemu-x86
 OS: windows-32, windows-64
 Build-host-os: windows-32
-Build-dependency: SDL-1.2.14 [ windows-32 ], apache-ant-1.8.3-bin [ windows-32 ], gtk-bundle_2.16.6 [ windows-32 ], directx-dev [ windows-32 ], libcurl-4 [ windows-32 ], emulator-lib [ windows-32 ]
+Build-dependency: SDL-1.2.14 [ windows-32 ], apache-ant-1.8.3-bin [ windows-32 ], gtk-bundle_2.16.6 [ windows-32 ], directx-dev [ windows-32 ], libcurl-4 [ windows-32 ], pixman-0.30.0 [ windows-32 ], emulator-lib [ windows-32 ]
 Install-dependency: emulator-kernel-x86 [ windows-32 ], vgabios [ windows-32 ]
 Description: Tizen x86 Emulator
 
index 361d890da3e812abb6d2e09088bc2c0f6792d54d..34cbbde01a03ecf20beb15377b794b7dec1fd5fb 100644 (file)
@@ -242,6 +242,14 @@ int inet_connect_opts(QemuOpts *opts, bool *in_progress, Error **errp)
     if (qemu_opt_get_bool(opts, "ipv6", 0))
         ai.ai_family = PF_INET6;
 
+#ifdef CONFIG_MARU
+    // for lookup loopback interface...
+    if (addr[0] == '\0') {
+        ai.ai_flags = 0;
+        addr = NULL;
+    }
+#endif
+
     /* lookup */
     if (0 != (rc = getaddrinfo(addr, port, &ai, &res))) {
         fprintf(stderr,"getaddrinfo(%s,%s): %s\n", addr, port,
index 92107114f9777048d28e6fe34d1d2d4e4ad8a981..3a23fb97dcdb1b91466983d45c2ffb0b2e74b468 100644 (file)
--- a/sysemu.h
+++ b/sysemu.h
@@ -161,7 +161,11 @@ extern const char *prom_envs[MAX_PROM_ENVS];
 extern unsigned int nb_prom_envs;
 
 /* pci-hotplug */
+#ifdef CONFIG_MARU
+PCIDevice *pci_device_hot_add(Monitor *mon, const QDict *qdict);
+#else
 void pci_device_hot_add(Monitor *mon, const QDict *qdict);
+#endif
 int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
                       DriveInfo *dinfo, int type);
 void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict);
index e37499241074b0b561e85fc4046b27791d7fe0b8..0dd0b14b9dd8356ef902f429e1f9b2a0a785d6e1 100755 (executable)
@@ -104,7 +104,7 @@ endif
 # maru display
 obj-y += maru_display.o maru_shm.o
 ifndef CONFIG_DARWIN
-obj-y += maru_sdl.o SDL_rotozoom.o maru_finger.o
+obj-y += maru_sdl.o maru_finger.o
 endif
 
 # sdb
index 5840ed4b045909db74f1f53d314c4d4152d18128..1649d182adbacd7b07ebe667ef99f397404a28fa 100644 (file)
@@ -223,8 +223,8 @@ static void* run_guest_server(void* args)
 
                 if (atoi(ret) == 0) {
                     /* umount sdcard */
-                    mloop_evcmd_usbdisk(NULL);
-
+                    //mloop_evcmd_usbdisk(NULL);
+                    mloop_evcmd_sdcard(NULL);
                 } else if (atoi(ret) == 1) {
                     /* mount sdcard */
                     char sdcard_path[256];
@@ -238,7 +238,9 @@ static void* run_guest_server(void* args)
                     strcat(sdcard_path, ret);
                     INFO("%s\n", sdcard_path);
 
-                    mloop_evcmd_usbdisk(sdcard_path);
+                    //mloop_evcmd_usbdisk(sdcard_path);
+                    mloop_evcmd_sdcard(sdcard_path);
+
                     free(vms_path);
                 } else {
                     ERR("!!! unknown command : %s\n", ret);
index 11547c71bea9d600aee8efb24b9582e7a3e075eb..f317619baaf32e603e1dd3bf3db529cab2236841 100644 (file)
@@ -86,7 +86,7 @@ extern void glo_surface_update_context(GloSurface *surface, GloContext *context,
 /* Link the pixmap/pbuffer associated with surface as texture.
  * ctxt is the target context for the texture operation
  */
-extern void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface);
+extern void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type);
 
 /* Create a surface with given width and height, */
 extern GloSurface *glo_surface_create(int width, int height, GloContext *context);
index 2070bade76289297544caf2b787c842e4ed30117..5ae68c58fd6077dcaa0c4509555c3b1ad3c3ef70 100644 (file)
@@ -57,7 +57,7 @@ struct _GloSurface
   
 extern void glo_surface_getcontents_readpixels(int formatFlags, int stride, 
                                                 int bpp, int width, int height, 
-                                                void *data); 
+                                                void *data, int noflip);
 
 
   
@@ -316,7 +316,7 @@ void glo_surface_getcontents(GloSurface *surface, int stride, int bpp,
      { 
         aglSwapBuffers(surface->context->context);     
        aglSetInteger(surface->context->context, AGL_SWAP_INTERVAL, &swap_interval);
-        glo_surface_getcontents_readpixels(surface->context->formatFlags, stride, bpp, surface->width, surface->height, data); 
+        glo_surface_getcontents_readpixels(surface->context->formatFlags, stride, bpp, surface->width, surface->height, data, 0);
     } 
 } 
   
@@ -335,7 +335,7 @@ void glo_surface_get_size(GloSurface *surface, int *width, int *height)
 } 
  
 /* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
+void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
 {
 #if 0
        //Not QUit sure about this function;
index bd1285421c3aa671fea4776a62e64524918de42d..c8fd382c9bdd189be0c5295ba0aed89cf4b30243 100644 (file)
@@ -102,7 +102,7 @@ void g_free(void *ptr);
 // ---------------------------------------------------
 
 extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
-                                    int bpp, int width, int height, void *data);
+                                    int bpp, int width, int height, void *data, int noflip);
 
 // ---------------------------------------------------
 
@@ -370,7 +370,7 @@ void glo_geometry_get_from_glx(const int* attrib_list, int* width, int* height)
 }
 
 void glo_surface_getcontents_readpixels(int formatFlags, int stride, int bpp,
-                             int width, int height, void *data) {
+                             int width, int height, void *data, int noflip) {
     int glFormat, glType, rl, pa;
     static int once;
 
@@ -418,12 +418,14 @@ void glo_surface_getcontents_readpixels(int formatFlags, int stride, int bpp,
 
     glReadPixels(0, 0, width, height, glFormat, glType, data);
 
-    for(irow = 0; irow < height/2; irow++) {
-        memcpy(tmp, b, stride);
-        memcpy(b, c, stride);
-        memcpy(c, tmp, stride);
-        b += stride;
-        c -= stride;
+    if (noflip == 0) {
+        for(irow = 0; irow < height/2; irow++) {
+            memcpy(tmp, b, stride);
+            memcpy(b, c, stride);
+            memcpy(c, tmp, stride);
+            b += stride;
+            c -= stride;
+        }
     }
     g_free(tmp);
 
index f649a0ff3e120aaa3ec11630a91ad25647337e07..a2ec3b2cc068dd3aa2302889268ae377a03ed68d 100644 (file)
@@ -71,7 +71,7 @@ struct _GloSurface {
 };
 
 extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
-                                    int bpp, int width, int height, void *data);
+                                    int bpp, int width, int height, void *data, int noflip);
 static void glo_test_readback_methods(void);
 
 /* ------------------------------------------------------------------------ */
@@ -371,7 +371,7 @@ void glo_surface_getcontents(GloSurface *surface, int stride, int bpp, void *dat
    // Compatible / fallback method.
    glo_surface_getcontents_readpixels(surface->context->formatFlags,
                                          stride, bpp, surface->width,
-                                         surface->height, data);
+                                         surface->height, data, 0);
 }
 
 //    while(0) {
index 10ceb48dd53ba5f9bf23c737671194b6e5831d4f..610a911f7efe55b64ece6e3c7a18266f07ef6a51 100644 (file)
 #include "gl_mangled.h"
 #endif
 
+enum {
+    SURFACE_WINDOW,
+    SURFACE_PIXMAP,
+    SURFACE_PBUFFER
+};
+
 /* In Windows, you must create a window *before* you can create a pbuffer or
  * get a context. So we create a hidden Window on startup (see glo_init/GloMain).
  *
@@ -98,7 +104,7 @@ PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
 extern const char *glo_glXQueryExtensionsString(void);
 
 extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
-                                    int bpp, int width, int height, void *data);
+                                    int bpp, int width, int height, void *data, int noflip);
 
 /* ------------------------------------------------------------------------ */
 
@@ -946,7 +952,7 @@ void glo_surface_getcontents(GloSurface *surface, int stride, int bpp, void *dat
   // Compatible / fallback method.
   glo_surface_getcontents_readpixels(surface->context->formatFlags,
                                         stride, bpp, surface->width,
-                                        surface->height, data);
+                                        surface->height, data, 0);
 }
 
 /* Return the width and height of the given surface */
@@ -958,35 +964,37 @@ void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
 }
 
 /* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
+void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
 {
-#if 0
     int glFormat, glType;
-    glo_surface_updatecontents(surface);
-    /*XXX: change the fixed target: GL_TEXTURE_2D*/
-    glo_flags_get_readpixel_type(surface->context->formatFlags, &glFormat, &glType);
-    fprintf(stderr, "surface_as_texture:teximage:width=%d,height=%d,glFormat=0x%x,glType=0x%x.\n", surface->width, surface->height, glFormat, glType);
-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, surface->image->data);
-#else
-       if(!Render_texture_support)
-       {
-               //fprintf(stderr, "Render to texture not supported on this machine, just return!\n");
-               return ;
-       }
+    int bpp = 4;
+    int stride = surface->width * bpp;
+    char *data;
+    HGLRC oldCtx;
+    HDC oldDC;
 
-    if (!wglBindTexImageARB)
-    {
-        fprintf (stderr, "wglBindTexImageEXT not supported! Can't emulate glEGLImageTargetTexture2DOES!\n");
+    data = malloc(surface->width * surface->height * bpp);
+    if (!data)
         return;
-    }
 
-    if ( !wglBindTexImageARB(surface->hPBuffer, WGL_FRONT_LEFT_ARB) )
-    {
-        fprintf(stderr, "wglBindTexImageARBr error=%d.\n", glGetError());
-    }
+    /* Read pixels from Speficied context */
+    oldCtx = wglGetCurrentContext();
+    oldDC = wglGetCurrentDC();
+    glo_surface_makecurrent(surface);
+    glo_surface_updatecontents(surface);
+    glo_flags_get_readpixel_type(surface->context->formatFlags, &glFormat, &glType);
+    // Make sure we do not flip pbuffer surfaces on Windows
+    glo_surface_getcontents_readpixels(surface->context->formatFlags,
+                                          stride, bpp *8, surface->width,
+                                          surface->height, data, (surface_type == SURFACE_PBUFFER));
 
-#endif
+    /* Restore previous context for setting texture */
+    wglMakeCurrent(oldDC, oldCtx);
+
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, data);
+    free(data);
 }
+
 void glo_surface_release_texture(GloSurface *surface)
 {
     if(!Render_texture_support)
index 7c043318a768a739df207d44a90fcf2c201fa51d..14123e9724036ed970a6c91665e5d4497b5af92b 100644 (file)
 #include "gl_mangled.h"
 #endif
 
+enum{
+    SURFACE_WINDOW,
+    SURFACE_PIXMAP,
+    SURFACE_PBUFFER,
+};
+
 void *g_malloc(size_t size);
 void *g_realloc(void *ptr, size_t size);
 void g_free(void *ptr);
@@ -77,7 +83,7 @@ struct _GloSurface {
 };
 
 extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
-                                    int bpp, int width, int height, void *data);
+                                    int bpp, int width, int height, void *data, int noflip);
 static void glo_test_readback_methods(void);
 
 /* ------------------------------------------------------------------------ */
@@ -471,7 +477,7 @@ void glo_surface_getcontents(GloSurface *surface, int stride, int bpp, void *dat
     // Compatible / fallback method.
     glo_surface_getcontents_readpixels(surface->context->formatFlags,
                                        stride, bpp, surface->width,
-                                       surface->height, data);
+                                       surface->height, data, 0);
 }
 
 /* Return the width and height of the given surface */
@@ -483,7 +489,7 @@ void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
 }
 
 /* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
+void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
 {
 #if 0
     void (*ptr_func_glXBindTexImageEXT) (Display *dpy, GLXDrawable draw, int buffer, int *attrib_list);
@@ -504,10 +510,12 @@ void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
     glo_surface_updatecontents(surface);
     /*XXX: changet the fixed target: GL_TEXTURE_2D*/
        glo_flags_get_readpixel_type(surface->context->formatFlags, &glFormat, &glType);
-    fprintf(stderr, "surface_as_texture:teximage:width=%d,height=%d, glFormat=0x%x, glType=0x%x.\n", surface->width, surface->height, glFormat, glType);
+/*    fprintf(stderr, "surface_as_texture:teximage:width=%d,height=%d, glFormat=0x%x, glType=0x%x.\n", surface->width, surface->height, glFormat, glType);*/
     /* glTexImage2D use different RGB order than the contexts in the pixmap surface */
 /*    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface->image->data);*/
 
+   if(surface_type == SURFACE_PBUFFER)
+   {
     if ((glFormat == GL_RGBA || glFormat == GL_BGRA) && glType == GL_UNSIGNED_BYTE) {
         GLubyte *b = (GLubyte *)surface->image->data;
         int stride = surface->width * 4;
@@ -524,6 +532,8 @@ void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
         }
         g_free(tmp);
     }
+   }
+
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, surface->image->data);
 #endif
 }
index f2a044501ae76d4ef92dcdab164c3089490c7043..8b78926727cc915e5581202933c3ea7d6e912492 100644 (file)
@@ -2645,73 +2645,71 @@ void rgb24_to_yuv420(const unsigned char *src, unsigned char *dest,
                      uint32_t width, uint32_t height, uint32_t yvu)
 {
     uint32_t x, y;
-    unsigned char *udest, *vdest;
-    uint32_t bytesperline = width * 3;
+    uint32_t halfWidth;
+    uint8_t *yplane, *uplane, *vplane;
+    uint8_t *yline, *uline, *vline;
+    const uint8_t *rgbIndex;
 
-    /* Y */
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++) {
-            RGB2Y(src[2], src[1], src[0], *dest++);
-            src += 3;
-        }
-        src += bytesperline - 3 * width;
-    }
-    src -= height * bytesperline;
+    halfWidth = width >> 1;
+    yplane = dest;
 
-    /* U + V */
     if (yvu) {
-        vdest = dest;
-        udest = dest + width * height / 4;
+        vplane = dest + width * height;
+        uplane = vplane + ((width * height) >> 2);
     } else {
-        udest = dest;
-        vdest = dest + width * height / 4;
+        uplane = dest + width * height;
+        vplane = uplane + ((width * height) >> 2);
     }
 
-    for (y = 0; y < height / 2; y++) {
-        for (x = 0; x < width / 2; x++) {
-            uint32_t avg_src[3];
-
-            avg_src[0] = (src[0] + src[3] + src[bytesperline] +
-                    src[bytesperline + 3]) / 4;
-            avg_src[1] = (src[1] + src[4] + src[bytesperline + 1] +
-                    src[bytesperline + 4]) / 4;
-            avg_src[2] = (src[2] + src[5] + src[bytesperline + 2] +
-                    src[bytesperline + 5]) / 4;
-            RGB2UV(avg_src[2], avg_src[1], avg_src[0], *udest++, *vdest++);
-            src += 6;
+    for (y = 0; y < height; y++) {
+        yline = yplane + (y * width);
+        uline = uplane + ((y >> 1) * halfWidth);
+        vline = vplane + ((y >> 1) * halfWidth);
+
+        rgbIndex = src + (width * (height - 1 - y) * 3);
+        for (x = 0; x < (int)width; x+=2) {
+            RGB2Y(rgbIndex[2], rgbIndex[1], rgbIndex[0], *yline++);
+            rgbIndex += 3;
+            RGB2Y(rgbIndex[2], rgbIndex[1], rgbIndex[0], *yline++);
+            RGB2UV(rgbIndex[2], rgbIndex[1], rgbIndex[0], *uline++, *vline++);
+            rgbIndex += 3;
         }
-        src += 2 * bytesperline - 3 * width;
     }
 }
 
 void rgb24_to_yuyv(unsigned char *src, unsigned char *dest,
                    uint32_t width, uint32_t height)
 {
-    uint32_t i = 0;
-
-    for (i = 0; i < (width * height * 3); i = i + 6) {
-        /* y */
-        *dest++ = CLIP(0.299 * (src[i + 2] - 128) +
-                    0.587 * (src[i + 1] - 128) +
-                    0.114 * (src[i] - 128) + 128);
-        /* u */
-        *dest++ = CLIP(((-0.147 * (src[i + 2] - 128) -
-                    0.289 * (src[i + 1] - 128) +
-                    0.436 * (src[i] - 128) + 128) +
-                    (-0.147 * (src[i + 5] - 128) -
-                    0.289 * (src[i + 4] - 128) +
-                    0.436 * (src[i + 3] - 128) + 128)) / 2);
-        /* y1 */
-        *dest++ = CLIP(0.299 * (src[i + 5] - 128) +
-                    0.587 * (src[i + 4] - 128) +
-                    0.114 * (src[i + 3] - 128) + 128);
-        /* v */
-        *dest++ = CLIP(((0.615 * (src[i + 2] - 128) -
-                    0.515 * (src[i + 1] - 128) -
-                    0.100 * (src[i] - 128) + 128) +
-                    (0.615 * (src[i + 5] - 128) -
-                    0.515 * (src[i + 4] - 128) -
-                    0.100 * (src[i + 3] - 128) + 128)) / 2);
+    uint32_t i, j;
+    uint8_t *ptr;
+
+    for (i = 0; i < height; i++) {
+        ptr = src + (width * (height - 1 - i) * 3);
+        for (j = 0; j < width; j += 2) {
+            /* y */
+            *dest++ = CLIP(0.299 * (ptr[2] - 128) +
+                           0.587 * (ptr[1] - 128) +
+                           0.114 * (ptr[0] - 128) + 128);
+            /* u */
+            *dest++ = CLIP(((-0.147 * (ptr[2] - 128) -
+                           0.289 * (ptr[1] - 128) +
+                           0.436 * (ptr[0] - 128) + 128) +
+                           (-0.147 * (ptr[5] - 128) -
+                           0.289 * (ptr[4] - 128) +
+                           0.436 * (ptr[3] - 128) + 128)) / 2);
+            /* y1 */
+            *dest++ = CLIP(0.299 * (ptr[5] - 128) +
+                           0.587 * (ptr[4] - 128) +
+                           0.114 * (ptr[3] - 128) + 128);
+            /* v */
+            *dest++ = CLIP(((0.615 * (ptr[2] - 128) -
+                           0.515 * (ptr[1] - 128) -
+                           0.100 * (ptr[0] - 128) + 128) +
+                           (0.615 * (ptr[5] - 128) -
+                           0.515 * (ptr[4] - 128) -
+                           0.100 * (ptr[3] - 128) + 128)) / 2);
+            ptr += 6;
+        }
     }
 }
 
index 9c367709352b7fc98aebc8aa4c037da5411392cf..98d017badbf0b0d65458f3f5ac907d6106fdb733 100644 (file)
@@ -58,7 +58,6 @@ void virtio_keyboard_notify(void *opaque)
 {
     VirtIOKeyboard *vkbd = (VirtIOKeyboard *)opaque;
     EmulKbdEvent *kbdevt;
-    int index = 0;
     int written_cnt = 0;
 
     if (!vkbd) {
index cca917d2ba6f7f93b12df8dd47183f097cb8990f..831eac7e76e520afb06f3997bc8b5a373cbb7cfe 100644 (file)
@@ -2044,7 +2044,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
                 /* If this pixmap is linked as texture previously */
                                if (link_drawable(process, client_drawable))
                                        glo_surface_as_texture(process->current_state->context,
-                                                       qsurface->surface);
+                                                       qsurface->surface, qsurface->type);
 
 
                 ret.i = client_drawable;
@@ -2088,7 +2088,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
                 }
             }
             else
-                               glo_surface_as_texture(process->current_state->context, qsurface->surface);
+                               glo_surface_as_texture(process->current_state->context, qsurface->surface, qsurface->type);
 
                        break;
                }
@@ -2104,7 +2104,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
                                add_pixmap_texture_mapping(process->current_state,
                                                process->current_state->bindTexture2D,
                                                client_drawable);
-                               glo_surface_as_texture(process->current_state->context, qsurface->surface);
+                               glo_surface_as_texture(process->current_state->context, qsurface->surface, qsurface->type);
                                ret.i = 1;
                        }
                        else
@@ -2216,8 +2216,8 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
 
                     if ( qsurface )
                     {
-                        glo_surface_as_texture(process->current_state->context, qsurface->surface);
-                        fprintf(stderr, "edwin:bindtexture: drawable=0x%x,qsurface=%p.\n", drawable, qsurface);
+                        glo_surface_as_texture(process->current_state->context, qsurface->surface, qsurface->type);
+                        /*fprintf(stderr, "edwin:bindtexture: drawable=0x%x,qsurface=%p.\n", drawable, qsurface);*/
                     }
                 }
 
index 9bb3f8d4d563f1f06ba8e2b0efe46b0d72a51593..cd9d69efa1a6a8f02d9810adff706767c2c5d5f6 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
  * SeokYeon Hwang <syeon.hwang@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
 
 #include <pthread.h>
 #include <math.h>
+#include <pixman.h>
 #include "console.h"
 #include "maru_sdl.h"
 #include "emul_state.h"
+/*
 #include "SDL_gfx/SDL_rotozoom.h"
 #include "maru_sdl_rotozoom.h"
+*/
 #include "maru_finger.h"
 #include "hw/maru_pm.h"
 #include "hw/maru_brightness.h"
@@ -52,7 +56,8 @@ DisplaySurface* qemu_display_surface = NULL;
 
 static SDL_Surface *surface_screen;
 static SDL_Surface *surface_qemu;
-static SDL_Surface *processing_screen;
+static SDL_Surface *scaled_screen;
+static SDL_Surface *rotated_screen;
 
 static double current_scale_factor = 1.0;
 static double current_screen_degree;
@@ -81,6 +86,102 @@ static int sdl_thread_initialized;
 #define SDL_FLAGS (SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_NOFRAME)
 #define SDL_BPP 32
 
+/* Image processing functions using the pixman library */
+static SDL_Surface *maru_do_pixman_scale(SDL_Surface *rz_src,
+                                         SDL_Surface *rz_dst,
+                                         int angle)
+{
+    pixman_image_t *src = NULL;
+    pixman_image_t *dst = NULL;
+    double sx = 0;
+    double sy = 0;
+    pixman_transform_t matrix;
+    struct pixman_f_transform matrix_f;
+
+    SDL_LockSurface(rz_src);
+    SDL_LockSurface(rz_dst);
+
+    src = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+        rz_src->w, rz_src->h, rz_src->pixels, rz_src->w * 4);
+    dst = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+        rz_dst->w, rz_dst->h, rz_dst->pixels, rz_dst->w * 4);
+
+    sx = (double)rz_src->w / (double)rz_dst->w;
+    sy = (double)rz_src->h / (double)rz_dst->h;
+    pixman_f_transform_init_identity(&matrix_f);
+    pixman_f_transform_scale(&matrix_f, NULL, sx, sy);
+    pixman_transform_from_pixman_f_transform(&matrix, &matrix_f);
+    pixman_image_set_transform(src, &matrix);
+    pixman_image_set_filter(src, PIXMAN_FILTER_BILINEAR, NULL, 0);
+    pixman_image_composite(PIXMAN_OP_SRC, src, NULL, dst,
+                           0, 0, 0, 0, 0, 0,
+                           rz_dst->w, rz_dst->h);
+
+    pixman_image_unref(src);
+    pixman_image_unref(dst);
+
+    SDL_UnlockSurface(rz_src);
+    SDL_UnlockSurface(rz_dst);
+
+    return rz_dst;
+}
+
+static SDL_Surface *maru_do_pixman_rotate(SDL_Surface *rz_src,
+                                          SDL_Surface *rz_dst,
+                                          int angle)
+{
+    pixman_image_t *src = NULL;
+    pixman_image_t *dst = NULL;
+    pixman_transform_t matrix;
+    struct pixman_f_transform matrix_f;
+
+    SDL_LockSurface(rz_src);
+    SDL_LockSurface(rz_dst);
+
+    src = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+        rz_src->w, rz_src->h, rz_src->pixels, rz_src->w * 4);
+    dst = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+        rz_dst->w, rz_dst->h, rz_dst->pixels, rz_dst->w * 4);
+
+    pixman_f_transform_init_identity(&matrix_f);
+    switch(angle) {
+        case 0:
+            pixman_f_transform_rotate(&matrix_f, NULL, 1.0, 0.0);
+            pixman_f_transform_translate(&matrix_f, NULL, 0.0, 0.0);
+            break;
+        case 90:
+            pixman_f_transform_rotate(&matrix_f, NULL, 0.0, 1.0);
+            pixman_f_transform_translate(&matrix_f, NULL, (double)rz_dst->h, 0.0);
+            break;
+        case 180:
+            pixman_f_transform_rotate(&matrix_f, NULL, -1.0, 0.0);
+            pixman_f_transform_translate(&matrix_f, NULL,
+                                         (double)rz_dst->w, (double)rz_dst->h);
+            break;
+        case 270:
+            pixman_f_transform_rotate(&matrix_f, NULL, 0.0, -1.0);
+            pixman_f_transform_translate(&matrix_f, NULL, 0.0, (double)rz_dst->w);
+            break;
+        default:
+            fprintf(stdout, "not supported angle factor (angle=%d)\n", angle);
+            break;
+    }
+    pixman_transform_from_pixman_f_transform(&matrix, &matrix_f);
+    pixman_image_set_transform(src, &matrix);
+    pixman_image_set_filter(src, PIXMAN_FILTER_BILINEAR, NULL, 0);
+    pixman_image_composite(PIXMAN_OP_SRC, src, NULL, dst,
+                           0, 0, 0, 0, 0, 0,
+                           rz_dst->w, rz_dst->h);
+
+    pixman_image_unref(src);
+    pixman_image_unref(dst);
+
+    SDL_UnlockSurface(rz_src);
+    SDL_UnlockSurface(rz_dst);
+
+    return rz_dst;
+}
+
 void qemu_ds_sdl_update(DisplayState *ds, int x, int y, int w, int h)
 {
     /* call sdl update */
@@ -221,14 +322,16 @@ void qemu_ds_sdl_refresh(DisplayState *ds)
 //extern int capability_check_gl;
 static void _sdl_init(void)
 {
-    int w, h, temp;
+    int w, h, rwidth, rheight, temp;
 
     INFO("Set up a video mode with the specified width, height and bits-per-pixel\n");
 
     //get current setting information and calculate screen size
+    rwidth = get_emul_lcd_width();
+    rheight = get_emul_lcd_height();
     current_scale_factor = get_emul_win_scale();
-    w = current_screen_width = get_emul_lcd_width() * current_scale_factor;
-    h = current_screen_height = get_emul_lcd_height() * current_scale_factor;
+    w = current_screen_width = rwidth * current_scale_factor;
+    h = current_screen_height = rheight * current_scale_factor;
 
     short rotaton_type = get_emul_rotation();
     if (rotaton_type == ROTATION_PORTRAIT) {
@@ -238,6 +341,9 @@ static void _sdl_init(void)
         temp = w;
         w = h;
         h = temp;
+        temp = rwidth;
+        rwidth = rheight;
+        rheight = temp;
     } else if (rotaton_type == ROTATION_REVERSE_PORTRAIT) {
         current_screen_degree = 180.0;
     } else if (rotaton_type == ROTATION_REVERSE_LANDSCAPE) {
@@ -245,6 +351,9 @@ static void _sdl_init(void)
         temp = w;
         w = h;
         h = temp;
+        temp = rwidth;
+        rwidth = rheight;
+        rheight = temp;
     }
 
 #if 0
@@ -274,8 +383,14 @@ static void _sdl_init(void)
 #endif
 
     /* create buffer for image processing */
-    SDL_FreeSurface(processing_screen);
-    processing_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, get_emul_sdl_bpp(),
+    SDL_FreeSurface(scaled_screen);
+    scaled_screen = SDL_CreateRGBSurface(SDL_SWSURFACE,
+        w, h, get_emul_sdl_bpp(),
+        surface_qemu->format->Rmask, surface_qemu->format->Gmask,
+        surface_qemu->format->Bmask, surface_qemu->format->Amask);
+    SDL_FreeSurface(rotated_screen);
+    rotated_screen = SDL_CreateRGBSurface(SDL_SWSURFACE,
+        rwidth, rheight, get_emul_sdl_bpp(),
         surface_qemu->format->Rmask, surface_qemu->format->Gmask,
         surface_qemu->format->Bmask, surface_qemu->format->Amask);
 
@@ -365,7 +480,8 @@ static void qemu_update(void)
         sdl_alteration = 0;
         _sdl_init();
     } else if (sdl_alteration == -1) {
-        SDL_FreeSurface(processing_screen);
+        SDL_FreeSurface(scaled_screen);
+        SDL_FreeSurface(rotated_screen);
         SDL_FreeSurface(surface_qemu);
         surface_qemu = NULL;
         SDL_Quit();
@@ -434,40 +550,23 @@ static void qemu_update(void)
         else
         { //sdl surface
 #endif
-            if (current_scale_factor < 0.5)
-            {
-                /* image processing via sdl_gfx for rich interpolating */
-
-                // workaround
-                // set color key 'magenta'
-                surface_qemu->format->colorkey = 0xFF00FF;
-
-                SDL_Surface *temp_surface = NULL;
-
-                temp_surface = rotozoomSurface(
-                    surface_qemu, current_screen_degree, current_scale_factor, 1);
-                SDL_BlitSurface(temp_surface, NULL, surface_screen, NULL);
-
-                SDL_FreeSurface(temp_surface);
-            }
-            else if (current_scale_factor < 1.0)
+            if (current_scale_factor != 1.0)
             {
-                /* image processing with simple algorithm for uniformly interpolation */
-                processing_screen = maru_rotozoom(
-                    surface_qemu, processing_screen,
-                    (int)current_screen_degree, TRUE);
-
-                SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
+                rotated_screen = maru_do_pixman_rotate(
+                    surface_qemu, rotated_screen,
+                    (int)current_screen_degree);
+                scaled_screen = maru_do_pixman_scale(
+                    rotated_screen, scaled_screen,
+                    (int)current_screen_degree);
+                SDL_BlitSurface(scaled_screen, NULL, surface_screen, NULL);
             }
             else /* current_scale_factor == 1.0 */
             {
                 if (current_screen_degree != 0.0) {
-                    /* image processing */
-                    processing_screen = maru_rotozoom(
-                        surface_qemu, processing_screen,
-                        (int)current_screen_degree, FALSE);
-
-                    SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
+                    rotated_screen = maru_do_pixman_rotate(
+                        surface_qemu, rotated_screen,
+                        (int)current_screen_degree);
+                    SDL_BlitSurface(rotated_screen, NULL, surface_screen, NULL);
                 } else {
                     /* as-is */
                     SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
index d4a61eb7b39b72557d34a059f0946d8bdaf9dd8a..1e6b37744cd5175ce735f8a7ea6981e901b3b34f 100644 (file)
@@ -85,6 +85,8 @@ struct mloop_evpack {
 #define MLOOP_EVTYPE_KBD_ADD    8
 #define MLOOP_EVTYPE_KBD_DEL    9
 #define MLOOP_EVTYPE_RAMDUMP    10
+#define MLOOP_EVTYPE_SDCARD_ATTACH  11
+#define MLOOP_EVTYPE_SDCARD_DETACH  12
 
 
 static struct mloop_evsock mloop = {-1, 0, 0};
@@ -205,6 +207,9 @@ static int mloop_evsock_send(struct mloop_evsock *ev, struct mloop_evpack *p)
 static USBDevice *usbkbd = NULL;
 static USBDevice *usbdisk = NULL;
 static PCIDevice *hostkbd = NULL;
+#ifdef TARGET_I386
+static PCIDevice *virtio_sdcard = NULL;
+#endif
 
 static void mloop_evhandle_usb_add(char *name)
 {
@@ -372,6 +377,71 @@ static void mloop_evhandle_kbd_del(char *name)
         WARN("There is no %s device.\n", name);
     }
 }
+
+static void mloop_evhandle_sdcard_attach(char *name)
+{
+    char opts[PATH_MAX];
+
+    INFO("mloop_evhandle_sdcard_attach\n");
+
+    if (name == NULL) {
+        ERR("Packet data is NULL.\n");
+        return;
+    }
+
+    if (virtio_sdcard) {
+        ERR("sdcard is already attached.\n");
+        return;
+    }
+
+    QDict *qdict = qdict_new();
+
+    qdict_put(qdict, "pci_addr", qstring_from_str("auto"));
+    qdict_put(qdict, "type", qstring_from_str("storage"));
+    snprintf(opts, sizeof(opts), "file=%s,if=virtio", name);
+    qdict_put(qdict, "opts", qstring_from_str(opts));
+
+    virtio_sdcard = pci_device_hot_add(cur_mon, qdict);
+
+    INFO("hot add virtio storage device with [%s]\n", opts);
+    INFO("virtio-sdcard device: domain %d, bus %d, slot %d, function %d\n",
+            pci_find_domain(virtio_sdcard->bus), pci_bus_num(virtio_sdcard->bus),
+            PCI_SLOT(virtio_sdcard->devfn), PCI_FUNC(virtio_sdcard->devfn));
+
+    QDECREF(qdict);
+}
+
+static void mloop_evhandle_sdcard_detach(char *name)
+{
+    INFO("mloop_evhandle_sdcard_detach\n");
+
+    if (name == NULL) {
+        ERR("packet data is NULL.\n");
+        return;
+    }
+
+    if (!virtio_sdcard) {
+        ERR("sdcard is not attached yet.\n");
+        return;
+    }
+
+    QDict *qdict = qdict_new();
+    int slot = 0;
+    char slotbuf[4] = {0,};
+
+    slot = PCI_SLOT(virtio_sdcard->devfn);
+    snprintf(slotbuf, sizeof(slotbuf), "%x", slot);
+    INFO("virtio-sdcard slot [%d].\n", slot);
+    qdict_put(qdict, "pci_addr", qstring_from_str(slotbuf));
+
+    do_pci_device_hot_remove(cur_mon, qdict);
+
+    virtio_sdcard = NULL;
+
+    INFO("hot remove virtio storage device.\n");
+
+    QDECREF(qdict);
+}
 #endif
 
 
@@ -470,6 +540,14 @@ static void mloop_evcb_recv(struct mloop_evsock *ev)
     case MLOOP_EVTYPE_RAMDUMP:
         mloop_evhandle_ramdump(&pack);
         break;
+#ifdef TARGET_I386
+    case MLOOP_EVTYPE_SDCARD_ATTACH:
+        mloop_evhandle_sdcard_attach(pack.data);
+        break;
+    case MLOOP_EVTYPE_SDCARD_DETACH:
+        mloop_evhandle_sdcard_detach(pack.data);
+        break;
+#endif
     default:
         break;
     }
@@ -550,6 +628,28 @@ void mloop_evcmd_usbdisk(char *img)
     mloop_evsock_send(&mloop, &pack);
 }
 
+void mloop_evcmd_sdcard(char *img)
+{
+    struct mloop_evpack pack;
+
+    if (img) {
+        if (strlen(img) > PACKET_LEN-5) {
+            // Need log
+            ERR("The length of disk image path is greater than "
+                "lenth of maximum packet.\n");
+            return;
+        }
+
+        pack.type = MLOOP_EVTYPE_SDCARD_ATTACH;
+        pack.size = 5 + sprintf(pack.data, "%s", img);
+    } else {
+        pack.type = MLOOP_EVTYPE_SDCARD_DETACH;
+        pack.size = 5;
+    }
+
+    mloop_evsock_send(&mloop, &pack);
+}
+
 int mloop_evcmd_get_usbkbd_status(void)
 {
     return (usbkbd && usbkbd->attached ? 1 : 0);
index ddfbc25ec3c8c699f9d4a25d829098a55ad864ea..1023f029852fefa697d87a9aa3f449f0ce146b42 100644 (file)
@@ -56,6 +56,8 @@ void mloop_evcmd_touch(void);
 void mloop_evcmd_keyboard(void *data);
 void mloop_evcmd_ramdump(void);
 
+void mloop_evcmd_sdcard(char* img);
+
 #ifdef __cplusplus
 }
 #endif
index 3298b5575388cc41abcb12210b62e335f3b717f7..9caad84fff505f568c25ece861ffd72afcae7f64 100644 (file)
@@ -52,6 +52,7 @@
 
 MULTI_DEBUG_CHANNEL(qemu, osutil);
 
+extern char tizen_target_img_path[];
 extern int tizen_base_port;
 CFDictionaryRef proxySettings;
 
@@ -84,7 +85,51 @@ void check_vm_lock_os(void)
 
 void make_vm_lock_os(void)
 {
-    /* TODO: */
+    int shmid;
+    char *shared_memory;
+
+    shmid = shmget((key_t)SHMKEY, MAXLEN, 0666|IPC_CREAT);
+    if (shmid == -1) {
+        ERR("shmget failed\n");
+        perror("osutil-darwin: ");
+        return;
+    }
+
+    shared_memory = shmat(shmid, (char *)0x00, 0);
+    if (shared_memory == (void *)-1) {
+        ERR("shmat failed\n");
+        perror("osutil-darwin: ");
+        return;
+    }
+    sprintf(shared_memory, "%d", tizen_base_port + 2);
+    INFO("shared memory key: %d, value: %s\n", SHMKEY, (char *)shared_memory);
+    
+    if (shmdt(shared_memory) == -1) {
+        ERR("shmdt failed\n");
+        perror("osutil-darwin: ");
+    }
+
+    shmid = shmget((key_t)tizen_base_port, MAXLEN, 0666|IPC_CREAT);
+    if (shmid == -1) {
+        ERR("shmget failed\n");
+        perror("osutil-darwin: ");
+        return;
+    }
+
+    shared_memory = shmat(shmid, (char *)0x00, 0);
+    if (shared_memory == (void *)-1) {
+        ERR("shmat failed\n");
+        perror("osutil-darwin: ");
+        return;
+    }
+    sprintf(shared_memory, "%s", tizen_target_img_path);
+    INFO("shared memory key: %d, value: %s\n", tizen_base_port, (char *)shared_memory);
+    
+    if (shmdt(shared_memory) == -1) {
+        ERR("shmdt failed\n");
+        perror("osutil-darwin: ");
+    }
+
 }
 
 void set_bin_path_os(gchar * exec_argv)
index 94506dc96c4576ae9c639eff14828ddd59dcc3bb..2de466a603c3fd2cc269a52ad852f4db5ff42bac 100644 (file)
@@ -1,3 +1,3 @@
-skin.name=Phone 320x480
+skin.name=Phone 1btn 320x480
 resolution.width=320
 resolution.height=480
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default.dbi b/tizen/src/skin/client/skins/emul-480x800-3btn/default.dbi
new file mode 100644 (file)
index 0000000..0a9dfee
--- /dev/null
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorUI xmlns="http://www.tizen.org/emulator/skin/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <dbi version="2.0"/>
+    <rotations>
+        <rotation name="Portrait">
+            <lcd id="0">
+                <region left="35" top="86" width="480" height="800"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_0.png</mainImage>
+                <keyPressedImage>default_0_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="118" top="887" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region height="74" left="238" top="887" width="74"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="360" top="887" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region height="74" left="541" top="819" width="20"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region height="74" left="541" top="81" width="20"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region height="74" left="541" top="167" width="20"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Landscape">
+            <lcd id="0">
+                <region height="480" left="86" top="46" width="800"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_L90.png</mainImage>
+                <keyPressedImage>default_L90_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="887" top="369" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region height="74" left="887" top="249" width="74"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="887" top="127" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region height="20" left="818" top="2" width="74"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="80" top="2" width="74" height="20"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="165" top="2" width="74" height="20"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Reverse Portrait">
+            <lcd id="0">
+                <region left="46" top="89" width="480" height="800"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_180.png</mainImage>
+                <keyPressedImage>default_180_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="368" top="14" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="249" top="14" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="126" top="14" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="2" top="84" width="20" height="74"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="2" top="821" width="20" height="74"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="2" top="735" width="20" height="74"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Reverse Landscape">
+            <lcd id="0">
+                <region left="90" top="35" width="800" height="480"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_R90.png</mainImage>
+                <keyPressedImage>default_R90_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="15" top="118" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="15" top="239" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="15" top="360" width="74" height="74"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="84" top="539" width="74" height="20"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="822" top="539" width="74" height="20"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="735" top="539" width="74" height="20"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+    </rotations>
+    <colors>
+        <hoverColor B="255" G="255" R="255" />
+    </colors>
+</EmulatorUI>
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_0.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_0.png
new file mode 100644 (file)
index 0000000..c440bfb
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_0.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_0_p.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_0_p.png
new file mode 100644 (file)
index 0000000..2bc3a6c
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_0_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_180.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_180.png
new file mode 100644 (file)
index 0000000..d4ab274
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_180.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_180_p.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_180_p.png
new file mode 100644 (file)
index 0000000..49752fc
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_180_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_L90.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_L90.png
new file mode 100644 (file)
index 0000000..7826dda
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_L90.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_L90_p.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_L90_p.png
new file mode 100644 (file)
index 0000000..a1125bc
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_L90_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_R90.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_R90.png
new file mode 100644 (file)
index 0000000..eb989a1
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_R90.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/default_R90_p.png b/tizen/src/skin/client/skins/emul-480x800-3btn/default_R90_p.png
new file mode 100644 (file)
index 0000000..a4b0da9
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-480x800-3btn/default_R90_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-480x800-3btn/info.ini b/tizen/src/skin/client/skins/emul-480x800-3btn/info.ini
new file mode 100644 (file)
index 0000000..cc898a8
--- /dev/null
@@ -0,0 +1,4 @@
+skin.name=Phone 480x800
+resolution.width=480
+resolution.height=800
+manager.priority=3
diff --git a/tizen/src/skin/client/skins/emul-480x800/info.ini b/tizen/src/skin/client/skins/emul-480x800/info.ini
deleted file mode 100644 (file)
index 55f357b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-skin.name=Phone 480x800
-resolution.width=480
-resolution.height=800
diff --git a/tizen/src/skin/client/skins/emul-480x800/info.ini.bak b/tizen/src/skin/client/skins/emul-480x800/info.ini.bak
new file mode 100644 (file)
index 0000000..b6a4af0
--- /dev/null
@@ -0,0 +1,4 @@
+skin.name=Phone 1btn 480x800
+resolution.width=480
+resolution.height=800
+manager.priority=2
index fb341783ab0e3048fcf0ec2244b5df7f7505973b..ca034ddfff2ef0d302a95b037bf835a3c81cf88d 100644 (file)
@@ -1,3 +1,3 @@
-skin.name=Phone 600x1024
+skin.name=Phone 1btn 600x1024
 resolution.width=600
 resolution.height=1024
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default.dbi b/tizen/src/skin/client/skins/emul-720x1280-3btn/default.dbi
new file mode 100644 (file)
index 0000000..0305f52
--- /dev/null
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorUI xmlns="http://www.tizen.org/emulator/skin/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <dbi version="2.0"/>
+    <rotations>
+        <rotation name="Portrait">
+            <lcd id="0">
+                <region left="67" top="116" width="720" height="1280"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_0.png</mainImage>
+                <keyPressedImage>default_0_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="210" top="1401" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="390" top="1401" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="570" top="1401" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="841" top="1309" width="24" height="96"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="841" top="108" width="24" height="96"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="841" top="219" width="24" height="96"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Landscape">
+            <lcd id="0">
+                <region left="116" top="78" width="1280" height="720"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_L90.png</mainImage>
+                <keyPressedImage>default_L90_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="1400" top="570" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="1400" top="392" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="1400" top="210" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="1308" top="2" width="96" height="24"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="108" top="2" width="96" height="24"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="217" top="2" width="96" height="24"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Reverse Portrait">
+            <lcd id="0">
+                <region left="78" top="117" width="720" height="1280"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_180.png</mainImage>
+                <keyPressedImage>default_180_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="570" top="30" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="390" top="30" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="210" top="30" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="2" top="110" width="24" height="96"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="2" top="1310" width="24" height="96"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="2" top="1200" width="24" height="96"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Reverse Landscape">
+            <lcd id="0">
+                <region left="117" top="67" width="1280" height="720"/>
+            </lcd>
+            <imageList>
+                <mainImage>default_R90.png</mainImage>
+                <keyPressedImage>default_R90_p.png</keyPressedImage>
+            </imageList>
+            <keyMapList>
+                <keyMap>
+                    <region left="28" top="209" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="28" top="391" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="28" top="568" width="84" height="84"/>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="109" top="841" width="96" height="24"/>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="1309" top="841" width="96" height="24"/>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <region left="1199" top="841" width="96" height="24"/>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+    </rotations>
+    <colors>
+        <hoverColor B="255" G="255" R="255" />
+    </colors>
+</EmulatorUI>
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_0.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_0.png
new file mode 100644 (file)
index 0000000..04e01d6
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_0.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_0_p.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_0_p.png
new file mode 100644 (file)
index 0000000..4049ae2
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_0_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_180.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_180.png
new file mode 100644 (file)
index 0000000..750d056
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_180.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_180_p.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_180_p.png
new file mode 100644 (file)
index 0000000..c3fefa6
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_180_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90.png
new file mode 100644 (file)
index 0000000..6d0724c
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90_p.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90_p.png
new file mode 100644 (file)
index 0000000..babe9d4
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_L90_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90.png
new file mode 100644 (file)
index 0000000..462c544
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90_p.png b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90_p.png
new file mode 100644 (file)
index 0000000..2d54428
Binary files /dev/null and b/tizen/src/skin/client/skins/emul-720x1280-3btn/default_R90_p.png differ
diff --git a/tizen/src/skin/client/skins/emul-720x1280-3btn/info.ini b/tizen/src/skin/client/skins/emul-720x1280-3btn/info.ini
new file mode 100644 (file)
index 0000000..656e11a
--- /dev/null
@@ -0,0 +1,4 @@
+skin.name=Phone 720x1280
+resolution.width=720
+resolution.height=1280
+manager.priority=2
diff --git a/tizen/src/skin/client/skins/emul-720x1280/info.ini b/tizen/src/skin/client/skins/emul-720x1280/info.ini
deleted file mode 100644 (file)
index e40f446..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-skin.name=Phone 720x1280
-resolution.width=720
-resolution.height=1280
diff --git a/tizen/src/skin/client/skins/emul-720x1280/info.ini.bak b/tizen/src/skin/client/skins/emul-720x1280/info.ini.bak
new file mode 100644 (file)
index 0000000..16a00ef
--- /dev/null
@@ -0,0 +1,4 @@
+skin.name=Phone 1btn 720x1280
+resolution.width=720
+resolution.height=1280
+manager.priority=2
diff --git a/tizen/src/skin/client/skins/emul-general-3btn/default.dbi b/tizen/src/skin/client/skins/emul-general-3btn/default.dbi
new file mode 100644 (file)
index 0000000..d1a68bc
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorUI xmlns="http://www.tizen.org/emulator/skin/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <dbi version="2.0"/>
+    <rotations>
+        <rotation name="Portrait">
+            <lcd id="0">
+            </lcd>
+            <keyMapList>
+                <keyMap>
+                    <eventInfo>
+                        <keyCode>169</keyCode>
+                        <keyName>Menu</keyName>
+                    </eventInfo>
+                    <tooltip>Menu</tooltip>
+                </keyMap>
+                <keyMap>
+                    <eventInfo>
+                        <keyCode>139</keyCode>
+                        <keyName>Home</keyName>
+                    </eventInfo>
+                    <tooltip>Home</tooltip>
+                </keyMap>
+                <keyMap>
+                    <eventInfo>
+                        <keyCode>158</keyCode>
+                        <keyName>Back</keyName>
+                    </eventInfo>
+                    <tooltip>Back</tooltip>
+                </keyMap>
+                <keyMap>
+                    <eventInfo>
+                        <keyCode>116</keyCode>
+                        <keyName>Power</keyName>
+                    </eventInfo>
+                    <tooltip>Power</tooltip>
+                </keyMap>
+                <keyMap>
+                    <eventInfo>
+                        <keyCode>115</keyCode>
+                        <keyName>Volume +</keyName>
+                    </eventInfo>
+                    <tooltip>Volume +</tooltip>
+                </keyMap>
+                <keyMap>
+                    <eventInfo>
+                        <keyCode>114</keyCode>
+                        <keyName>Volume -</keyName>
+                    </eventInfo>
+                    <tooltip>Volume -</tooltip>
+                </keyMap>
+            </keyMapList>
+        </rotation>
+        <rotation name="Landscape">
+            <lcd id="0">
+            </lcd>
+        </rotation>
+        <rotation name="Reverse Portrait">
+            <lcd id="0">
+            </lcd>
+        </rotation>
+        <rotation name="Reverse Landscape">
+            <lcd id="0">
+            </lcd>
+        </rotation>
+    </rotations>
+    <colors>
+        <hoverColor B="255" G="255" R="255" />
+    </colors>
+</EmulatorUI>
diff --git a/tizen/src/skin/client/skins/emul-general-3btn/info.ini b/tizen/src/skin/client/skins/emul-general-3btn/info.ini
new file mode 100644 (file)
index 0000000..b3d4100
--- /dev/null
@@ -0,0 +1,4 @@
+skin.name=General purpose
+resolution.width=all
+resolution.height=all
+manager.priority=1
diff --git a/tizen/src/skin/client/skins/emul-general/info.ini b/tizen/src/skin/client/skins/emul-general/info.ini
deleted file mode 100644 (file)
index dfe953a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-skin.name=General purpose
-resolution.width=all
-resolution.height=all
diff --git a/tizen/src/skin/client/skins/emul-general/info.ini.bak b/tizen/src/skin/client/skins/emul-general/info.ini.bak
new file mode 100644 (file)
index 0000000..1823020
--- /dev/null
@@ -0,0 +1,4 @@
+skin.name=General purpose 1btn
+resolution.width=all
+resolution.height=all
+manager.priority=0
index 8dc4e3924ae359179c910fc4832b469218549f63..a9e802c1c5542b0f930630b0106324f55ef64370 100644 (file)
@@ -57,6 +57,7 @@ import org.eclipse.swt.events.ShellListener;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Menu;
@@ -421,16 +422,6 @@ public class EmulatorSkin {
                                                        screenShotDialog = null;
                                                }
 
-                                               /* close the Key Window */
-                                               if (skinInfo.isPhoneShape() == false) {
-                                                       closeKeyWindow();
-                                               }
-
-                                               /* dispose the color */
-                                               if (colorVM != null) {
-                                                       colorVM.dispose();
-                                               }
-
                                                /* save config only for emulator close */
                                                config.setSkinProperty(
                                                                SkinPropertiesConstants.WINDOW_X, shell.getLocation().x);
@@ -442,7 +433,25 @@ public class EmulatorSkin {
                                                                SkinPropertiesConstants.WINDOW_ROTATION, currentState.getCurrentRotationId());
                                                config.setSkinProperty(
                                                                SkinPropertiesConstants.WINDOW_ONTOP, Boolean.toString(isOnTop));
+
+                                               int dockValue = 0;
+                                               if (keyWindow != null && keyWindow.getShell().isVisible()) {
+                                                       dockValue = keyWindow.getDockPosition();
+                                               }
+                                               config.setSkinProperty(
+                                                               SkinPropertiesConstants.KEYWINDOW_POSITION, dockValue);
+
                                                config.saveSkinProperties();
+
+                                               /* close the Key Window */
+                                               if (skinInfo.isPhoneShape() == false) {
+                                                       closeKeyWindow();
+                                               }
+
+                                               /* dispose the color */
+                                               if (colorVM != null) {
+                                                       colorVM.dispose();
+                                               }
                                        }
 
                                        if (currentState.getCurrentImage() != null) {
@@ -1418,6 +1427,13 @@ public class EmulatorSkin {
 //                                                     shell.setLocation(location);
 //                                                     SkinUtil.setTopMost(shell, isOnTop);
 //                                             }
+
+                                               /* location correction */
+                                               Rectangle monitorBounds = Display.getDefault().getBounds();
+                                               Rectangle emulatorBounds = shell.getBounds();
+                                               shell.setLocation(
+                                                               Math.max(emulatorBounds.x, monitorBounds.x),
+                                                               Math.max(emulatorBounds.y, monitorBounds.y));
                                        }
                                });
 
@@ -1440,28 +1456,27 @@ public class EmulatorSkin {
 
                final List<MenuItem> scaleList = new ArrayList<MenuItem>();
 
-               final MenuItem scaleOneItem = new MenuItem( menu, SWT.RADIO );
-               scaleOneItem.setText( "1x" );
-               scaleOneItem.setData( Scale.SCALE_100 );
-               scaleList.add( scaleOneItem );
+               final MenuItem scaleOneItem = new MenuItem(menu, SWT.RADIO);
+               scaleOneItem.setText("1x");
+               scaleOneItem.setData(Scale.SCALE_100);
+               scaleList.add(scaleOneItem);
 
-               final MenuItem scaleThreeQtrItem = new MenuItem( menu, SWT.RADIO );
-               scaleThreeQtrItem.setText( "3/4x" );
-               scaleThreeQtrItem.setData( Scale.SCALE_75 );
+               final MenuItem scaleThreeQtrItem = new MenuItem(menu, SWT.RADIO);
+               scaleThreeQtrItem.setText("3/4x");
+               scaleThreeQtrItem.setData(Scale.SCALE_75);
                scaleList.add( scaleThreeQtrItem );
 
-               final MenuItem scalehalfItem = new MenuItem( menu, SWT.RADIO );
-               scalehalfItem.setText( "1/2x" );
-               scalehalfItem.setData( Scale.SCALE_50 );
-               scaleList.add( scalehalfItem );
+               final MenuItem scalehalfItem = new MenuItem(menu, SWT.RADIO);
+               scalehalfItem.setText("1/2x");
+               scalehalfItem.setData(Scale.SCALE_50);
+               scaleList.add(scalehalfItem);
 
-               final MenuItem scaleOneQtrItem = new MenuItem( menu, SWT.RADIO );
-               scaleOneQtrItem.setText( "1/4x" );
-               scaleOneQtrItem.setData( Scale.SCALE_25 );
-               scaleList.add( scaleOneQtrItem );
+               final MenuItem scaleOneQtrItem = new MenuItem(menu, SWT.RADIO);
+               scaleOneQtrItem.setText("1/4x");
+               scaleOneQtrItem.setData(Scale.SCALE_25);
+               scaleList.add(scaleOneQtrItem);
 
                SelectionAdapter selectionAdapter = new SelectionAdapter() {
-
                        @Override
                        public void widgetSelected(SelectionEvent e) {
 
@@ -1492,6 +1507,13 @@ public class EmulatorSkin {
 //                                                     shell.setLocation(location);
 //                                                     SkinUtil.setTopMost(shell, isOnTop);
 //                                             }
+
+                                               /* location correction */
+                                               Rectangle monitorBounds = Display.getDefault().getBounds();
+                                               Rectangle emulatorBounds = shell.getBounds();
+                                               shell.setLocation(
+                                                               Math.max(emulatorBounds.x, monitorBounds.x),
+                                                               Math.max(emulatorBounds.y, monitorBounds.y));
                                        }
                                });
 
index 3048bd42996ea6c72dad7987fe00294e58ed09d4..8bcd8ab3b8858c2c3a5a4a3184dec034afb2fde7 100644 (file)
@@ -89,7 +89,8 @@ public class EmulatorConfig {
                public static final String WINDOW_Y = "window.y";
                public static final String WINDOW_ROTATION = "window.rotate";
                public static final String WINDOW_SCALE = "window.scale";
-               public static final String WINDOW_ONTOP = "window.ontop"; // always on top
+               public static final String WINDOW_ONTOP = "window.ontop"; /* always on top */
+               public static final String KEYWINDOW_POSITION = "window.keywindow.position";
        }
 
        public interface ConfigPropertiesConstants {
index 782e488129d88dc0ada16cda1e8fd132f5217ea7..2b0bc2a93f5fdbd560bc7e3072dbc665c2e2ee05 100644 (file)
@@ -10,7 +10,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or ( at your option ) any later version.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -137,6 +137,7 @@ public class CustomButton extends Canvas {
 
                                if (e.x < 0 || e.y < 0 ||
                                                e.x > getBounds().width || e.y > getBounds().height) {
+                                       /* dragging out */
                                        mouse = 0;
                                }
 
@@ -243,4 +244,4 @@ public class CustomButton extends Canvas {
                return new Point(imageButton[0].getImageData().width,
                                imageButton[0].getImageData().height);
        }
-}
\ No newline at end of file
+}
index 876c5618434512c6ca3bd13226da5bea3ee0059c..49e28761392fa141004531d7e03256ba1b3ae5ec 100644 (file)
@@ -10,7 +10,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or ( at your option ) any later version.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -33,20 +33,46 @@ import java.util.TimerTask;
 import java.util.logging.Logger;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DragDetectEvent;
+import org.eclipse.swt.events.DragDetectListener;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.MouseWheelListener;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.RowData;
 import org.eclipse.swt.layout.RowLayout;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
 import org.tizen.emulator.skin.log.SkinLogger;
 
 
+class CustomScrollBarThumbData {
+       public boolean isGrabbed;
+       public int yGrabPosition;
+       public int yGrabSelection;
+
+       public Rectangle boundsThumb;
+
+       CustomScrollBarThumbData() {
+               boundsThumb = new Rectangle(0, 0, 0, 0);
+       }
+}
+
+class CustomScrollBarShaftData {
+       public int widthShaft;
+       public int heightShaft;
+}
+
 public class CustomScrollBar {
-       static final int SCROLL_SHIFT_LENGTH = 10;
+       static final int SCROLL_INCREMENT_AMOUNT = 10;
+       static final int SCROLL_PAGE_INCREMENT_AMOUNT = 144;
 
        private Logger logger = SkinLogger.getSkinLogger(
                        CustomScrollBar.class).getLogger();
@@ -56,7 +82,8 @@ public class CustomScrollBar {
        CustomScrolledComposite compositeScroll;
 
        private int heightScrollBar;
-       private int maxShift;
+       private int amountIncrement;
+       private int amountPageIncrement;
 
        private Image[] imagesArrowUp;
        private Image[] imagesArrowDown;
@@ -66,12 +93,39 @@ public class CustomScrollBar {
        private CustomButton buttonArrowUp;
        private CustomButton buttonArrowDown;
        private Canvas canvasShaft;
-       private CustomButton buttonThumb;
+       private CustomScrollBarThumbData dataThumb;
+       private CustomScrollBarShaftData dataShaft;
 
        private int valueSelection;
        private Timer timerScroller;
-       private TimerTask scroller;
 
+       class ScrollerTask extends TimerTask {
+               static final int SCROLLER_PERIOD_TIME = 60;
+
+               private boolean isScrollDown;
+
+               ScrollerTask(boolean isDown) {
+                       this.isScrollDown = isDown;
+               }
+
+               @Override
+               public void run() {
+                       Display.getDefault().asyncExec(new Runnable() {
+                               @Override
+                               public void run() {
+                                       if (isScrollDown == true) {
+                                               scrollDown(amountIncrement * 2);
+                                       } else {
+                                               scrollUp(amountIncrement * 2);
+                                       }
+                               }
+                       });
+               }
+       }
+
+       /**
+        *  Constructor
+        */
        CustomScrollBar(Composite parent, int style, int heightScrollBar,
                        Image[] imagesArrowUp, Image[] imagesArrowDown,
                        Image imageThumb, Image imageShaft) {
@@ -88,15 +142,18 @@ public class CustomScrollBar {
                composite.setLayout(rowLayout);
 
                this.heightScrollBar = heightScrollBar;
-               this.maxShift = SCROLL_SHIFT_LENGTH;
+               this.amountIncrement = SCROLL_INCREMENT_AMOUNT;
+               this.amountPageIncrement = SCROLL_PAGE_INCREMENT_AMOUNT;
 
                this.imagesArrowUp = imagesArrowUp;
                this.imagesArrowDown = imagesArrowDown;
                this.imageThumb = imageThumb;
                this.imageShaft = imageShaft;
 
-               //this.timerScroller = new Timer();
+               this.dataThumb = new CustomScrollBarThumbData();
+               this.dataShaft = new CustomScrollBarShaftData();
 
+               this.timerScroller = new Timer();
                createContents();
 
                addScrollBarListener();
@@ -116,9 +173,10 @@ public class CustomScrollBar {
                /* shaft */
                canvasShaft = new Canvas(composite, SWT.NONE);
 
-               final int widthShaft = width;
-               final int heightShaft = heightScrollBar - (height * 2);
-               canvasShaft.setLayoutData(new RowData(widthShaft, heightShaft));
+               dataShaft.widthShaft = width;
+               dataShaft.heightShaft = heightScrollBar - (height * 2);
+               canvasShaft.setLayoutData(new RowData(
+                               dataShaft.widthShaft, dataShaft.heightShaft));
 
                canvasShaft.addPaintListener(new PaintListener() {
                        @Override
@@ -127,7 +185,27 @@ public class CustomScrollBar {
                                        e.gc.drawImage(imageShaft, 0, 0,
                                                        imageShaft.getImageData().width,
                                                        imageShaft.getImageData().height,
-                                                       0, 0, widthShaft, heightShaft);
+                                                       0, 0, dataShaft.widthShaft, dataShaft.heightShaft);
+
+                                       /* draw a thumb */
+                                       int heightScrollGap = compositeScroll.getMinHeight() - heightScrollBar;
+
+                                       float tempHeightThumb = (compositeScroll.getMinHeight() - heightScrollGap) *
+                                                       dataShaft.heightShaft / compositeScroll.getMinHeight();
+                                       dataThumb.boundsThumb.height = Math.max(1, (int)tempHeightThumb);
+
+                                       dataThumb.boundsThumb.x = 2;
+                                       dataThumb.boundsThumb.y = getSelection() *
+                                                       (dataShaft.heightShaft - dataThumb.boundsThumb.height) /
+                                                       heightScrollGap;
+                                       dataThumb.boundsThumb.width = dataShaft.widthShaft -
+                                                       (dataThumb.boundsThumb.x * 2);
+
+                                       e.gc.drawImage(imageThumb, 0, 0,
+                                                       imageThumb.getImageData().width,
+                                                       imageThumb.getImageData().height,
+                                                       dataThumb.boundsThumb.x, dataThumb.boundsThumb.y,
+                                                       dataThumb.boundsThumb.width, dataThumb.boundsThumb.height);
                                }
                        }
                });
@@ -140,39 +218,42 @@ public class CustomScrollBar {
                buttonArrowDown.setLayoutData(new RowData(width, height));
        }
 
-       class ScrollerTask extends TimerTask {
-               @Override
-               public void run() {
-                       int vSelection = getSelection();
-                       if (vSelection <= (173 - heightScrollBar - 1)) {
-                               setSelection(getSelection() + 1);
-                               logger.info("" + getSelection());
-
-//                             Display.getCurrent().asyncExec(new Runnable() {
-//                                     @Override
-//                                     public void run() {
-                               //compositeScroll.vScroll();
-//                                     }
-//                             });
-                       }
+       private void updateScrollbar() {
+               compositeScroll.vScroll();
+               canvasShaft.redraw();
+       }
+
+       private void scrollUp(int amount) {
+               if (amount == 0) {
+                       return;
                }
+
+               setSelection(getSelection() - amount);
+               updateScrollbar();
+       }
+
+       private void scrollDown(int amount) {
+               if (amount == 0) {
+                       return;
+               }
+
+               setSelection(getSelection() + amount);
+               updateScrollbar();
        }
 
        protected void addScrollBarListener() {
                buttonArrowUp.addMouseListener(new MouseListener() {
                        @Override
                        public void mouseDown(MouseEvent e) {
-                               int shift = getSelection();
-
-                               if (shift > 0) {
-                                       setSelection(getSelection() - Math.min(maxShift, shift));
-                                       ((CustomScrolledComposite) parent.getParent()).vScroll();
-                               }
+                               scrollUp(amountIncrement);
                        }
 
                        @Override
                        public void mouseUp(MouseEvent e) {
-                               /* do nothing */
+                               if (timerScroller != null) {
+                                       timerScroller.cancel();
+                                       timerScroller = new Timer();
+                               }
                        }
 
                        @Override
@@ -181,39 +262,110 @@ public class CustomScrollBar {
                        }
                });
 
+               buttonArrowUp.addDragDetectListener(new DragDetectListener() {
+                       @Override
+                       public void dragDetected(DragDetectEvent e) {
+                               logger.info("ArrowUp dragDetected : " + e.button);
+
+                               if (timerScroller != null) {
+                                       timerScroller.schedule(new ScrollerTask(false),
+                                                       1, ScrollerTask.SCROLLER_PERIOD_TIME);
+                               }
+                       }
+               });
+
                buttonArrowDown.addMouseListener(new MouseListener() {
                        @Override
                        public void mouseDown(MouseEvent e) {
-                               int minHeightContents =
-                                               ((CustomScrolledComposite) parent.getParent()).getMinHeight();
+                               scrollDown(amountIncrement);
+                       }
 
-                               int shift = (minHeightContents - heightScrollBar) - getSelection();
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               if (timerScroller != null) {
+                                       timerScroller.cancel();
+                                       timerScroller = new Timer();
+                               }
+                       }
 
-                               if (shift > 0) {
-                                       setSelection(getSelection() + Math.min(maxShift, shift));
-                                       ((CustomScrolledComposite) parent.getParent()).vScroll();
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               /* do nothing */
+                       }
+               });
+
+               buttonArrowDown.addDragDetectListener(new DragDetectListener() {
+                       @Override
+                       public void dragDetected(DragDetectEvent e) {
+                               logger.info("ArrowDown dragDetected : " + e.button);
+
+                               if (timerScroller != null) {
+                                       timerScroller.schedule(new ScrollerTask(true),
+                                                       1, ScrollerTask.SCROLLER_PERIOD_TIME);
                                }
                        }
+               });
 
+               compositeScroll.addMouseWheelListener(new MouseWheelListener() {
                        @Override
-                       public void mouseUp(MouseEvent e) {
-                               timerScroller.cancel();
-                               timerScroller = new Timer();
+                       public void mouseScrolled(MouseEvent e) {
+                               if (e.count > 0) {
+                                       scrollUp(amountIncrement);
+                               } else {
+                                       scrollDown(amountIncrement);
+                               }
+                       }
+               });
+
+               canvasShaft.addMouseMoveListener(new MouseMoveListener() {
+                       @Override
+                       public void mouseMove(MouseEvent e) {
+                               if (dataThumb.isGrabbed == true) {
+                                       int yDragged = e.y - dataThumb.yGrabPosition;
+
+                                       float yDraggedScale = yDragged *
+                                                       (compositeScroll.getMinHeight() - heightScrollBar) /
+                                                       (dataShaft.heightShaft - dataThumb.boundsThumb.height);
+
+                                       setSelection(dataThumb.yGrabSelection + (int)yDraggedScale);
+                                       updateScrollbar();
+                               }
                        }
+               });
 
+               canvasShaft.addMouseListener(new MouseListener() {
                        @Override
                        public void mouseDoubleClick(MouseEvent e) {
                                /* do nothing */
                        }
-               });
 
-//             buttonArrowDown.addDragDetectListener(new DragDetectListener() {
-//                     @Override
-//                     public void dragDetected( DragDetectEvent e ) {
-//                                     logger.info( "dragDetected:" + e.button );
-//                                     timerScroller.schedule(new ScrollerTask(), 1, 100);
-//                     }
-//             });
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               Rectangle rectThumb = new Rectangle(
+                                               0, dataThumb.boundsThumb.y,
+                                               dataThumb.boundsThumb.width + 2, dataThumb.boundsThumb.height);
+
+                               if (rectThumb.contains(e.x, e.y) == true) {
+                                       dataThumb.isGrabbed = true;
+                                       dataThumb.yGrabPosition = e.y;
+                                       dataThumb.yGrabSelection = getSelection();
+                               } else {
+                                       if (e.y < dataThumb.boundsThumb.y) {
+                                               scrollUp(amountPageIncrement);
+                                       } else {
+                                               scrollDown(amountPageIncrement);
+                                       }
+                               }
+                       }
+
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               if (dataThumb.isGrabbed == true) {
+                                       dataThumb.isGrabbed = false;
+                                       dataThumb.yGrabSelection = dataThumb.yGrabPosition = 0;
+                               }
+                       }
+               });
        }
 
        public int getSelection() {
@@ -222,5 +374,12 @@ public class CustomScrollBar {
 
        public void setSelection(int selection) {
                valueSelection = selection;
+
+               if (valueSelection < 0) {
+                       valueSelection = 0;
+               } else {
+                       int maxScroll = compositeScroll.getMinHeight() - heightScrollBar;
+                       valueSelection = Math.min(selection, maxScroll);
+               }
        }
 }
index 0eb30aa8ae0ab82128ca758f1d867a9b1dd6ff4b..dfd84770fd66a78301623620d26b125cacac24f1 100644 (file)
@@ -10,7 +10,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or ( at your option ) any later version.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -130,7 +130,7 @@ public class KeyWindow extends SkinWindow {
                int heightTailPart = SHELL_MARGIN_BOTTOM;
 
                /* make a frame image */
-               this.cntHiddenButton = 0; //keyMapList.size() - BUTTON_DEFAULT_CNT;
+               this.cntHiddenButton = keyMapList.size() - BUTTON_DEFAULT_CNT;
 
                this.imageFrame = frameMaker.getPatchedImage(
                                widthBase + ((cntHiddenButton > 0) ? widthScrollbar : 0),
@@ -425,29 +425,53 @@ public class KeyWindow extends SkinWindow {
                                        Rectangle childBounds = shell.getBounds();
 
                                        int heightOneThird = parentBounds.height / 3;
+                                       int widthDockingArea = 30;
+                                       int widthIntersectRegion = 5;
 
                                        /* right-middle */
-                                       Rectangle attachBounds1 = new Rectangle(
-                                                       (parentBounds.x + parentBounds.width) - 5,
+                                       Rectangle attachBoundsRC = new Rectangle(
+                                                       (parentBounds.x + parentBounds.width) - widthIntersectRegion,
                                                        parentBounds.y + heightOneThird,
-                                                       30, heightOneThird);
+                                                       widthDockingArea, heightOneThird);
                                        /* right-top */
-                                       Rectangle attachBounds2 = new Rectangle(
-                                                       (parentBounds.x + parentBounds.width) - 5,
+                                       Rectangle attachBoundsRT = new Rectangle(
+                                                       (parentBounds.x + parentBounds.width) - widthIntersectRegion,
                                                        parentBounds.y,
-                                                       30, heightOneThird);
+                                                       widthDockingArea, heightOneThird);
                                        /* right-bottom */
-                                       Rectangle attachBounds3 = new Rectangle(
-                                                       (parentBounds.x + parentBounds.width) - 5,
+                                       Rectangle attachBoundsRB = new Rectangle(
+                                                       (parentBounds.x + parentBounds.width) - widthIntersectRegion,
                                                        parentBounds.y + (heightOneThird * 2),
-                                                       30, heightOneThird);
+                                                       widthDockingArea, heightOneThird);
 
-                                       if (childBounds.intersects(attachBounds1) == true) {
+                                       /* left-middle */
+                                       Rectangle attachBoundsLC = new Rectangle(
+                                                       parentBounds.x - (widthDockingArea - widthIntersectRegion),
+                                                       parentBounds.y + heightOneThird,
+                                                       widthDockingArea, heightOneThird);
+                                       /* left-top */
+                                       Rectangle attachBoundsLT = new Rectangle(
+                                                       parentBounds.x - (widthDockingArea - widthIntersectRegion),
+                                                       parentBounds.y,
+                                                       widthDockingArea, heightOneThird);
+                                       /* left-bottom */
+                                       Rectangle attachBoundsLB = new Rectangle(
+                                                       parentBounds.x - (widthDockingArea - widthIntersectRegion),
+                                                       parentBounds.y + (heightOneThird * 2),
+                                                       widthDockingArea, heightOneThird);
+
+                                       if (childBounds.intersects(attachBoundsRC) == true) {
                                                dock(SWT.RIGHT | SWT.CENTER, false, true);
-                                       } else if (childBounds.intersects(attachBounds2) == true) {
+                                       } else if (childBounds.intersects(attachBoundsRT) == true) {
                                                dock(SWT.RIGHT | SWT.TOP, false, true);
-                                       } else if (childBounds.intersects(attachBounds3) == true) {
+                                       } else if (childBounds.intersects(attachBoundsRB) == true) {
                                                dock(SWT.RIGHT | SWT.BOTTOM, false, true);
+                                       } else if (childBounds.intersects(attachBoundsLC) == true) {
+                                               dock(SWT.LEFT | SWT.CENTER, false, true);
+                                       } else if (childBounds.intersects(attachBoundsLT) == true) {
+                                               dock(SWT.LEFT | SWT.TOP, false, true);
+                                       } else if (childBounds.intersects(attachBoundsLB) == true) {
+                                               dock(SWT.LEFT | SWT.BOTTOM, false, true);
                                        } else {
                                                dock(SWT.NONE, false, true);
                                        }
index 19e08746aa4c67581ae49a9090e8a3274e5beef4..77618eda7a967a70cf92fd34952768e3f5b66d79 100644 (file)
@@ -1,7 +1,7 @@
 /**
+ * child window of skin
  *
- *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
@@ -10,7 +10,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or ( at your option ) any later version.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -105,7 +105,19 @@ public class SkinWindow {
                                x += shift;
                                parent.setLocation(parentBounds.x + shift, parentBounds.y);
                        }*/
-               } else { /* SWT.RIGHT | SWT.CENTER */
+               }
+               else if (dockPosition == (SWT.LEFT | SWT.CENTER)) {
+                       x = parentBounds.x - childBounds.width;
+                       y = parentBounds.y + (parentBounds.height / 2) -
+                                       (childBounds.height / 2);
+               } else if (dockPosition == (SWT.LEFT | SWT.TOP)) {
+                       x = parentBounds.x - childBounds.width;
+                       y = parentBounds.y;
+               } else if (dockPosition == (SWT.LEFT | SWT.BOTTOM)) {
+                       x = parentBounds.x - childBounds.width;
+                       y = parentBounds.y + parentBounds.height - childBounds.height;
+               }
+               else { /* SWT.RIGHT | SWT.CENTER */
                        x = parentBounds.x + parentBounds.width;
                        y = parentBounds.y + (parentBounds.height / 2) -
                                        (childBounds.height / 2);
@@ -113,12 +125,20 @@ public class SkinWindow {
 
                /* correction of location */
                if (correction == true) {
+                       /* for right side */
                        int shift = (monitorBounds.x + monitorBounds.width) -
                                        (x + childBounds.width);
                        if (shift < 0) {
                                x += shift;
                                parent.setLocation(parentBounds.x + shift, parentBounds.y);
                        }
+
+                       /* for left side */
+                       shift = monitorBounds.x - x;
+                       if (shift > 0) {
+                               x += shift;
+                               parent.setLocation(parentBounds.x + shift, parentBounds.y);
+                       }
                }
 
                shell.setLocation(x, y);
index d7623f82edf54d40a2e8b8184f3bb0ca827085c6..be9149bcb93b9988f13da1c4ef19ea4e2b4bec94 100644 (file)
@@ -1,7 +1,7 @@
 /**
- * 
+ * image resources management
  *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
@@ -61,7 +61,7 @@ public class ImageRegistry {
                        SkinLogger.getSkinLogger(ImageRegistry.class).getLogger();
 
        public static final String SKINS_FOLDER = "skins";
-       public static final String GENERAL_FOLDER = "emul-general";
+       public static final String GENERAL_FOLDER = "emul-general-3btn";
        public static final String ICON_FOLDER = "icons";
        public static final String IMAGES_FOLDER = "images";
        public static final String KEYWINDOW_FOLDER = "key-window";
index 8a86922dc192123762509b2c7f2fd9fac3222098..dde649279bb710b93c36015bbf0a49341d47d35d 100644 (file)
@@ -203,10 +203,17 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                arrangeSkin(scale, rotationId);
 
                /* open the key window */
+               final int dockValue = config.getSkinPropertyInt(
+                               SkinPropertiesConstants.KEYWINDOW_POSITION, 0);
+
                shell.getDisplay().asyncExec(new Runnable() {
                        @Override
                        public void run() {
-                               skin.openKeyWindow(SWT.RIGHT | SWT.CENTER, false);
+                               if (dockValue == 0 || dockValue == SWT.NONE) {
+                                       skin.openKeyWindow(SWT.RIGHT | SWT.CENTER, false);
+                               } else {
+                                       skin.openKeyWindow(dockValue, false);
+                               }
                        }
                });
        }
@@ -250,8 +257,8 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                }
 
                /* arrange the toggle button of key window */
-               toggleButton.setBounds(displayBounds.x + displayBounds.width,
-                               displayBounds.y + (displayBounds.height / 2) - (toggleButton.getImageSize().y / 2),
+               toggleButton.setBounds(displayBounds.x + displayBounds.width + 4,
+                               displayBounds.y + ((displayBounds.height - toggleButton.getImageSize().y) / 2),
                                toggleButton.getImageSize().x, toggleButton.getImageSize().y);
 
                /* arrange the progress bar */
index 476c063372932d7e34b58dcb5a2d557ce3de04fc..65c6b3dd29c5fd507935c6c7ba27d428e01b2bc6 100644 (file)
@@ -40,7 +40,7 @@
 #include "emulator.h"
 #include "debug_ch.h"
 #include "sdb.h"
-#include "nbd.h"
+#include "qemu_socket.h"
 #include "mloop_event.h"
 #include "emul_state.h"
 #include "maruskin_keymap.h"
@@ -582,10 +582,14 @@ static void* run_timed_shutdown_thread(void* args)
 static void send_to_emuld(const char* request_type,
     int request_size, const char* send_buf, int buf_size)
 {
-    int s = tcp_socket_outgoing( "127.0.0.1", (uint16_t) ( tizen_base_port + SDB_TCP_EMULD_INDEX ) );
+    char addr[128];
+    int s = 0;
+
+    snprintf(addr, 128, ":%u", (uint16_t) (tizen_base_port + SDB_TCP_EMULD_INDEX));
+    s = inet_connect(addr, true, NULL, NULL);
 
     if ( s < 0 ) {
-        ERR( "can't create socket to talk to the sdb forwarding session \n" );
+        ERR( "can't create socket to emulator daemon in guest\n" );
         ERR( "[127.0.0.1:%d/tcp] connect fail (%d:%s)\n" , tizen_base_port + SDB_TCP_EMULD_INDEX , errno, strerror(errno) );
         return;
     }