From 39236253c93030bcc480480b03a17bc64842370a Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Sun, 19 Jul 2015 16:06:09 +0900 Subject: [PATCH] ui: prepared for excluding java ui build Used unified definition "CONFIG_JAVA_UI" for java ui. Did not build java skin if "CONFIG_JAVA_UI" is not set. Additional task - especially cleaning sources up under src/skin/* - should be followed. Change-Id: I40a16ff8cc2d5c4e119267c41ebcca23c650a1c0 Signed-off-by: SeokYeon Hwang --- configure | 6 ++++++ tizen/src/Makefile | 16 ++++++++-------- tizen/src/display/Makefile.objs | 3 ++- tizen/src/display/maru_display.c | 17 ++++++++++++++--- tizen/src/display/maru_sdl.c | 2 +- tizen/src/display/qt5.c | 7 ------- tizen/src/emul_state.c | 3 ++- tizen/src/emulator.c | 14 +++++++------- tizen/src/emulator_legacy.c | 6 ++++++ tizen/src/emulator_options.h | 4 +++- tizen/src/eventcast/encode_fb.c | 2 +- tizen/src/skin/maruskin_client.c | 7 +++++++ tizen/src/skin/maruskin_operation.c | 6 +++--- vl.c | 8 ++++---- 14 files changed, 64 insertions(+), 37 deletions(-) diff --git a/configure b/configure index 252426c..5d0a966 100755 --- a/configure +++ b/configure @@ -5193,6 +5193,12 @@ fi if [ ! -z "$extension_path" ] ; then echo "CONFIG_EXTENSION_PATH=$extension_path" >> $config_host_mak fi +# java skin is deprecated +if test "$maru" = "yes" ; then + if test "$shm" = "yes" || test "$sdl" = "yes" ; then + echo "CONFIG_JAVA_UI=y" >> $config_host_mak + fi +fi # TPM passthrough support? if test "$tpm" = "yes"; then diff --git a/tizen/src/Makefile b/tizen/src/Makefile index fd8ca35..5211a93 100755 --- a/tizen/src/Makefile +++ b/tizen/src/Makefile @@ -120,11 +120,13 @@ util/check_hax.o: %.o: %.c # Building java skin skin_client: +ifdef CONFIG_JAVA_UI ifdef CONFIG_USE_SHM TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DuseSHM=true -buildfile skin/client/build.xml make-jar else TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DuseSHM=false -buildfile skin/client/build.xml make-jar endif +endif build_info: @echo "Generate a build information file" @@ -175,14 +177,11 @@ ifdef CONFIG_WIN32 endif # resources and jar for skin -ifdef CONFIG_SDL +ifdef CONFIG_JAVA_UI cp -pP skin/client/emulator-skin.jar $(EMUL_DIR)/bin cp -pPR skin/client/skins $(EMUL_DIR) +ifdef CONFIG_SDL cp -pP skin/client/resource/images/blank-guide.png $(EMUL_DIR)/images -else -ifdef CONFIG_USE_SHM - cp -pP skin/client/emulator-skin.jar $(EMUL_DIR)/bin - cp -pPR skin/client/skins $(EMUL_DIR) endif endif @@ -262,11 +261,13 @@ endif # for dibs system... all_dibs: qemu skin_client_dibs skin_client_dibs: +ifdef CONFIG_JAVA_UI ifdef CONFIG_USE_SHM TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DuseSHM=true ${DIBS_SWT_DIR} -buildfile skin/client/build.xml make-jar else TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DuseSHM=false ${DIBS_SWT_DIR} -buildfile skin/client/build.xml make-jar endif +endif install_dibs: all_dibs mkdir -p $(DIBS_COMMON_DIR)/bin @@ -304,11 +305,10 @@ ifdef CONFIG_WIN32 endif # resources and jar for skin -ifdef CONFIG_SDL +ifdef CONFIG_JAVA_UI cp -pP skin/client/emulator-skin.jar $(DIBS_COMMON_DIR)/bin cp -pP skin/client/resource/images/blank-guide.png $(DIBS_COMMON_DIR)/images -else -ifdef CONFIG_USE_SHM +ifdef CONFIG_SDL cp -pP skin/client/emulator-skin.jar $(DIBS_COMMON_DIR)/bin endif endif diff --git a/tizen/src/display/Makefile.objs b/tizen/src/display/Makefile.objs index b0a4bd4..4fc9416 100644 --- a/tizen/src/display/Makefile.objs +++ b/tizen/src/display/Makefile.objs @@ -1,8 +1,9 @@ obj-y += maru_display.o maru_display_processing.o +ifdef CONFIG_JAVA_UI obj-$(CONFIG_USE_SHM) += maru_shm.o - obj-$(CONFIG_SDL) += maru_sdl.o maru_sdl_processing.o maru_finger.o +endif obj-$(CONFIG_QT) += qt5.o obj-$(CONFIG_QT) += qt5_supplement.o diff --git a/tizen/src/display/maru_display.c b/tizen/src/display/maru_display.c index ae67fd0..1a84dd4 100644 --- a/tizen/src/display/maru_display.c +++ b/tizen/src/display/maru_display.c @@ -78,6 +78,10 @@ void maru_display_early_init(DisplayType display_type) } } +// FIXME +#ifdef SDL_THREAD +QemuMutex sdl_mutex; +#endif void maru_display_init(DisplayState *ds, DisplayType display_type, int full_screen) { @@ -86,21 +90,28 @@ void maru_display_init(DisplayState *ds, DisplayType display_type, mdcl = g_new0(MaruDisplayChangeListener, 1); switch (display_type) { -#ifdef CONFIG_SDL +#ifdef CONFIG_JAVA_UI + #ifdef CONFIG_SDL case DT_MARU_SDL: INFO("Display Type: SDL\n"); maru_sdl_pre_init(mdcl); break; -#endif -#ifdef CONFIG_USE_SHM + #endif + #ifdef CONFIG_USE_SHM case DT_MARU_SHM: INFO("Display Type: SHM\n"); maru_shm_pre_init(mdcl); break; + #endif #endif #ifdef CONFIG_QT case DT_MARU_QT_ONSCREEN: case DT_MARU_QT_OFFSCREEN: + #ifdef SDL_THREAD + // FIXME + qemu_mutex_init(&sdl_mutex); + #endif + maru_qt5_display_init(mdcl, full_screen); break; #endif diff --git a/tizen/src/display/maru_sdl.c b/tizen/src/display/maru_sdl.c index cef5890..288c612 100644 --- a/tizen/src/display/maru_sdl.c +++ b/tizen/src/display/maru_sdl.c @@ -78,7 +78,7 @@ static unsigned int blank_cnt; #define BLANK_GUIDE_IMAGE_NAME "blank-guide.png" #ifdef SDL_THREAD -QemuMutex sdl_mutex; +extern QemuMutex sdl_mutex; QemuCond sdl_cond; static int sdl_thread_initialized; diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c index d4fd5a0..f00e0e4 100644 --- a/tizen/src/display/qt5.c +++ b/tizen/src/display/qt5.c @@ -33,9 +33,6 @@ #include "qt5_supplement.h" #include "hw/pci/maru_brightness.h" -extern QemuMutex sdl_mutex; -extern QemuCond sdl_cond; - /* static Notifier mouse_mode_notifier; */ static int qt5_num_outputs; @@ -148,10 +145,6 @@ void maru_qt5_display_quit(void) void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen) { int i; -#ifdef SDL_THREAD - qemu_mutex_init(&sdl_mutex); - qemu_cond_init(&sdl_cond); -#endif /* prepare gui */ #ifdef CONFIG_DARWIN diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index 11bc77b..399cef5 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -303,8 +303,9 @@ void set_emulator_condition(int state) // TODO: } else if (state == RESET) { LOG_INFO("reset emulator!\n"); - +#ifdef CONFIG_JAVA_UI notify_emul_reset(); +#endif } _emul_state.emulator_condition = state; diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index ac7b64d..ce68a53 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -71,7 +71,7 @@ extern bool yagl_enabled(void); int enable_spice = 0; -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) +#if defined(CONFIG_JAVA_UI) int _skin_argc; char **_skin_argv; #endif @@ -83,7 +83,7 @@ void emulator_add_exit_notifier(Notifier *notify) qemu_add_exit_notifier(notify); } -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) +#if defined(CONFIG_JAVA_UI) static void construct_main_window(int skin_argc, char *skin_argv[], int qemu_argc, char *qemu_argv[]) { @@ -112,7 +112,7 @@ static void emulator_notify_exit(Notifier *notifier, void *data) for (i = 0; i < _qemu_argc; ++i) { g_free(_qemu_argv[i]); } -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) +#if defined(CONFIG_JAVA_UI) for (i = 0; i < _skin_argc; ++i) { g_free(_skin_argv[i]); } @@ -168,7 +168,7 @@ static void print_options_info(void) } fprintf(stdout, "\n====================================================\n"); -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) +#if defined(CONFIG_JAVA_UI) fprintf(stdout, "skin args: =========================================\n"); for (i = 0; i < _skin_argc; ++i) { fprintf(stdout, "%s ", _skin_argv[i]); @@ -220,7 +220,7 @@ void prepare_maru_after_device_init(void) get_vm_data_path(); } -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) +#if defined(CONFIG_JAVA_UI) void start_skin(void) { LOG_INFO("Start skin\n"); @@ -244,7 +244,7 @@ static int emulator_main(int argc, char *argv[], char **envp) int c = 0; _qemu_argv = g_malloc(sizeof(char*) * ARGS_LIMIT); -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) +#if defined(CONFIG_JAVA_UI) _skin_argv = g_malloc(sizeof(char*) * ARGS_LIMIT); #endif @@ -322,7 +322,7 @@ static int emulator_main(int argc, char *argv[], char **envp) if (!assemble_emulator_args(&_qemu_argc, _qemu_argv)) { return -1; } - #if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) + #if defined(CONFIG_JAVA_UI) // java skin is deprecated, it is used for only debugging... _skin_argv[_skin_argc++] = g_strdup_printf("skin.path=%s", get_emul_skin_path()); diff --git a/tizen/src/emulator_legacy.c b/tizen/src/emulator_legacy.c index cc1cbf3..f9f7667 100644 --- a/tizen/src/emulator_legacy.c +++ b/tizen/src/emulator_legacy.c @@ -78,8 +78,14 @@ extern char tizen_target_path[PATH_MAX]; extern int enable_yagl; extern int enable_spice; +#if defined(CONFIG_JAVA_UI) extern int _skin_argc; extern char **_skin_argv; +#else +// FIXME +int _skin_argc; +char **_skin_argv; +#endif extern int _qemu_argc; extern char **_qemu_argv; diff --git a/tizen/src/emulator_options.h b/tizen/src/emulator_options.h index d1b5815..cbe1895 100644 --- a/tizen/src/emulator_options.h +++ b/tizen/src/emulator_options.h @@ -33,7 +33,9 @@ // "SKIN_OPTIONS" field is deprecated // but it still can be used -#define SUPPORT_SKIN_OPTIONS +#if defined(CONFIG_JAVA_UI) + #define SUPPORT_SKIN_OPTIONS +#endif #define KEYWORD_BIN_PATH "_BIN_PATH_" diff --git a/tizen/src/eventcast/encode_fb.c b/tizen/src/eventcast/encode_fb.c index 48d457d..a141dbbbe7 100644 --- a/tizen/src/eventcast/encode_fb.c +++ b/tizen/src/eventcast/encode_fb.c @@ -47,7 +47,7 @@ DECLARE_DEBUG_CHANNEL(eventcast); -#if !defined(CONFIG_SDL) && !defined(CONFIG_USE_SHM) +#if !defined(CONFIG_JAVA_UI) bool maru_extract_framebuffer(void *buffer) { LOG_INFO("SDL or SHM module is not enabled"); diff --git a/tizen/src/skin/maruskin_client.c b/tizen/src/skin/maruskin_client.c index 9691ec1..bdbdc2d 100644 --- a/tizen/src/skin/maruskin_client.c +++ b/tizen/src/skin/maruskin_client.c @@ -386,6 +386,7 @@ int start_skin_client(int argc, char* argv[]) return 1; } +#ifdef CONFIG_JAVA_UI int start_simple_client(char* msg) { int ret = 0; @@ -460,3 +461,9 @@ int start_simple_client(char* msg) return 1; } +#else +// FIXME: should implement it +int start_simple_client(char* msg) { + return 1; +} +#endif diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index 3ab6046..0fd2b3e 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -122,7 +122,7 @@ void do_mouse_event(int button_type, int event_type, "host=(%d, %d), x=%d, y=%d, z=%d\n", button_type, event_type, origin_x, origin_y, x, y, z); -#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL) +#if defined(CONFIG_JAVA_UI) && !defined(CONFIG_USE_SHM) /* draw multi-touch points */ if (get_multi_touch_enable() != 0) { if (event_type == MOUSE_DOWN || event_type == MOUSE_DRAG) { @@ -194,7 +194,7 @@ void do_qt_keyboard_key_event(int event_type, int keycode) { } } -#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL) +#if defined(CONFIG_JAVA_UI) && !defined(CONFIG_USE_SHM) static void multitouch_toggle_key_checking(int event_type, int keycode, int state_mask, int key_location) { @@ -265,7 +265,7 @@ void do_keyboard_key_event(int event_type, "state_mask=%d, key_location=%d\n", event_type, keycode, state_mask, key_location); -#if !defined(CONFIG_USE_SHM) && defined(CONFIG_SDL) +#if defined(CONFIG_JAVA_UI) && !defined(CONFIG_USE_SHM) if (get_max_touch_point() > 1) { multitouch_toggle_key_checking(event_type, keycode, state_mask, key_location); diff --git a/vl.c b/vl.c index b4ac178..5fa904a 100644 --- a/vl.c +++ b/vl.c @@ -4542,7 +4542,7 @@ int main(int argc, char **argv, char **envp) break; #endif #if defined(CONFIG_MARU) -#if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM) + #if defined(CONFIG_JAVA_UI) case DT_MARU_SDL: case DT_MARU_SHM: maru_display_init(ds, display_type, full_screen); @@ -4554,13 +4554,13 @@ int main(int argc, char **argv, char **envp) } start_skin(); break; -#endif -#if defined(CONFIG_QT) + #endif + #if defined(CONFIG_QT) case DT_MARU_QT_ONSCREEN: case DT_MARU_QT_OFFSCREEN: maru_display_init(ds, display_type, full_screen); break; -#endif + #endif #endif default: break; -- 2.7.4