display: select display type with display options. 98/24698/5
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 18 Jul 2014 08:12:47 +0000 (17:12 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Sun, 20 Jul 2014 05:23:30 +0000 (14:23 +0900)
Select display type with display options - DT_MARU_SDL, DT_MARU_SHM, DT_MARU_QT.
Clean-up definitions and display type names.
Narrow scope of VIGS/YaGL cflags.

Change-Id: Ic541a1eff745a72dcccfa0ad3df6e4b2f5342f7b
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
34 files changed:
hw/vigs/Makefile.objs
hw/yagl/Makefile.objs
hw/yagl/yagl_apis/egl/Makefile.objs
hw/yagl/yagl_apis/gles/Makefile.objs
hw/yagl/yagl_backends/egl_offscreen/Makefile.objs
hw/yagl/yagl_backends/egl_onscreen/Makefile.objs
hw/yagl/yagl_drivers/egl_glx/Makefile.objs
hw/yagl/yagl_drivers/gles_ogl/Makefile.objs
hw/yagl/yagl_drivers/gles_onscreen/Makefile.objs
include/sysemu/sysemu.h
include/ui/console.h
tizen/src/display/Makefile.objs
tizen/src/display/maru_display.c
tizen/src/display/maru_display.h
tizen/src/display/maru_finger.c
tizen/src/display/maru_finger.h
tizen/src/display/maru_sdl.c
tizen/src/display/maru_sdl.h
tizen/src/display/maru_shm.c
tizen/src/display/maru_shm.h
tizen/src/display/qt5.c [new file with mode: 0644]
tizen/src/display/qt5_supplement.cpp [new file with mode: 0644]
tizen/src/display/qt5_supplement.h [new file with mode: 0644]
tizen/src/ecs/ecs_msg.c
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator.c
tizen/src/skin/maruskin_client.c
tizen/src/skin/maruskin_operation.c
ui/Makefile.objs
ui/qt5.c [deleted file]
ui/qt5_supplement.cpp [deleted file]
ui/qt5_supplement.h [deleted file]
vl.c

index 967bf46e7b1ac89def6884513db0e2abdd2e696d..ca42e65be8c51862c10f2f18ddc84e2d33b17a19 100644 (file)
@@ -1,6 +1,4 @@
 # VIGS
-QEMU_CFLAGS += -I$(SRC_PATH)/hw/vigs/vigs_inc
-
 obj-y += vigs_log.o
 obj-y += vigs_device.o
 libs_softmmu += $(GLX_LIBS)
index 2453ae9f4fa56a66af9eec3e18e33c93345b5a1b..fcd358f7d291a48fb516e1ce514eff76310e61fa 100644 (file)
@@ -1,5 +1,3 @@
-QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
-
 obj-y += yagl_device.o
 obj-y += yagl_log.o
 obj-y += yagl_process.o
@@ -29,3 +27,5 @@ obj-y += yagl_egl_surface_attribs.o
 obj-y += yagl_apis/
 obj-y += yagl_backends/
 obj-y += yagl_drivers/
+
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 570a37937948aa6b2a4ace14e1126ffb1157f17b..f92409ce7de33bd61cf83e33e59b1f7c9a3fd240 100644 (file)
@@ -9,3 +9,5 @@ obj-y += yagl_egl_surface.o
 obj-y += yagl_egl_context.o
 obj-y += yagl_egl_validate.o
 obj-y += yagl_host_egl_calls.o
+
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 1147c7f0630fdc1cb9fa976cc0efb872d15e3897..e08c5850a262958ebbad3e650ad32d1ed73b4330 100644 (file)
@@ -4,3 +4,5 @@ obj-y += yagl_gles_api_ps.o
 obj-y += yagl_gles_api_ts.o
 obj-y += yagl_gles_calls.o
 obj-y += yagl_host_gles_calls.o
+
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 5121b9f67b9c2ab08b70e32821207b34b581912c..2ec845c49263d34118b64ac3c6aaced049a17131 100644 (file)
@@ -4,3 +4,5 @@ obj-y += yagl_egl_offscreen_ts.o
 obj-y += yagl_egl_offscreen_display.o
 obj-y += yagl_egl_offscreen_context.o
 obj-y += yagl_egl_offscreen_surface.o
+
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 922fc679ada67a29e8a28ed43081f93a88bf2898..c42718d9fdb374503d9f20087ea4124ee587c4b6 100644 (file)
@@ -5,3 +5,4 @@ obj-y += yagl_egl_onscreen_display.o
 obj-y += yagl_egl_onscreen_context.o
 obj-y += yagl_egl_onscreen_surface.o
 
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 15df65cd5162b680cba6d36afe4572a8f4ce55aa..5a605f321ea3dbe7abece7a9789a960c761f4a56 100644 (file)
@@ -1,2 +1,4 @@
 # EGL GLX driver
 obj-y += yagl_egl_glx.o
+
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index a4391feb0021ed6cc70df21fc6c1a12b6fde33dc..6d558e3e8ae74e55e4797767e55eef1ad3ac9cf7 100644 (file)
@@ -1,2 +1,4 @@
 # GLES OpenGL driver
 obj-y += yagl_gles_ogl.o
+
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 5878ee9a7b18faba2a6b6bfac024e0630e076e46..a0f350b781f01248c8ec8dd04642cf01191ab6c6 100644 (file)
@@ -1,3 +1,4 @@
 # GLES onscreen driver
 obj-y += yagl_gles_onscreen.o
 
+$(obj)/%.o: QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
index 767dcbe45c9eca2d031c00cd988b4b741f544e6d..3f776d76c2fb043ad8c6097d3d0b3e40883b991c 100644 (file)
@@ -98,8 +98,9 @@ typedef enum DisplayType
     DT_GTK,
     DT_NOGRAPHIC,
 #ifdef CONFIG_MARU
-    DT_MARU,
-    DT_QT,
+    DT_MARU_SDL,
+    DT_MARU_SHM,
+    DT_MARU_QT,
 #endif
     DT_NONE,
 } DisplayType;
index 080eac69a7c4c955daa42b74cae2c396767a5807..36e2c9ab993e2ea9fa95ea87865f2fc6ce593043 100644 (file)
@@ -363,8 +363,4 @@ int index_from_key(const char *key);
 /* gtk.c */
 void early_gtk_display_init(void);
 void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover);
-
-/* qt5.c */
-void qt5_display_init(DisplayState *ds, int full_screen);
-
 #endif
index 3660db9ee4630b6b6906dc739d5f416f561bfe27..00312dffa06f9d800b29b730ccf7b78d0b7a135a 100644 (file)
@@ -1,10 +1,16 @@
 obj-y += maru_display.o
-ifdef CONFIG_USE_SHM
-obj-y += maru_shm.o
-else
-ifdef CONFIG_SDL
-obj-y += maru_sdl.o maru_sdl_processing.o maru_finger.o
-endif
-endif
+
+obj-$(CONFIG_USE_SHM) += maru_shm.o
+
+obj-$(CONFIG_SDL) += maru_sdl.o maru_sdl_processing.o maru_finger.o
+
+obj-$(CONFIG_QT) += qt5.o
+obj-$(CONFIG_QT) += qt5_supplement.o moc_qt5_supplement.o
 
 $(obj)/maru_display.o $(obj)/maru_sdl.o $(obj)/maru_sdl_processing.o $(obj)/maru_finger.o: QEMU_CFLAGS += $(SDL_CFLAGS)
+
+$(obj)/qt5_supplement.o: QEMU_CFLAGS += $(QT_CFLAGS)
+$(obj)/moc_qt5_supplement.o: $(obj)/moc_qt5_supplement.cpp
+$(obj)/moc_qt5_supplement.cpp: $(obj)/qt5_supplement.h
+       moc $< -o $@
+$(obj)/moc_qt5_supplement.o: QEMU_CFLAGS += $(QT_CFLAGS)
index 23dff8f4b6daf41c49791f23bad714bd8eebd3f3..5c585e662043e669f8d4a37938a2898310cbc31c 100644 (file)
 
 
 #include "emulator.h"
-#include "emulator_common.h"
 #include "maru_display.h"
 #include "debug_ch.h"
 
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-#include "maru_sdl.h"
-#endif
-#else
-#include "maru_shm.h"
-#endif
-
 MULTI_DEBUG_CHANNEL(tizen, display);
 
 MaruScreenShot* screenshot = NULL;
 
+static MaruDisplayChangeListener *mdcl;
+
 static void maru_display_fini(void)
 {
     INFO("fini qemu display\n");
 
     g_free(screenshot);
 
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_quit();
-#endif
-#else
-    maru_shm_quit();
-#endif
+    if (mdcl->fini) {
+        mdcl->fini();
+    }
 }
 
 static void maru_display_notify_exit(Notifier *notifier, void *data) {
@@ -66,93 +55,80 @@ static void maru_display_notify_exit(Notifier *notifier, void *data) {
 static Notifier maru_display_exit = { .notify = maru_display_notify_exit };
 
 //TODO: interface
-void maru_display_init(DisplayState *ds)
+void maru_display_init(DisplayState *ds, DisplayType display_type, int full_screen)
 {
     INFO("init qemu display\n");
 
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_pre_init();
-#endif
-#else
-    /* do nothing */
-#endif
-
-    /*  graphics context information */
-    DisplayChangeListener *dcl;
-
-    dcl = g_malloc0(sizeof(DisplayChangeListener));
-#if defined(CONFIG_USE_SHM) || defined(CONFIG_SDL)
-    //FIXME
-    dcl->ops = &maru_dcl_ops;
-#endif
-    register_displaychangelistener(dcl);
+    mdcl = g_malloc0(sizeof(MaruDisplayChangeListener));
 
+    switch (display_type) {
+#ifdef CONFIG_SDL
+    case DT_MARU_SDL:
+        maru_sdl_pre_init(mdcl);
+        break;
+#endif
+#ifdef CONFIG_USE_SHM
+    case DT_MARU_SHM:
+        maru_shm_pre_init(mdcl);
+        break;
+#endif
+#ifdef CONFIG_QT
+    case DT_MARU_QT:
+        maru_qt5_display_init(mdcl, full_screen);
+        break;
+#endif
+    default:
+        ERR("can not enter here.\n");
+        // can not enter here...
+        break;
+    }
+
+    //register_displaychangelistener(mdcl->dcl);
     screenshot = g_malloc0(sizeof(MaruScreenShot));
     screenshot->pixels = NULL;
     screenshot->request = false;
     screenshot->ready = false;
 
     emulator_add_exit_notifier(&maru_display_exit);
+    INFO("init qemu display 3\n");
 }
 
 void maru_display_resize(void)
 {
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_resize();
-#endif
-#else
-    maru_shm_resize();
-#endif
+    if (mdcl->resize) {
+        mdcl->resize();
+    }
 }
 
 void maru_display_update(void)
 {
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_update();
-#endif
-#else
-    /* do nothing */
-#endif
+    if (mdcl->update) {
+        mdcl->update();
+    }
 }
 
-void maru_display_invalidate(bool on)
+void maru_display_set_invalidate(bool on)
 {
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_invalidate(on);
-#endif
-#else
-    /* do nothing */
-#endif
+    if (mdcl->set_invalidate) {
+        mdcl->set_invalidate(on);
+    }
 }
 
-void maru_display_interpolation(bool on)
+void maru_display_set_interpolation(bool on)
 {
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_interpolation(on);
-#endif
-#else
-    /* do nothing */
-#endif
+    if (mdcl->set_interpolation) {
+        mdcl->set_interpolation(on);
+    }
 }
 
 void maru_ds_surface_init(uint64 swt_handle,
     unsigned int display_width, unsigned int display_height,
     bool blank_guide)
 {
-#ifndef CONFIG_USE_SHM
-#ifdef CONFIG_SDL
-    maru_sdl_init(swt_handle,
-        display_width, display_height, blank_guide);
-#endif
-#else
-    maru_shm_init(swt_handle,
-        display_width, display_height, blank_guide);
-#endif
+    if (mdcl->surface_init) {
+        mdcl->surface_init(swt_handle, display_width,
+                display_height, blank_guide);
+    }
 }
 
 MaruScreenShot *get_screenshot(void)
index c9c4552912d3e15027b6d6a9c3ab403fa2fc7225..b1ff6f63d7178b8f346a1ebc7efd9fa651b32540 100644 (file)
 #ifndef __MARU_DISPLAY_H__
 #define __MARU_DISPLAY_H__
 
+#include "sysemu/sysemu.h"
 #include "ui/console.h"
 
+typedef struct {
+    void (*surface_init)(uint64 swt_handle,
+            unsigned int display_width, unsigned int display_height,
+            bool blank_guide);
+    void (*fini)(void);
+
+    void (*resize)(void);
+    void (*update)(void);
+    void (*set_invalidate)(bool);
+    void (*set_interpolation)(bool);
+} MaruDisplayChangeListener;
+
 typedef struct MaruScreenShot {
     unsigned char *pixels;
     bool request;
     bool ready;
 } MaruScreenShot;
 
-void maru_display_init(DisplayState *ds);
+void maru_display_init(DisplayState *ds, DisplayType display_type, int full_screen);
 void maru_display_resize(void);
 void maru_display_update(void);
-void maru_display_invalidate(bool on);
-void maru_display_interpolation(bool on);
+void maru_display_set_invalidate(bool on);
+void maru_display_set_interpolation(bool on);
+
 void maru_ds_surface_init(uint64 swt_handle,
     unsigned int display_width, unsigned int display_height,
     bool blank_guide);
@@ -51,4 +65,13 @@ void maru_ds_surface_init(uint64 swt_handle,
 MaruScreenShot *get_screenshot(void);
 void save_screenshot(DisplaySurface *surface);
 
+// maru_sdl
+void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl);
+
+// maru_shm
+void maru_shm_pre_init(MaruDisplayChangeListener *mdcl);
+
+// maru_qt
+void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen);
+
 #endif /* __MARU_DISPLAY_H__ */
index de365e84606057a85f6343810c318f37d41d1d60..b3a1182d53be92b582be4644d0b0f9046563fe07 100644 (file)
@@ -30,7 +30,9 @@
 
 #include <math.h>
 #include <glib.h>
+
 #include <SDL.h>
+
 #include "maru_finger.h"
 #include "emul_state.h"
 #include "hw/virtio/maru_virtio_touchscreen.h"
@@ -230,16 +232,6 @@ void init_multi_touch_state(void)
     mts->finger_point_surface = (void *)point;
 }
 
-void set_multi_touch_enable(int enable)
-{
-    get_emul_multi_touch_state()->multitouch_enable = enable;
-}
-
-int get_multi_touch_enable(void)
-{
-    return get_emul_multi_touch_state()->multitouch_enable;
-}
-
 int add_finger_point(int origin_x, int origin_y, int x, int y)
 {
     MultiTouchState *mts = get_emul_multi_touch_state();
index d5f071e3263b788861f435792000161eba889d7a..ee4c44c06d09790cf45244d8dd700cf54c3efd33 100644 (file)
@@ -34,6 +34,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include "config-host.h"
+
 /* definitions relating to multi-touch */
 #define MAX_FINGER_CNT 10
 #define DEFAULT_FINGER_POINT_SIZE 32
@@ -62,8 +64,7 @@ typedef struct MultiTouchState {
 
 
 void init_multi_touch_state(void);
-void set_multi_touch_enable(int enable);
-int get_multi_touch_enable(void);
+
 FingerPoint *get_finger_point_from_slot(int index);
 FingerPoint *get_finger_point_search(int x, int y);
 int add_finger_point(int origin_x, int origin_y, int x, int y);
@@ -71,7 +72,12 @@ int add_finger_point(int origin_x, int origin_y, int x, int y);
 void maru_finger_processing_1(int touch_type, int origin_x, int origin_y, int x, int y);
 void maru_finger_processing_2(int touch_type, int origin_x, int origin_y, int x, int y);
 int rearrange_finger_points(int lcd_w, int lcd_h, double scale_factor, int rotaton_type);
+#ifdef CONFIG_SDL
 void clear_finger_slot(bool keep_enable);
+#else
+// FIXME: should be display independant...
+static void __attribute__((unused)) clear_finger_slot(bool keep_enable) {}
+#endif
 void cleanup_multi_touch_state(void);
 
 
index cdc099de5451b4b891ac7e51f6031d1eb7d6e166..2c0cea3145ece9074caaff4a1557f9f4faccb0f7 100644 (file)
@@ -34,7 +34,6 @@
 #include "emulator.h"
 #include "emul_state.h"
 #include "maru_display.h"
-#include "maru_sdl.h"
 #include "maru_sdl_processing.h"
 #include "hw/pci/maru_brightness.h"
 #include "debug_ch.h"
@@ -277,28 +276,13 @@ static void qemu_ds_sdl_refresh(DisplayChangeListener *dcl)
 #endif
 }
 
-DisplayChangeListenerOps maru_dcl_ops = {
+static DisplayChangeListenerOps dcl_ops = {
     .dpy_name          = "maru_sdl",
     .dpy_gfx_update    = qemu_ds_sdl_update,
     .dpy_gfx_switch    = qemu_ds_sdl_switch,
     .dpy_refresh       = qemu_ds_sdl_refresh,
 };
 
-void maru_sdl_interpolation(bool on)
-{
-    if (on == true) {
-        INFO("set PIXMAN_FILTER_BEST filter for image processing\n");
-
-        /* PIXMAN_FILTER_BILINEAR */
-        sdl_pixman_filter = PIXMAN_FILTER_BEST;
-    } else {
-        INFO("set PIXMAN_FILTER_FAST filter for image processing\n");
-
-        /* PIXMAN_FILTER_NEAREST */
-        sdl_pixman_filter = PIXMAN_FILTER_FAST;
-    }
-}
-
 static void qemu_update(void)
 {
     if (sdl_alteration < 0) {
@@ -514,46 +498,7 @@ static void maru_sdl_init_bh(void *opaque)
 #endif
 }
 
-void maru_sdl_pre_init(void) {
-    sdl_init_bh = qemu_bh_new(maru_sdl_init_bh, NULL);
-    sdl_resize_bh = qemu_bh_new(maru_sdl_resize_bh, NULL);
-    sdl_update_bh = qemu_bh_new(maru_sdl_update_bh, NULL);
-
-#ifdef SDL_THREAD
-    qemu_mutex_init(&sdl_mutex);
-    qemu_cond_init(&sdl_cond);
-#endif
-}
-
-void maru_sdl_init(uint64 swt_handle,
-    unsigned int display_width, unsigned int display_height,
-    bool blank_guide)
-{
-    gchar SDL_windowhack[32] = { 0, };
-    long window_id = swt_handle;
-    blank_guide_enable = blank_guide;
-
-    INFO("maru sdl init\n");
-
-    sprintf(SDL_windowhack, "%ld", window_id);
-    g_setenv("SDL_WINDOWID", SDL_windowhack, 1);
-
-    INFO("register SDL environment variable. "
-        "(SDL_WINDOWID = %s)\n", SDL_windowhack);
-
-    set_emul_resolution(display_width, display_height);
-    set_emul_sdl_bpp(SDL_BPP);
-    maru_sdl_interpolation(false);
-    init_multi_touch_state();
-
-    if (blank_guide_enable == true) {
-        INFO("blank guide is on\n");
-    }
-
-    qemu_bh_schedule(sdl_init_bh);
-}
-
-void maru_sdl_quit(void)
+static void maru_sdl_quit(void)
 {
     INFO("maru sdl quit\n");
 
@@ -594,21 +539,87 @@ void maru_sdl_quit(void)
 #endif
 }
 
-void maru_sdl_resize(void)
+static void maru_sdl_resize(void)
 {
     INFO("maru sdl resize\n");
 
     qemu_bh_schedule(sdl_resize_bh);
 }
 
-void maru_sdl_update(void)
+static void maru_sdl_update(void)
 {
     if (sdl_update_bh != NULL) {
         qemu_bh_schedule(sdl_update_bh);
     }
 }
 
-void maru_sdl_invalidate(bool on)
+static void maru_sdl_set_invalidate(bool on)
 {
     sdl_invalidate = on;
 }
+
+static void maru_sdl_set_interpolation(bool on)
+{
+    if (on == true) {
+        INFO("set PIXMAN_FILTER_BEST filter for image processing\n");
+
+        /* PIXMAN_FILTER_BILINEAR */
+        sdl_pixman_filter = PIXMAN_FILTER_BEST;
+    } else {
+        INFO("set PIXMAN_FILTER_FAST filter for image processing\n");
+
+        /* PIXMAN_FILTER_NEAREST */
+        sdl_pixman_filter = PIXMAN_FILTER_FAST;
+    }
+}
+
+static void maru_sdl_init(uint64 swt_handle,
+    unsigned int display_width, unsigned int display_height,
+    bool blank_guide)
+{
+    gchar SDL_windowhack[32] = { 0, };
+    long window_id = swt_handle;
+    blank_guide_enable = blank_guide;
+
+    INFO("maru sdl init\n");
+
+    sprintf(SDL_windowhack, "%ld", window_id);
+    g_setenv("SDL_WINDOWID", SDL_windowhack, 1);
+
+    INFO("register SDL environment variable. "
+        "(SDL_WINDOWID = %s)\n", SDL_windowhack);
+
+    set_emul_resolution(display_width, display_height);
+    set_emul_sdl_bpp(SDL_BPP);
+    maru_sdl_set_interpolation(false);
+    init_multi_touch_state();
+
+    if (blank_guide_enable == true) {
+        INFO("blank guide is on\n");
+    }
+
+    qemu_bh_schedule(sdl_init_bh);
+}
+
+void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl) {
+    DisplayChangeListener *dcl = g_malloc0(sizeof(DisplayChangeListener));
+    dcl->ops = &dcl_ops;
+    register_displaychangelistener(dcl);
+
+    mdcl->surface_init = maru_sdl_init;
+    mdcl->fini = maru_sdl_quit;
+
+    mdcl->resize = maru_sdl_resize;
+    mdcl->update = maru_sdl_update;
+    mdcl->set_invalidate = maru_sdl_set_invalidate;
+    mdcl->set_interpolation = maru_sdl_set_interpolation;
+
+    sdl_init_bh = qemu_bh_new(maru_sdl_init_bh, NULL);
+    sdl_resize_bh = qemu_bh_new(maru_sdl_resize_bh, NULL);
+    sdl_update_bh = qemu_bh_new(maru_sdl_update_bh, NULL);
+
+#ifdef SDL_THREAD
+    qemu_mutex_init(&sdl_mutex);
+    qemu_cond_init(&sdl_cond);
+#endif
+}
index 87e4ec877d94486f202a3677e0db489e819e61fa..9fa2f645b6dd396c7d42797cb156305bbf930768 100644 (file)
 #define MARU_SDL_H_
 
 #include "ui/console.h"
+#include "maru_display.h"
 
-extern DisplayChangeListenerOps maru_dcl_ops;
-
-void maru_sdl_pre_init(void);
-void maru_sdl_init(uint64 swt_handle,
-    unsigned int display_width, unsigned int display_height,
-    bool blank_guide);
-void maru_sdl_resize(void);
-void maru_sdl_update(void);
-void maru_sdl_invalidate(bool on);
-void maru_sdl_interpolation(bool on);
-void maru_sdl_quit(void);
+void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl);
 
 #endif /* MARU_SDL_H_ */
index 77a9cbae170ab0c5ff2e95367f7816e84e86ab1f..c1967a173aa22039ac37c3f42fbfa1ebdd4d8596 100644 (file)
@@ -32,7 +32,7 @@
 #include <sys/ipc.h>
 #include <sys/shm.h>
 
-#include "maru_shm.h"
+#include "maru_display.h"
 #include "emul_state.h"
 #include "hw/pci/maru_brightness.h"
 #include "skin/maruskin_server.h"
@@ -191,14 +191,51 @@ static void qemu_ds_shm_refresh(DisplayChangeListener *dcl)
     }
 }
 
-DisplayChangeListenerOps maru_dcl_ops = {
+static DisplayChangeListenerOps dcl_ops = {
     .dpy_name          = "maru_shm",
     .dpy_refresh       = qemu_ds_shm_refresh,
     .dpy_gfx_update    = qemu_ds_shm_update,
     .dpy_gfx_switch    = qemu_ds_shm_switch,
 };
 
-void maru_shm_init(uint64 swt_handle,
+static void maru_shm_quit(void)
+{
+    struct shmid_ds shm_info;
+
+    INFO("maru shm quit\n");
+
+    if (shmctl(skin_shmid, IPC_STAT, &shm_info) == -1) {
+        ERR("shmctl failed\n");
+        shm_info.shm_nattch = -1;
+    }
+
+    if (shmdt(shared_memory) == -1) {
+        ERR("shmdt failed\n");
+        perror("maru_vga: ");
+        return;
+    }
+    shared_memory = NULL;
+
+    if (shm_info.shm_nattch == 1) {
+        /* remove */
+        if (shmctl(skin_shmid, IPC_RMID, 0) == -1) {
+            INFO("segment was already removed\n");
+            perror("maru_vga: ");
+        } else {
+            INFO("shared memory was removed\n");
+        }
+    } else if (shm_info.shm_nattch != -1) {
+        INFO("number of current attaches = %d\n",
+            (int)shm_info.shm_nattch);
+    }
+}
+
+static void maru_shm_resize(void)
+{
+    shm_skip_update = 0;
+}
+
+static void maru_shm_init(uint64 swt_handle,
     unsigned int display_width, unsigned int display_height,
     bool blank_guide)
 {
@@ -251,39 +288,15 @@ void maru_shm_init(uint64 swt_handle,
     INFO("Memory attached at 0x%X\n", (int)shared_memory);
 }
 
-void maru_shm_quit(void)
-{
-    struct shmid_ds shm_info;
-
-    INFO("maru shm quit\n");
 
-    if (shmctl(skin_shmid, IPC_STAT, &shm_info) == -1) {
-        ERR("shmctl failed\n");
-        shm_info.shm_nattch = -1;
-    }
+void maru_shm_pre_init(MaruDisplayChangeListener *mdcl) {
+    DisplayChangeListener *dcl = g_malloc0(sizeof(DisplayChangeListener));
+    dcl->ops = &dcl_ops;
+    register_displaychangelistener(dcl);
 
-    if (shmdt(shared_memory) == -1) {
-        ERR("shmdt failed\n");
-        perror("maru_vga: ");
-        return;
-    }
-    shared_memory = NULL;
+    mdcl->surface_init = maru_shm_init;
+    mdcl->fini = maru_shm_quit;
 
-    if (shm_info.shm_nattch == 1) {
-        /* remove */
-        if (shmctl(skin_shmid, IPC_RMID, 0) == -1) {
-            INFO("segment was already removed\n");
-            perror("maru_vga: ");
-        } else {
-            INFO("shared memory was removed\n");
-        }
-    } else if (shm_info.shm_nattch != -1) {
-        INFO("number of current attaches = %d\n",
-            (int)shm_info.shm_nattch);
-    }
+    mdcl->resize = maru_shm_resize;
 }
 
-void maru_shm_resize(void)
-{
-    shm_skip_update = 0;
-}
index d24b1b69e02c5350b3842c38ef2987df5ed3d72e..14eb281971167a13433e805a750b6d7402954a0f 100644 (file)
 #define MARU_SHM_H_
 
 #include "ui/console.h"
+#include "maru_display.h"
 
-extern DisplayChangeListenerOps maru_dcl_ops;
-
-void maru_shm_init(uint64 swt_handle,
-    unsigned int display_width, unsigned int display_height,
-    bool blank_guide);
-void maru_shm_resize(void);
-void maru_shm_quit(void);
+void maru_shm_pre_init(MaruDisplayChangeListener *mdcl);
 
 #endif /* MARU_SHM_H_ */
diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c
new file mode 100644 (file)
index 0000000..64e3976
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "ui/console.h"
+#include "maru_display.h"
+#include "qt5_supplement.h"
+
+//static Notifier mouse_mode_notifier;
+static int qt5_num_outputs;
+
+static struct qt5_state {
+    DisplayChangeListener dcl;
+    DisplaySurface *surface;
+
+    int idx;
+} *qt5_console;
+
+static void qt5_update(DisplayChangeListener *dcl,
+                       int x, int y, int w, int h)
+{
+    DisplaySurface *surf = qemu_console_surface(dcl->con);
+
+    if (!surf) {
+        return;
+    }
+
+    qt5_update_internal(surface_data(surf), surface_width(surf), surface_height(surf));
+}
+
+static void qt5_switch(DisplayChangeListener *dcl,
+                       DisplaySurface *new_surface)
+{
+//    fprintf(stdout, "##### qt5_switch\n");
+}
+
+static void qt5_refresh(DisplayChangeListener *dcl)
+{
+    graphic_hw_update(dcl->con);
+    qt5_refresh_internal();
+}
+
+static void qt5_mouse_warp(DisplayChangeListener *dcl,
+                           int x, int y, int on)
+{
+}
+
+static void qt5_mouse_define(DisplayChangeListener *dcl,
+                             QEMUCursor *c)
+{
+}
+
+static const DisplayChangeListenerOps dcl_ops = {
+    .dpy_name          = "qt5",
+    .dpy_gfx_update    = qt5_update,
+    .dpy_gfx_switch    = qt5_switch,
+    .dpy_refresh       = qt5_refresh,
+    .dpy_mouse_set     = qt5_mouse_warp,
+    .dpy_cursor_define = qt5_mouse_define,
+};
+
+void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen)
+{
+    int i;
+
+    // prepare gui
+    qt5_prepare();
+
+    for (i = 0;; i++) {
+        QemuConsole *con = qemu_console_lookup_by_index(i);
+        if (!con || !qemu_console_is_graphic(con)) {
+            break;
+        }
+    }
+    qt5_num_outputs = i;
+    qt5_console = g_new0(struct qt5_state, qt5_num_outputs);
+    for (i = 0; i < qt5_num_outputs; i++) {
+        QemuConsole *con = qemu_console_lookup_by_index(i);
+        qt5_console[i].dcl.ops = &dcl_ops;
+        qt5_console[i].dcl.con = con;
+        register_displaychangelistener(&qt5_console[i].dcl);
+        qt5_console[i].idx = i;
+    }
+
+    // TODO: show icon
+
+    if (full_screen) {
+        // TODO
+    }
+
+    /* TODO
+    mouse_mode_notifier.notify = qt2_mouse_mode_change;
+    qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier);
+    */
+
+    // TODO: cursor control
+}
diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp
new file mode 100644 (file)
index 0000000..e72ea75
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <QApplication>
+#include "qt5_supplement.h"
+
+//using namespace std;
+
+static QApplication *app;
+
+QT5Console::QT5Console()
+{
+    label = new QLabel();
+    label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+    label->setAlignment(Qt::AlignCenter);
+    label->setFixedSize(720 / 2, 1280 / 2);
+
+    layout = new QVBoxLayout();
+    layout->addWidget(label);
+    layout->setContentsMargins( 0, 0, 0, 0);
+    setLayout(layout);
+
+    setWindowTitle(tr("Emulator with Qt5"));
+}
+
+QLabel *QT5Console::getLabel()
+{
+    return label;
+}
+
+static int argc = 0;
+static char *argv[0];
+static QT5Console *console;
+
+void qt5_prepare(void)
+{
+    app = new QApplication(argc, argv);
+    console = new QT5Console();
+    console->show();
+}
+
+int qt5_get_win_id(void)
+{
+    return console->winId();
+}
+
+void qt5_update_internal(void *data, int width, int height)
+{
+    QPixmap pixmap = QPixmap();
+    QLabel *label = console->getLabel();
+
+    QImage image = QImage((uchar *)data, width, height, QImage::Format_ARGB32);
+    pixmap.convertFromImage(image);
+
+    label->setPixmap(pixmap.scaled(label->size(), Qt::KeepAspectRatio,
+                Qt::SmoothTransformation));
+}
+
+void qt5_switch_internal(void)
+{
+}
+
+void qt5_refresh_internal(void)
+{
+    app->processEvents();
+}
+
+void qt5_mouse_warp(void)
+{
+}
+
+void sdl_mouse_define(void)
+{
+}
diff --git a/tizen/src/display/qt5_supplement.h b/tizen/src/display/qt5_supplement.h
new file mode 100644 (file)
index 0000000..cd6e152
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef __QT5_INTERNAL_H__
+#define __QT5_INTERNAL_H__
+
+#ifdef __cplusplus
+#include <QtWidgets>
+
+class QT5Console : public QWidget
+{
+    Q_OBJECT
+
+public:
+    QT5Console();
+    QLabel *getLabel();
+
+protected:
+
+private:
+    QLabel *label;
+    QLayout *layout;
+};
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void qt5_prepare(void);
+int qt5_get_win_id(void);
+
+void qt5_update_internal(void *data, int width, int height);
+void qt5_switch_internal(void);
+void qt5_refresh_internal(void);
+void qt5_mouse_warp_internal(void);
+void sdl_mouse_define_internal(void);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __QT5_INTERNAL_H__
index 0ac65386152c9eb4f68b64778e98c5f9f82cd2b8..a888300349ae22ba7997101004976ec5b9007acd 100644 (file)
@@ -54,9 +54,7 @@
 #include "qmp-commands.h"
 
 #include "ecs.h"
-#ifndef CONFIG_USE_SHM
 #include "display/maru_finger.h"
-#endif
 
 #include "hw/virtio/maru_virtio_evdi.h"
 #include "hw/virtio/maru_virtio_sensor.h"
@@ -523,13 +521,9 @@ bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg)
         }
     } else if (!strncmp(cmd, "TGesture", strlen("TGesture"))) {
         /* release multi-touch */
-#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL)
         if (get_multi_touch_enable() != 0) {
             clear_finger_slot(false);
         }
-#else
-        // TODO:
-#endif
 
         if (data == NULL) {
             ERR("touch gesture data is NULL\n");
index 7e10d185d9697cb5d45cb9b6fda02809e30dd793..2137a62c70ec80deb9addde6f604d4907c0188a0 100644 (file)
@@ -269,6 +269,17 @@ MultiTouchState *get_emul_multi_touch_state(void)
     return &(_emul_state.qemu_mts);
 }
 
+void set_multi_touch_enable(int enable)
+{
+    _emul_state.qemu_mts.multitouch_enable = enable;
+}
+
+int get_multi_touch_enable(void)
+{
+    return _emul_state.qemu_mts.multitouch_enable;
+}
+
+
 /* retrieves the status of the host lock key */
 int get_host_lock_key_state(int key)
 {
index 464becd5cbcc2fe31626b17916ad406d7f046628..865017eca0c107763dce8e3db621542144af0da6 100644 (file)
@@ -147,11 +147,15 @@ int get_emul_ecs_port(void);
 
 int get_emulator_condition(void);
 short get_emul_rotation(void);
-MultiTouchState *get_emul_multi_touch_state(void);
 int get_host_lock_key_state(int key);
 int get_host_lock_key_state_darwin(int key);
 int get_emul_caps_lock_state(void);
 int get_emul_num_lock_state(void);
 char* get_emul_vm_name(void);
 
+/* multi-touch */
+MultiTouchState *get_emul_multi_touch_state(void);
+void set_multi_touch_enable(int enable);
+int get_multi_touch_enable(void);
+
 #endif /* __EMUL_STATE_H__ */
index 572499f5f7da7169459c3b4ade175430b86b0c4c..ce3b39cecf348e0ebeef85609ba03938f1e2e31b 100644 (file)
@@ -79,7 +79,7 @@ void emulator_add_exit_notifier(Notifier *notify)
     qemu_add_exit_notifier(notify);
 }
 
-#ifdef CONFIG_SDL
+#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM)
 static void construct_main_window(int skin_argc, char *skin_argv[],
                                 int qemu_argc, char *qemu_argv[])
 {
@@ -276,7 +276,7 @@ const char *prepare_maru(const gchar * const kernel_cmdline)
     return maru_kernel_cmdline;
 }
 
-#ifdef CONFIG_SDL
+#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM)
 void start_skin(void)
 {
     LOG_INFO("Start skin\n");
@@ -297,7 +297,7 @@ static int emulator_main(int argc, char *argv[], char **envp)
     }
 #endif
 
-#ifdef CONFIG_WIN32
+#if defined(CONFIG_WIN32) && defined(CONFIG_SDL)
     // SDL_init() routes stdout and stderr to the respective files in win32.
     // So we revert it.
     freopen("CON", "w", stdout);
index 5001a1cb52b47c4b6f0140e79f48ccf0935e6550..e6a97dc7a9517a7816a2120443bee14653ddf5b3 100644 (file)
@@ -112,11 +112,17 @@ static void *run_skin_client(void *arg)
 
     /* display */
     char buf_display_shm[8] = { 0, };
-#ifdef CONFIG_USE_SHM
-    strcpy(buf_display_shm, OPT_BOOLEAN_TRUE); /* maru_shm */
-#else
-    strcpy(buf_display_shm, OPT_BOOLEAN_FALSE); /* maru_sdl */
-#endif
+    switch (display_type) {
+    case DT_MARU_SDL:
+        strcpy(buf_display_shm, OPT_BOOLEAN_FALSE); /* maru_sdl */
+        break;
+    case DT_MARU_SHM:
+        strcpy(buf_display_shm, OPT_BOOLEAN_TRUE); /* maru_shm */
+        break;
+    default:
+        ERR("Can not enter here.\n");
+        break;
+    }
 
     /* input */
     char buf_input[12] = { 0, };
index 2a1aa64550aed267208d9e0774f2c61a088b4eae..10005feabd99b0035f05102b2b073a60c48fdb3d 100644 (file)
@@ -96,7 +96,7 @@ void do_grabbing_enable(bool on)
 {
     INFO("skin grabbing enable : %d\n", on);
 
-    maru_display_invalidate(on);
+    maru_display_set_invalidate(on);
 }
 
 void do_mouse_event(int button_type, int event_type,
@@ -555,7 +555,7 @@ void do_interpolation_enable(bool on)
 {
     INFO("interpolation enable : %d\n", on);
 
-    maru_display_interpolation(on);
+    maru_display_set_interpolation(on);
 }
 
 void do_ram_dump(void)
index 55bd9410415b2bd322805de1000eb5424470d802..6f2294efdaafca8fc32f840ae5778f5b4747518a 100644 (file)
@@ -15,16 +15,6 @@ common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
 common-obj-$(CONFIG_GTK) += gtk.o x_keymap.o
 
-# by caramis
-common-obj-$(CONFIG_QT) += qt5.o
-common-obj-$(CONFIG_QT) += qt5_supplement.o moc_qt5_supplement.o
-
 $(obj)/sdl.o $(obj)/sdl_zoom.o $(obj)/sdl2.o: QEMU_CFLAGS += $(SDL_CFLAGS)
 
 $(obj)/gtk.o: QEMU_CFLAGS += $(GTK_CFLAGS) $(VTE_CFLAGS)
-
-$(obj)/qt5_supplement.o: QEMU_CFLAGS += $(QT_CFLAGS)
-$(obj)/moc_qt5_supplement.o: $(obj)/moc_qt5_supplement.cpp
-$(obj)/moc_qt5_supplement.cpp: $(obj)/qt5_supplement.h
-       moc $< -o $@
-$(obj)/moc_qt5_supplement.o: QEMU_CFLAGS += $(QT_CFLAGS)
diff --git a/ui/qt5.c b/ui/qt5.c
deleted file mode 100644 (file)
index 2a01abb..0000000
--- a/ui/qt5.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * SeokYeon Hwang <syeon.hwang@samsung.com>
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-#include "ui/console.h"
-#include "qt5_supplement.h"
-
-//static Notifier mouse_mode_notifier;
-static int qt5_num_outputs;
-
-static struct qt5_state {
-    DisplayChangeListener dcl;
-    DisplaySurface *surface;
-
-    int idx;
-} *qt5_console;
-
-static void qt5_update(DisplayChangeListener *dcl,
-                       int x, int y, int w, int h)
-{
-    DisplaySurface *surf = qemu_console_surface(dcl->con);
-
-    if (!surf) {
-        return;
-    }
-
-    qt5_update_internal(surface_data(surf), surface_width(surf), surface_height(surf));
-}
-
-static void qt5_switch(DisplayChangeListener *dcl,
-                       DisplaySurface *new_surface)
-{
-//    fprintf(stdout, "##### qt5_switch\n");
-}
-
-static void qt5_refresh(DisplayChangeListener *dcl)
-{
-    graphic_hw_update(dcl->con);
-    qt5_refresh_internal();
-}
-
-static void qt5_mouse_warp(DisplayChangeListener *dcl,
-                           int x, int y, int on)
-{
-}
-
-static void qt5_mouse_define(DisplayChangeListener *dcl,
-                             QEMUCursor *c)
-{
-}
-
-static const DisplayChangeListenerOps dcl_ops = {
-    .dpy_name          = "qt5",
-    .dpy_gfx_update    = qt5_update,
-    .dpy_gfx_switch    = qt5_switch,
-    .dpy_refresh       = qt5_refresh,
-    .dpy_mouse_set     = qt5_mouse_warp,
-    .dpy_cursor_define = qt5_mouse_define,
-};
-
-void qt5_display_init(DisplayState *ds, int full_screen)
-{
-    int i;
-
-    // prepare gui
-    qt5_prepare();
-
-    for (i = 0;; i++) {
-        QemuConsole *con = qemu_console_lookup_by_index(i);
-        if (!con || !qemu_console_is_graphic(con)) {
-            break;
-        }
-    }
-    qt5_num_outputs = i;
-    qt5_console = g_new0(struct qt5_state, qt5_num_outputs);
-    for (i = 0; i < qt5_num_outputs; i++) {
-        QemuConsole *con = qemu_console_lookup_by_index(i);
-        qt5_console[i].dcl.ops = &dcl_ops;
-        qt5_console[i].dcl.con = con;
-        register_displaychangelistener(&qt5_console[i].dcl);
-        qt5_console[i].idx = i;
-    }
-
-    // TODO: show icon
-
-    if (full_screen) {
-        // TODO
-    }
-
-    /* TODO
-    mouse_mode_notifier.notify = qt2_mouse_mode_change;
-    qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier);
-    */
-
-    // TODO: cursor control
-}
diff --git a/ui/qt5_supplement.cpp b/ui/qt5_supplement.cpp
deleted file mode 100644 (file)
index e72ea75..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * SeokYeon Hwang <syeon.hwang@samsung.com>
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-#include <QApplication>
-#include "qt5_supplement.h"
-
-//using namespace std;
-
-static QApplication *app;
-
-QT5Console::QT5Console()
-{
-    label = new QLabel();
-    label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    label->setAlignment(Qt::AlignCenter);
-    label->setFixedSize(720 / 2, 1280 / 2);
-
-    layout = new QVBoxLayout();
-    layout->addWidget(label);
-    layout->setContentsMargins( 0, 0, 0, 0);
-    setLayout(layout);
-
-    setWindowTitle(tr("Emulator with Qt5"));
-}
-
-QLabel *QT5Console::getLabel()
-{
-    return label;
-}
-
-static int argc = 0;
-static char *argv[0];
-static QT5Console *console;
-
-void qt5_prepare(void)
-{
-    app = new QApplication(argc, argv);
-    console = new QT5Console();
-    console->show();
-}
-
-int qt5_get_win_id(void)
-{
-    return console->winId();
-}
-
-void qt5_update_internal(void *data, int width, int height)
-{
-    QPixmap pixmap = QPixmap();
-    QLabel *label = console->getLabel();
-
-    QImage image = QImage((uchar *)data, width, height, QImage::Format_ARGB32);
-    pixmap.convertFromImage(image);
-
-    label->setPixmap(pixmap.scaled(label->size(), Qt::KeepAspectRatio,
-                Qt::SmoothTransformation));
-}
-
-void qt5_switch_internal(void)
-{
-}
-
-void qt5_refresh_internal(void)
-{
-    app->processEvents();
-}
-
-void qt5_mouse_warp(void)
-{
-}
-
-void sdl_mouse_define(void)
-{
-}
diff --git a/ui/qt5_supplement.h b/ui/qt5_supplement.h
deleted file mode 100644 (file)
index cd6e152..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * SeokYeon Hwang <syeon.hwang@samsung.com>
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-#ifndef __QT5_INTERNAL_H__
-#define __QT5_INTERNAL_H__
-
-#ifdef __cplusplus
-#include <QtWidgets>
-
-class QT5Console : public QWidget
-{
-    Q_OBJECT
-
-public:
-    QT5Console();
-    QLabel *getLabel();
-
-protected:
-
-private:
-    QLabel *label;
-    QLayout *layout;
-};
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-void qt5_prepare(void);
-int qt5_get_win_id(void);
-
-void qt5_update_internal(void *data, int width, int height);
-void qt5_switch_internal(void);
-void qt5_refresh_internal(void);
-void qt5_mouse_warp_internal(void);
-void sdl_mouse_define_internal(void);
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __QT5_INTERNAL_H__
diff --git a/vl.c b/vl.c
index 5ffb66ab7f758f6b7b923d0b9bf0ef4e40aaf102..bfbd739c8b4210d6c6ca5ea1e46d6ac8fcbe81f0 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2352,8 +2352,20 @@ static DisplayType select_display(const char *p)
         fprintf(stderr, "GTK support is disabled\n");
         exit(1);
 #endif
-    } else if (strstart(p, "qt", &opts)) {
-        display = DT_QT;
+#ifdef CONFIG_MARU
+    } else if (strstart(p, "maru_sdl", &opts)) {
+#ifdef CONFIG_SDL
+        display = DT_MARU_SDL;
+#endif
+    } else if (strstart(p, "maru_shm", &opts)) {
+#ifdef CONFIG_USE_SHM
+        display = DT_MARU_SHM;
+#endif
+    } else if (strstart(p, "maru_qt", &opts)) {
+#ifdef CONFIG_QT
+        display = DT_MARU_QT;
+#endif
+#endif
     } else if (strstart(p, "none", &opts)) {
         display = DT_NONE;
     } else {
@@ -4242,10 +4254,16 @@ int main(int argc, char **argv, char **envp)
 
     if (display_type == DT_DEFAULT && !display_remote) {
 #if defined(CONFIG_MARU)
+        // FIXME: for compatibility...
+        // If no display_type is specified,
+        // we use DT_MARU_SDL on Linux, Windows and
+        // use DT_MARU_SHM on MacOS.
 #if defined(CONFIG_SDL)
-        display_type = DT_MARU;
+        display_type = DT_MARU_SDL;
+#elif defined(CONFIG_USE_SHM)
+        display_type = DT_MARU_SHM;
 #elif defined(CONFIG_QT)
-        display_type = DT_QT;
+        display_type = DT_MARU_QT;
 #endif
 #elif defined(CONFIG_GTK)
         display_type = DT_GTK;
@@ -4584,25 +4602,6 @@ int main(int argc, char **argv, char **envp)
         curses_display_init(ds, full_screen);
         break;
 #endif
-#if defined(CONFIG_MARU)
-#if defined(CONFIG_SDL)
-    case DT_MARU:
-        maru_display_init(ds);
-        if (skin_disabled == 1) {
-            /* do not start skin client process */
-            set_emul_skin_enable(false);
-        } else {
-            set_emul_skin_enable(true);
-        }
-        start_skin();
-        break;
-#endif
-#if defined(CONFIG_QT)
-    case DT_QT:
-        qt5_display_init(ds, full_screen);
-        break;
-#endif
-#endif
 #if defined(CONFIG_SDL)
     case DT_SDL:
         sdl_display_init(ds, full_screen, no_frame);
@@ -4616,6 +4615,26 @@ int main(int argc, char **argv, char **envp)
     case DT_GTK:
         gtk_display_init(ds, full_screen, grab_on_hover);
         break;
+#endif
+#if defined(CONFIG_MARU)
+#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM)
+    case DT_MARU_SDL:
+    case DT_MARU_SHM:
+        maru_display_init(ds, display_type, full_screen);
+        if (skin_disabled == 1) {
+            /* do not start skin client process */
+            set_emul_skin_enable(false);
+        } else {
+            set_emul_skin_enable(true);
+        }
+        start_skin();
+        break;
+#endif
+#if defined(CONFIG_QT)
+    case DT_MARU_QT:
+        maru_display_init(ds, display_type, full_screen);
+        break;
+#endif
 #endif
     default:
         break;