diff options
author | GiWoong Kim <giwoong.kim@samsung.com> | 2016-01-05 16:40:35 +0900 |
---|---|---|
committer | GiWoong Kim <giwoong.kim@samsung.com> | 2016-01-06 20:05:56 +0900 |
commit | 87e81feb0726712a50e1f5c75d4bf967971677b1 (patch) | |
tree | d5813a3aa0cb332127a871ec312ff032809a2ac1 /tizen/src | |
parent | 346ee8b1ee5cccd871ba7bc2c0a78c4e98d88748 (diff) | |
download | qemu-87e81feb0726712a50e1f5c75d4bf967971677b1.tar.gz qemu-87e81feb0726712a50e1f5c75d4bf967971677b1.tar.bz2 qemu-87e81feb0726712a50e1f5c75d4bf967971677b1.zip |
gui: delete deprecated SWT GUI
- maru_sdl, maru_shm options
- related source code
Change-Id: I5d2444982753e909170af6b5a15eb688d916eadf
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
Diffstat (limited to 'tizen/src')
324 files changed, 8 insertions, 30592 deletions
diff --git a/tizen/src/Makefile b/tizen/src/Makefile index 7204153755..2b5bbe1974 100755 --- a/tizen/src/Makefile +++ b/tizen/src/Makefile @@ -15,7 +15,7 @@ include ../../config-host.mak TARGET_EXE += TARGET_DSO += -all: qemu skin_client $(TARGET_EXE) $(TARGET_DSO) +all: qemu $(TARGET_EXE) $(TARGET_DSO) qemu: build_info cd ../../ && $(MAKE) qemu_clean: @@ -23,16 +23,6 @@ qemu_clean: qemu_distclean: cd ../../ && $(MAKE) distclean -# Building java skin -skin_client: -ifdef CONFIG_JAVA_UI -ifdef CONFIG_USE_SHM - TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DuseSHM=true -Dswt.path=${SWT_PATH} -buildfile skin/client/build.xml make-jar -else - TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DuseSHM=false -Dswt.path=${SWT_PATH} -buildfile skin/client/build.xml make-jar -endif -endif - build_info: @echo "Generate a build information file" @echo "/* Automatically generated by Makefile - do not modify! */" > build_info.h @@ -70,11 +60,6 @@ ifdef CONFIG_WIN32 cp -pP scripts/emulator.cmd $(EMUL_DIR)/bin endif -# resources and jar for skin -ifdef CONFIG_JAVA_UI - cp -pP skin/client/emulator-skin.jar $(EMUL_DIR)/bin -endif - ifdef CONFIG_QT cp -pP ui/resource/images/display_off_guide.png $(EMUL_DIR)/images cp -pP ui/resource/images/tizen_sdk.png $(EMUL_DIR)/images @@ -118,21 +103,6 @@ ifdef CONFIG_WIN32 cp -pP scripts/tap-uninstall.bat $(EMUL_DIR)/bin endif -# use shared memory for display framebuffer -ifdef CONFIG_USE_SHM -ifdef CONFIG_LINUX - cp -pP skin/client/native_src/libshared.so $(EMUL_DIR)/bin -endif -ifdef CONFIG_DARWIN - cp -pP skin/client/native_src/libshared.dylib $(EMUL_DIR)/bin -endif -endif - -# use GTK for CopyToClipboard on Ubuntu 12.04 64bit -ifdef CONFIG_LINUX - cp -pP skin/client/native_src/clipboard.py $(EMUL_DIR)/bin -endif - else all: @echo "Please call configure before running make!" diff --git a/tizen/src/Makefile.objs b/tizen/src/Makefile.objs index c9fb831f5a..1e18465030 100644 --- a/tizen/src/Makefile.objs +++ b/tizen/src/Makefile.objs @@ -20,12 +20,6 @@ obj-y += ecs/ # tethering obj-y += eventcast/ -# maru display -obj-$(CONFIG_JAVA_UI) += display/ - -# maru skin -obj-$(CONFIG_JAVA_UI) += skin/ - # maru hardware obj-y += hw/ diff --git a/tizen/src/display/Makefile.objs b/tizen/src/display/Makefile.objs deleted file mode 100644 index 92fdb9990b..0000000000 --- a/tizen/src/display/Makefile.objs +++ /dev/null @@ -1,9 +0,0 @@ -obj-y += maru_display.o maru_display_processing.o -obj-$(CONFIG_USE_SHM) += maru_shm.o -obj-$(CONFIG_SDL) += maru_sdl.o maru_sdl_processing.o maru_finger.o - -$(obj)/maru_display.o $(obj)/maru_sdl.o $(obj)/maru_sdl_processing.o $(obj)/maru_finger.o: QEMU_CFLAGS += $(SDL_CFLAGS) - -$(obj)/maru_display.o $(obj)/maru_sdl.o $(obj)/maru_sdl_processing.o $(obj)/maru_display_processing.o: QEMU_CFLAGS += $(LIBPNG_CFLAGS) - -$(obj)/qt5_supplement.o: QEMU_CFLAGS += $(QT_CFLAGS) diff --git a/tizen/src/display/maru_display.c b/tizen/src/display/maru_display.c deleted file mode 100644 index ca631448e8..0000000000 --- a/tizen/src/display/maru_display.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * MARU display driver - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 <png.h> -#include "emulator.h" -#include "maru_display.h" -#include "maru_display_processing.h" -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(tizen, display); - -MaruScreenShot *screenshot; - -static MaruDisplayChangeListener *mdcl; - -static void maru_display_fini(void) -{ - INFO("fini qemu display\n"); - - g_free(screenshot); - - if (mdcl->fini) { - mdcl->fini(); - } - - g_free(mdcl); -} - -static void maru_display_notify_exit(Notifier *notifier, void *data) -{ - maru_display_fini(); -} - -static Notifier maru_display_exit = { .notify = maru_display_notify_exit }; - -void maru_display_init(DisplayState *ds, DisplayType display_type, - int full_screen) -{ - INFO("init qemu display\n"); - - mdcl = g_new0(MaruDisplayChangeListener, 1); - - switch (display_type) { -#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 - case DT_MARU_SHM: - INFO("Display Type: SHM\n"); - maru_shm_pre_init(mdcl); - break; - #endif -#endif - default: - ERR("can not enter here.\n"); - /* can not enter here... */ - break; - } - - screenshot = g_new0(MaruScreenShot, 1); - screenshot->pixels = NULL; - screenshot->request = false; - screenshot->ready = false; - - emulator_add_exit_notifier(&maru_display_exit); -} - -void maru_display_resize(void) -{ - if (mdcl->resize) { - mdcl->resize(); - } -} - -void maru_display_update(void) -{ - if (mdcl->update) { - mdcl->update(); - } -} - -void maru_display_set_invalidate(bool on) -{ - if (mdcl->set_invalidate) { - mdcl->set_invalidate(on); - } -} - -void maru_display_set_interpolation(bool on) -{ - 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) -{ - if (mdcl->surface_init) { - mdcl->surface_init(swt_handle, display_width, - display_height, blank_guide); - } -} - -MaruScreenShot *get_screenshot(void) -{ - return screenshot; -} - -/* save_screenshot() implemented in maruskin_operation.c */ diff --git a/tizen/src/display/maru_display.h b/tizen/src/display/maru_display.h deleted file mode 100644 index 67c9162a2d..0000000000 --- a/tizen/src/display/maru_display.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * MARU display driver - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 __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, DisplayType display_type, - int full_screen); -void maru_display_resize(void); -void maru_display_update(void); -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); - -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); -#endif /* __MARU_DISPLAY_H__ */ diff --git a/tizen/src/display/maru_display_processing.c b/tizen/src/display/maru_display_processing.c deleted file mode 100644 index 9dcd1de285..0000000000 --- a/tizen/src/display/maru_display_processing.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Image Processing - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 "emulator_common.h" -#include "maru_display_processing.h" -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(tizen, dpy_op); - -/* libpng library */ -png_bytep read_png_file(const char *file_name, - unsigned int *width_out, unsigned int *height_out) -{ -#define PNG_HEADER_SIZE 8 - - FILE *fp = NULL; - png_byte header[PNG_HEADER_SIZE] = { 0, }; - png_structp png_ptr = NULL; - - png_infop info_ptr = NULL; - png_uint_32 width = 0; - png_uint_32 height = 0; - png_byte channels = 0; - unsigned int stride = 0; - int bit_depth = 0; - int color_type = 0; - int i = 0; - - png_bytep pixel_data = NULL; - png_bytepp row_ptr_data = NULL; - - if (file_name == NULL) { - ERR("file name is empty\n"); - return NULL; - } - - fp = fopen(file_name, "rb"); - if (fp == NULL) { - ERR("file %s could not be opened\n", file_name); - return NULL; - } - - if (fread(header, sizeof(png_byte), PNG_HEADER_SIZE, fp) != PNG_HEADER_SIZE) { - ERR("failed to read header from png file\n"); - fclose(fp); - return NULL; - } - - if (png_sig_cmp(header, 0, PNG_HEADER_SIZE) != 0) { - ERR("file %s is not recognized as a PNG image\n", file_name); - fclose(fp); - return NULL; - } - - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (png_ptr == NULL) { - ERR("failed to allocate png read struct\n"); - fclose(fp); - return NULL; - } - - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { - ERR("failed to allocate png info struct\n"); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - fclose(fp); - return NULL; - } - - if (setjmp(png_jmpbuf(png_ptr)) != 0) { - ERR("error during init_io\n"); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - png_destroy_info_struct(png_ptr, &info_ptr); - fclose(fp); - return NULL; - } - - png_init_io(png_ptr, fp); - png_set_sig_bytes(png_ptr, PNG_HEADER_SIZE); - - /* read the PNG image information */ - png_read_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, - &width, &height, &bit_depth, &color_type, - NULL, NULL, NULL); - - channels = png_get_channels(png_ptr, info_ptr); - stride = width * bit_depth * channels / 8; - - pixel_data = (png_bytep) g_malloc0(stride * height); - if (pixel_data == NULL) { - ERR("could not allocate data buffer for pixels\n"); - - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - png_destroy_info_struct(png_ptr, &info_ptr); - fclose(fp); - return NULL; - } - - row_ptr_data = (png_bytepp) g_malloc0(sizeof(png_bytep) * height); - if (row_ptr_data == NULL) { - ERR("could not allocate data buffer for row_ptr\n"); - - g_free(pixel_data); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - png_destroy_info_struct(png_ptr, &info_ptr); - fclose(fp); - return NULL; - } - - switch(color_type) { - case PNG_COLOR_TYPE_PALETTE : - png_set_palette_to_rgb(png_ptr); - break; - case PNG_COLOR_TYPE_RGB : - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - /* transparency data for image */ - png_set_tRNS_to_alpha(png_ptr); - } else { - png_set_filter(png_ptr, 0xff, PNG_FILLER_AFTER); - } - break; - case PNG_COLOR_TYPE_RGB_ALPHA : - break; - default : - INFO("png file has an unsupported color type\n"); - break; - } - - for (i = 0; i < height; i++) { - row_ptr_data[i] = pixel_data + (stride * i); - } - - /* read the entire image into memory */ - png_read_image(png_ptr, row_ptr_data); - - /* image information */ - INFO("=== png image file was loaded ===============\n"); - INFO("file path : %s\n", file_name); - INFO("width : %d, height : %d, stride : %d\n", - width, height, stride); - INFO("color type : %d, channels : %d, bit depth : %d\n", - color_type, channels, bit_depth); - INFO("================================================\n"); - - if (width_out != NULL) { - *width_out = (unsigned int) width; - } - if (height_out != NULL) { - *height_out = (unsigned int) height; - } - - g_free(row_ptr_data); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - png_destroy_info_struct(png_ptr, &info_ptr); - fclose(fp); - - return pixel_data; -} diff --git a/tizen/src/display/maru_display_processing.h b/tizen/src/display/maru_display_processing.h deleted file mode 100644 index 11b099c09d..0000000000 --- a/tizen/src/display/maru_display_processing.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Image Processing - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 MARU_DISPLAY_PROCESSING_H_ -#define MARU_DISPLAY_PROCESSING_H_ - -#include <png.h> - -png_bytep read_png_file(const char *file_name, - unsigned int *width_out, unsigned int *height_out); - -#endif /* MARU_DISPLAY_PROCESSING_H_ */ diff --git a/tizen/src/display/maru_finger.c b/tizen/src/display/maru_finger.c deleted file mode 100644 index e73bca5dba..0000000000 --- a/tizen/src/display/maru_finger.c +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Multi-touch point drawing - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 <math.h> -#include <glib.h> -#include <SDL.h> -#include "maru_finger.h" -#include "emul_state.h" -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(qemu, finger); - - -/* ===== Reference: http://content.gpwiki.org/index.php/SDL:Tutorials:Drawing_and_Filling_Circles ===== */ - -/* -* This is a 32-bit pixel function created with help from this -* website: http://www.libsdl.org/intro.en/usingvideo.html -* -* You will need to make changes if you want it to work with -* 8-, 16- or 24-bit surfaces. Consult the above website for -* more information. -*/ -static void sdl_set_pixel(SDL_Surface *surface, int x, int y, Uint32 pixel) -{ - Uint8 *target_pixel = (Uint8 *)surface->pixels + y * surface->pitch + x * 4; - *(Uint32 *)target_pixel = pixel; -} - -/* -* This is an implementation of the Midpoint Circle Algorithm -* found on Wikipedia at the following link: -* -* http://en.wikipedia.org/wiki/Midpoint_circle_algorithm -* -* The algorithm elegantly draws a circle quickly, using a -* set_pixel function for clarity. -*/ -static void sdl_draw_circle(SDL_Surface *surface, - int cx, int cy, int radius, Uint32 pixel) -{ - int error = -radius; - int x = radius; - int y = 0; - - while (x >= y) { - sdl_set_pixel(surface, cx + x, cy + y, pixel); - sdl_set_pixel(surface, cx + y, cy + x, pixel); - - if (x != 0) { - sdl_set_pixel(surface, cx - x, cy + y, pixel); - sdl_set_pixel(surface, cx + y, cy - x, pixel); - } - - if (y != 0) { - sdl_set_pixel(surface, cx + x, cy - y, pixel); - sdl_set_pixel(surface, cx - y, cy + x, pixel); - } - - if (x != 0 && y != 0) { - sdl_set_pixel(surface, cx - x, cy - y, pixel); - sdl_set_pixel(surface, cx - y, cy - x, pixel); - } - - error += y; - ++y; - error += y; - - if (error >= 0) { - --x; - error -= x; - error -= x; - } - } -} - -/* -* SDL_Surface 32-bit circle-fill algorithm without using trig -* -* While I humbly call this "Celdecea's Method", odds are that the -* procedure has already been documented somewhere long ago. All of -* the circle-fill examples I came across utilized trig functions or -* scanning neighbor pixels. This algorithm identifies the width of -* a semi-circle at each pixel height and draws a scan-line covering -* that width. -* -* The code is not optimized but very fast, owing to the fact that it -* alters pixels in the provided surface directly rather than through -* function calls. -* -* WARNING: This function does not lock surfaces before altering, so -* use SDL_LockSurface in any release situation. -*/ -static void sdl_fill_circle(SDL_Surface *surface, - int cx, int cy, int radius, Uint32 pixel) -{ - /* Note that there is more to altering the bitrate of this - * method than just changing this value. See how pixels are - * altered at the following web page for tips: - * http://www.libsdl.org/intro.en/usingvideo.html */ - - const int bpp = 4; - double dy; - - double r = (double)radius; - - for (dy = 1; dy <= r; dy += 1.0) - { - /* This loop is unrolled a bit, only iterating through half of the - * height of the circle. The result is used to draw a scan line and - * its mirror image below it. - * The following formula has been simplified from our original. We - * are using half of the width of the circle because we are provided - * with a center and we need left/right coordinates. */ - - double dx = floor(sqrt((2.0 * r * dy) - (dy * dy))); - int x = cx - dx; - - /* Grab a pointer to the left-most pixel for each half of the circle */ - Uint8 *target_pixel_a = (Uint8 *)surface->pixels + - ((int)(cy + r - dy)) * surface->pitch + x * bpp; - - Uint8 *target_pixel_b = (Uint8 *)surface->pixels + - ((int)(cy - r + dy)) * surface->pitch + x * bpp; - - for ( ; x <= cx + dx; x++) - { - *(Uint32 *)target_pixel_a = pixel; - *(Uint32 *)target_pixel_b = pixel; - target_pixel_a += bpp; - target_pixel_b += bpp; - } - } -} - -/* ==================================================================================================== */ - -void init_multi_touch_state(void) -{ - int i; - MultiTouchState* mts = get_emul_multi_touch_state(); - FingerPoint *finger = NULL; - - INFO("multi-touch state initialization\n"); - - mts->multitouch_enable = 0; - - mts->finger_cnt_max = get_max_touch_point(); - if (mts->finger_cnt_max > MAX_FINGER_CNT) { - mts->finger_cnt_max = MAX_FINGER_CNT; - } - INFO("maxTouchPoint : %d\n", get_max_touch_point()); - - mts->finger_cnt = 0; - - if (mts->finger_slot != NULL) { - g_free(mts->finger_slot); - mts->finger_slot = NULL; - } - mts->finger_slot = - (FingerPoint *) g_malloc0(sizeof(FingerPoint) * mts->finger_cnt_max); - - for (i = 0; i < mts->finger_cnt_max; i++) { - finger = get_finger_point_from_slot(i); - if (finger != NULL) { - finger->origin_x = finger->origin_y = -1; - finger->x = finger->y = -1; - } - } - - mts->finger_point_size = DEFAULT_FINGER_POINT_SIZE; - int finger_point_size_half = mts->finger_point_size / 2; - mts->finger_point_color = DEFAULT_FINGER_POINT_COLOR; - mts->finger_point_outline_color = DEFAULT_FINGER_POINT_OUTLINE_COLOR; - - /* create finger point surface */ - Uint32 rmask, gmask, bmask, amask; -#ifdef HOST_WORDS_BIGENDIAN - rmask = 0xff000000; - gmask = 0x00ff0000; - bmask = 0x0000ff00; - amask = 0x000000ff; -#else - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = 0xff000000; -#endif - - SDL_Surface *point = SDL_CreateRGBSurface(SDL_SRCALPHA | SDL_HWSURFACE, - mts->finger_point_size + 2, mts->finger_point_size + 2, - get_emul_sdl_bpp(), rmask, gmask, bmask, amask); - - /* finger point circle */ - sdl_fill_circle(point, finger_point_size_half, finger_point_size_half, - finger_point_size_half, mts->finger_point_color); - - /* finger point circle outline */ - sdl_draw_circle(point, finger_point_size_half, finger_point_size_half, - finger_point_size_half, mts->finger_point_outline_color); - - mts->finger_point_surface = (void *)point; -} - -int get_finger_cnt(void) -{ - return get_emul_multi_touch_state()->finger_cnt; -} - -int update_finger_point(int index, int origin_x, int origin_y, int x, int y) -{ - FingerPoint *finger = get_finger_point_from_slot(index); - if (finger != NULL) { - if (finger->id == 0) { - /* add new finger point */ - add_new_finger_point(index, origin_x, origin_y, x, y); - } else { - /* update */ - finger->origin_x = origin_x; - finger->origin_y = origin_y; - finger->x = x; - finger->y = y; - } - } - - return get_finger_cnt(); -} - -int add_new_finger_point(int index, int origin_x, int origin_y, int x, int y) -{ - FingerPoint *finger = get_finger_point_from_slot(index); - if (finger != NULL) { - finger->id = index + 1; - finger->origin_x = origin_x; - finger->origin_y = origin_y; - finger->x = x; - finger->y = y; - - get_emul_multi_touch_state()->finger_cnt++; - - INFO("id %d finger point added\n", finger->id); - } - - return get_finger_cnt(); -} - -int remove_finger_point(int index) -{ - FingerPoint *finger = get_finger_point_from_slot(index); - if (finger != NULL && finger->id != 0) { - INFO("id %d finger point removed\n", finger->id); - - get_emul_multi_touch_state()->finger_cnt--; - - finger->id = 0; - finger->origin_x = finger->origin_y = finger->x = finger->y = -1; - } - - return get_finger_cnt(); -} - -FingerPoint *get_finger_point_from_slot(int index) -{ - MultiTouchState *mts = get_emul_multi_touch_state(); - - /* validation for slot index */ - if (index < 0 || index >= mts->finger_cnt_max) { - WARN("invalid index : %d\n", index); - return NULL; - } - - return &(mts->finger_slot[index]); -} - -static bool _calculate_origin_coordinates( - int scaled_display_w, int scaled_display_h, - double scale_factor, int rotaton_type, FingerPoint *finger) -{ - int point_x = 0, point_y = 0; - int rotated_point_x = 0, rotated_point_y = 0; - int flag = 0; - - rotated_point_x = point_x = (int)(finger->x * scale_factor); - rotated_point_y = point_y = (int)(finger->y * scale_factor); - - if (rotaton_type == ROTATION_LANDSCAPE) { - rotated_point_x = point_y; - rotated_point_y = scaled_display_w - point_x; - } else if (rotaton_type == ROTATION_REVERSE_PORTRAIT) { - rotated_point_x = scaled_display_w - point_x; - rotated_point_y = scaled_display_h - point_y; - } else if (rotaton_type == ROTATION_REVERSE_LANDSCAPE) { - rotated_point_x = scaled_display_h - point_y; - rotated_point_y = point_x; - } - - if (finger->origin_x != rotated_point_x) { - finger->origin_x = rotated_point_x; - flag = 1; - } - if (finger->origin_y != rotated_point_y) { - finger->origin_y = rotated_point_y; - flag = 1; - } - - if (flag != 0) { - return true; - } - - return false; -} - -int rearrange_finger_points(int resolution_w, int resolution_h, - double scale_factor, int rotaton_type) -{ - int i = 0; - int count = 0; - MultiTouchState *mts = get_emul_multi_touch_state(); - FingerPoint *finger = NULL; - - if (mts->multitouch_enable == 0) { - return 0; - } - - resolution_w *= scale_factor; - resolution_h *= scale_factor; - - for (i = 0; i < mts->finger_cnt; i++) { - finger = get_finger_point_from_slot(i); - if (finger != NULL && finger->id != 0) { - if (_calculate_origin_coordinates(resolution_w, resolution_h, - scale_factor, rotaton_type, finger) == true) { - count++; - } - } - } - - return count; -} - -void clear_finger_slot(void) -{ - int i = 0; - MultiTouchState *mts = get_emul_multi_touch_state(); - FingerPoint *finger = NULL; - - set_multi_touch_enable(0); - INFO("clear multi-touch\n"); - - for (i = 0; i < mts->finger_cnt; i++) { - finger = get_finger_point_from_slot(i); - if (finger != NULL) { - finger->id = 0; - finger->origin_x = finger->origin_y = finger->x = finger->y = -1; - } - } - - mts->finger_cnt = 0; -} - -void cleanup_multi_touch_state(void) -{ - MultiTouchState *mts = get_emul_multi_touch_state(); - SDL_Surface *point = (SDL_Surface *)mts->finger_point_surface; - - clear_finger_slot(); - g_free(mts->finger_slot); - - mts->finger_point_surface = NULL; - SDL_FreeSurface(point); -} - diff --git a/tizen/src/display/maru_finger.h b/tizen/src/display/maru_finger.h deleted file mode 100644 index e588257f39..0000000000 --- a/tizen/src/display/maru_finger.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Multi-touch point drawing - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 __MARU_FINGER_H__ -#define __MARU_FINGER_H__ - -#include <stdint.h> -#include <stdbool.h> - -/* definitions relating to multi-touch */ -#define MAX_FINGER_CNT 10 -#define DEFAULT_FINGER_POINT_SIZE 32 -#define DEFAULT_FINGER_POINT_COLOR 0x7E0F0F0F -#define DEFAULT_FINGER_POINT_OUTLINE_COLOR 0xDDDDDDDD - -typedef struct FingerPoint { - int id; - int origin_x; - int origin_y; - int x; - int y; -} FingerPoint; - -typedef struct MultiTouchState { - int multitouch_enable; - int finger_cnt; - int finger_cnt_max; - FingerPoint *finger_slot; - - int finger_point_size; - int finger_point_color; - int finger_point_outline_color; - void *finger_point_surface; //SDL_Surface -} MultiTouchState; - - -void init_multi_touch_state(void); -int get_finger_cnt(void); - -int update_finger_point(int index, int origin_x, int origin_y, int x, int y); -int add_new_finger_point(int index, int origin_x, int origin_y, int x, int y); -int remove_finger_point(int index); - -FingerPoint *get_finger_point_from_slot(int index); - -int rearrange_finger_points(int lcd_w, int lcd_h, double scale_factor, int rotaton_type); -void clear_finger_slot(void); -void cleanup_multi_touch_state(void); - -#endif /* __MARU_FINGER_H__ */ diff --git a/tizen/src/display/maru_sdl.c b/tizen/src/display/maru_sdl.c deleted file mode 100644 index bc985579b6..0000000000 --- a/tizen/src/display/maru_sdl.c +++ /dev/null @@ -1,665 +0,0 @@ -/* - * SDL_WINDOWID hack - * - * 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> - * - * 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 <png.h> -#include "qemu/main-loop.h" -#include "emulator.h" -#include "emul_state.h" -#include "maru_display.h" -#include "maru_display_processing.h" -#include "maru_sdl_processing.h" -#include "hw/pci/maru_brightness.h" -#include "debug_ch.h" - -#include "eventcast/encode_fb.h" - -#include <SDL.h> -#ifndef CONFIG_WIN32 -#include <SDL_syswm.h> -#endif - -MULTI_DEBUG_CHANNEL(tizen, sdl); - -static DisplayChangeListener *dcl; - -static QEMUBH *sdl_init_bh; -static QEMUBH *sdl_resize_bh; -static QEMUBH *sdl_update_bh; -static DisplaySurface *dpy_surface; - -static SDL_Surface *surface_screen; -static SDL_Surface *surface_qemu; -static SDL_Surface *scaled_screen; -static SDL_Surface *rotated_screen; -static SDL_Surface *surface_guide; /* blank guide image */ - -static double current_scale_factor = 1.0; -static double current_screen_degree; -static pixman_filter_t sdl_pixman_filter; - -static bool sdl_invalidate; -static int sdl_alteration; - -static unsigned int sdl_skip_update; -static unsigned int sdl_skip_count; - -static bool blank_guide_enable; -static unsigned int blank_cnt; -#define MAX_DPY_BLANK_FRAME_CNT 10 -#define BLANK_GUIDE_IMAGE_PATH "../images/" -#define BLANK_GUIDE_IMAGE_NAME "display_off_guide.png" - -#ifdef SDL_THREAD -QemuMutex sdl_mutex; -QemuCond sdl_cond; -static int sdl_thread_initialized; - -QemuThread sdl_thread; -static bool sdl_thread_exit; -#endif - -#define SDL_FLAGS (SDL_SWSURFACE | SDL_ASYNCBLIT | SDL_NOFRAME) -#define SDL_BPP 32 - -static void qemu_update(void); - -static void qemu_ds_sdl_update(DisplayChangeListener *dcl, - int x, int y, int w, int h) -{ - /* call sdl update */ -#ifdef SDL_THREAD - qemu_mutex_lock(&sdl_mutex); - - qemu_cond_signal(&sdl_cond); - - qemu_mutex_unlock(&sdl_mutex); -#else - qemu_update(); -#endif - - set_display_dirty(true); -} - -static void qemu_ds_sdl_switch(DisplayChangeListener *dcl, - struct DisplaySurface *new_surface) -{ - int console_width = 0, console_height = 0; - - sdl_skip_update = 0; - sdl_skip_count = 0; - - if (!new_surface) { - ERR("qemu_ds_sdl_switch : new_surface is NULL\n"); - return; - } - - console_width = surface_width(new_surface); - console_height = surface_height(new_surface); - - INFO("qemu_ds_sdl_switch : (%d, %d)\n", console_width, console_height); - - /* switch */ - dpy_surface = new_surface; - - if (surface_qemu != NULL) { - SDL_FreeSurface(surface_qemu); - surface_qemu = NULL; - } - - PixelFormat pf = qemu_pixelformat_from_pixman(dpy_surface->format); - - /* create surface_qemu */ - if (console_width == get_display_resolution_width() && - console_height == get_display_resolution_height()) { - INFO("create SDL screen : (%d, %d)\n", - console_width, console_height); - - surface_qemu = SDL_CreateRGBSurfaceFrom( - surface_data(dpy_surface), - console_width, console_height, - surface_bits_per_pixel(dpy_surface), - surface_stride(dpy_surface), - pf.rmask, - pf.gmask, - pf.bmask, - pf.amask); - } else { - INFO("create blank screen : (%d, %d)\n", - get_display_resolution_width(), - get_display_resolution_height()); - - surface_qemu = SDL_CreateRGBSurface( - SDL_SWSURFACE, - console_width, console_height, - surface_bits_per_pixel(dpy_surface), - 0, 0, 0, 0); - } - - if (surface_qemu == NULL) { - ERR("Unable to set the RGBSurface: %s\n", SDL_GetError()); - return; - } -} - -static SDL_Surface *get_blank_guide_image(void) -{ - if (surface_guide == NULL) { - unsigned int width = 0; - unsigned int height = 0; - char *guide_image_path = NULL; - void *guide_image_data = NULL; - - PixelFormat pf = qemu_pixelformat_from_pixman(dpy_surface->format); - - /* load png image */ - int path_len = strlen(get_bin_path()) + - strlen(BLANK_GUIDE_IMAGE_PATH) + - strlen(BLANK_GUIDE_IMAGE_NAME) + 1; - guide_image_path = g_malloc0(sizeof(char) * path_len); - snprintf(guide_image_path, path_len, "%s%s%s", - get_bin_path(), BLANK_GUIDE_IMAGE_PATH, - BLANK_GUIDE_IMAGE_NAME); - - guide_image_data = (void *) read_png_file( - guide_image_path, &width, &height); - - if (guide_image_data != NULL) { - surface_guide = SDL_CreateRGBSurfaceFrom( - guide_image_data, width, height, - get_emul_sdl_bpp(), width * 4, - pf.bmask, - pf.gmask, - pf.rmask, - pf.amask); - } else { - ERR("failed to draw a blank guide image\n"); - } - - g_free(guide_image_path); - } - - return surface_guide; -} - -static void qemu_ds_sdl_refresh(DisplayChangeListener *dcl) -{ - if (sdl_alteration == 1) { - sdl_alteration = 0; - sdl_skip_update = 0; - sdl_skip_count = 0; - } - - /* draw cover image */ - if (sdl_skip_update && display_off) { - if (blank_cnt > MAX_DPY_BLANK_FRAME_CNT) { -#ifdef CONFIG_WIN32 - if (sdl_invalidate && is_skin_enabled()) { - draw_image(surface_screen, get_blank_guide_image()); - } -#endif - - return; - } else if (blank_cnt == MAX_DPY_BLANK_FRAME_CNT) { - if (blank_guide_enable == true && is_skin_enabled()) { - INFO("draw a blank guide image\n"); - - draw_image(surface_screen, get_blank_guide_image()); - } - } else if (blank_cnt == 0) { - /* If the display is turned off, - the screen does not update until the display is turned on */ - INFO("skipping of the display updating is started\n"); - } - - blank_cnt++; - - return; - } else { - if (blank_cnt != 0) { - INFO("skipping of the display updating is ended\n"); - blank_cnt = 0; - } - } - - /* draw framebuffer */ - if (sdl_invalidate) { - graphic_hw_invalidate(NULL); - } - graphic_hw_update(NULL); - - /* Usually, continuously updated. - When the display is turned off, - ten more updates the screen for a black screen. */ - if (display_off) { - if (++sdl_skip_count > 10) { - sdl_skip_update = 1; - } else { - sdl_skip_update = 0; - } - } else { - sdl_skip_count = 0; - sdl_skip_update = 0; - } - -#ifdef TARGET_ARM -#ifdef SDL_THREAD - qemu_mutex_lock(&sdl_mutex); -#endif - - /* - * It is necessary only for exynos4210 FIMD in connection with - * some WM (xfwm4, for example) - */ - - SDL_UpdateRect(surface_screen, 0, 0, 0, 0); - -#ifdef SDL_THREAD - qemu_mutex_unlock(&sdl_mutex); -#endif -#endif -} - -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, -}; - -static void qemu_update(void) -{ - if (sdl_alteration < 0) { - SDL_FreeSurface(scaled_screen); - SDL_FreeSurface(rotated_screen); - SDL_FreeSurface(surface_qemu); - surface_qemu = NULL; - - return; - } - - if (surface_qemu != NULL) { - composite_brightness_image(dpy_surface->image); - - save_screenshot(dpy_surface); - - if (current_scale_factor != 1.0) { - rotated_screen = maru_do_pixman_rotate( - surface_qemu, rotated_screen, - (int)current_screen_degree); - scaled_screen = maru_do_pixman_scale( - rotated_screen, scaled_screen, sdl_pixman_filter); - - SDL_BlitSurface(scaled_screen, NULL, surface_screen, NULL); - } - else {/* current_scale_factor == 1.0 */ - if (current_screen_degree != 0.0) { - 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); - } - } - - /* draw multi-touch finger points */ - MultiTouchState *mts = get_emul_multi_touch_state(); - if (mts->multitouch_enable != 0 && mts->finger_point_surface != NULL) { - int i = 0; - FingerPoint *finger = NULL; - int finger_point_size_half = mts->finger_point_size / 2; - SDL_Rect rect; - - for (i = 0; i < mts->finger_cnt; i++) { - finger = get_finger_point_from_slot(i); - if (finger != NULL && finger->id != 0) { - rect.x = finger->origin_x - finger_point_size_half; - rect.y = finger->origin_y - finger_point_size_half; - rect.w = rect.h = mts->finger_point_size; - - SDL_BlitSurface( - (SDL_Surface *)mts->finger_point_surface, - NULL, surface_screen, &rect); - } - } - } /* end of draw multi-touch */ - } - - SDL_UpdateRect(surface_screen, 0, 0, 0, 0); -} - - -#ifdef SDL_THREAD -static void *run_qemu_update(void *arg) -{ - qemu_mutex_lock(&sdl_mutex); - - while (1) { - qemu_cond_wait(&sdl_cond, &sdl_mutex); - if (sdl_thread_exit) { - INFO("make SDL Thread exit\n"); - break; - } - qemu_update(); - } - - qemu_mutex_unlock(&sdl_mutex); - - INFO("finish qemu_update routine\n"); - return NULL; -} -#endif - -static void maru_sdl_update_bh(void *opaque) -{ - graphic_hw_invalidate(NULL); -} - -static void maru_sdl_resize_bh(void *opaque) -{ - int surface_width = 0, surface_height = 0; - int display_width = 0, display_height = 0; - int temp = 0; - - INFO("Set up a video mode with the specified width, " - "height and bits-per-pixel\n"); - - sdl_alteration = 1; - sdl_skip_update = 0; - -#ifdef SDL_THREAD - qemu_mutex_lock(&sdl_mutex); -#endif - - /* get current setting information and calculate screen size */ - display_width = get_display_resolution_width(); - display_height = get_display_resolution_height(); - current_scale_factor = get_emul_win_scale(); - - short rotaton_type = get_emul_rotation(); - if (rotaton_type == ROTATION_PORTRAIT) { - current_screen_degree = 0.0; - } else if (rotaton_type == ROTATION_LANDSCAPE) { - current_screen_degree = 90.0; - temp = display_width; - display_width = display_height; - display_height = temp; - } else if (rotaton_type == ROTATION_REVERSE_PORTRAIT) { - current_screen_degree = 180.0; - } else if (rotaton_type == ROTATION_REVERSE_LANDSCAPE) { - current_screen_degree = 270.0; - temp = display_width; - display_width = display_height; - display_height = temp; - } - - surface_width = display_width * current_scale_factor; - surface_height = display_height * current_scale_factor; - - surface_screen = SDL_SetVideoMode( - surface_width, surface_height, - get_emul_sdl_bpp(), SDL_FLAGS); - - INFO("SDL_SetVideoMode\n"); - - if (surface_screen == NULL) { - ERR("Could not open SDL display (%dx%dx%d) : %s\n", - surface_width, surface_height, - get_emul_sdl_bpp(), SDL_GetError()); - -#ifdef SDL_THREAD - qemu_mutex_unlock(&sdl_mutex); -#endif - - return; - } - - SDL_UpdateRect(surface_screen, 0, 0, 0, 0); - - /* create buffer for image processing */ - SDL_FreeSurface(scaled_screen); - scaled_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, - surface_width, surface_height, - surface_qemu->format->BitsPerPixel, - 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, - display_width, display_height, - surface_qemu->format->BitsPerPixel, - surface_qemu->format->Rmask, - surface_qemu->format->Gmask, - surface_qemu->format->Bmask, - surface_qemu->format->Amask); - - /* rearrange multi-touch finger points */ - if (get_emul_multi_touch_state()->multitouch_enable != 0) { - rearrange_finger_points( - get_display_resolution_width(), get_display_resolution_height(), - current_scale_factor, rotaton_type); - } - -#ifdef SDL_THREAD - qemu_mutex_unlock(&sdl_mutex); -#endif - - graphic_hw_invalidate(NULL); -} - -static void maru_sdl_init_bh(void *opaque) -{ - INFO("SDL_Init\n"); - - if (SDL_Init(SDL_INIT_VIDEO) < 0) { - ERR("unable to init SDL: %s\n", SDL_GetError()); - // TODO: - } - -#ifndef CONFIG_WIN32 - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - SDL_GetWMInfo(&info); -#endif - - sdl_resize_bh = qemu_bh_new(maru_sdl_resize_bh, NULL); - sdl_update_bh = qemu_bh_new(maru_sdl_update_bh, NULL); - qemu_bh_schedule(sdl_resize_bh); - -#ifdef SDL_THREAD - if (sdl_thread_initialized == 0) { - sdl_thread_initialized = 1; - - INFO("sdl update thread create\n"); - - sdl_thread_exit = false; - qemu_thread_create(&sdl_thread, "sdl-workthread", run_qemu_update, - NULL, QEMU_THREAD_JOINABLE); - } -#endif -} - -static void maru_sdl_quit(void) -{ - INFO("maru sdl quit\n"); - - if (surface_guide != NULL) { - g_free(surface_guide->pixels); - SDL_FreeSurface(surface_guide); - } - - /* remove multi-touch finger points */ - cleanup_multi_touch_state(); - - if (sdl_init_bh != NULL) { - qemu_bh_delete(sdl_init_bh); - } - if (sdl_resize_bh != NULL) { - qemu_bh_delete(sdl_resize_bh); - } - - sdl_alteration = -1; - -#ifdef SDL_THREAD - qemu_mutex_lock(&sdl_mutex); -#endif - - SDL_Quit(); - -#ifdef SDL_THREAD - sdl_thread_exit = true; - qemu_cond_signal(&sdl_cond); - qemu_mutex_unlock(&sdl_mutex); - - INFO("join SDL thread\n"); - qemu_thread_join(&sdl_thread); - - INFO("destroy cond and mutex of SDL thread\n"); - qemu_cond_destroy(&sdl_cond); - qemu_mutex_destroy(&sdl_mutex); -#endif - - unregister_displaychangelistener(dcl); - g_free(dcl); -} - -static void maru_sdl_resize(void) -{ - INFO("maru sdl resize\n"); - - if (sdl_resize_bh != NULL) { - qemu_bh_schedule(sdl_resize_bh); - } -} - -static void maru_sdl_update(void) -{ - if (sdl_update_bh != NULL) { - qemu_bh_schedule(sdl_update_bh); - } -} - -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_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) -{ - dcl = g_malloc0(sizeof(DisplayChangeListener)); - dcl->ops = &dcl_ops; - - 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); - -#ifdef SDL_THREAD - qemu_mutex_init(&sdl_mutex); - qemu_cond_init(&sdl_cond); -#endif - - register_displaychangelistener(dcl); -} - -bool maru_extract_framebuffer(void *buffer) -{ - uint32_t buffer_size = 0; - - if (!buffer) { - ERR("given buffer is null\n"); - return false; - } - - if (!surface_qemu) { - ERR("surface_qemu is null\n"); - return false; - } - - composite_brightness_image(dpy_surface->image); - - buffer_size = surface_stride(dpy_surface) * surface_height(dpy_surface); - TRACE("extract framebuffer %d\n", buffer_size); - - memcpy(buffer, surface_data(dpy_surface), buffer_size); - return true; -} diff --git a/tizen/src/display/maru_sdl.h b/tizen/src/display/maru_sdl.h deleted file mode 100644 index 9fa2f645b6..0000000000 --- a/tizen/src/display/maru_sdl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SDL_WINDOWID hack - * - * 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> - * - * 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 MARU_SDL_H_ -#define MARU_SDL_H_ - -#include "ui/console.h" -#include "maru_display.h" - -void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl); - -#endif /* MARU_SDL_H_ */ diff --git a/tizen/src/display/maru_sdl_processing.c b/tizen/src/display/maru_sdl_processing.c deleted file mode 100644 index 9ca0ba3f3f..0000000000 --- a/tizen/src/display/maru_sdl_processing.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Image Processing - * - * Copyright (C) 2011 - 2014 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> - * SangHo Park <sangho1206.park@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 "maru_sdl_processing.h" -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(tizen, sdl_op); - - -SDL_Surface *maru_do_pixman_scale(SDL_Surface *rz_src, - SDL_Surface *rz_dst, - pixman_filter_t filter) -{ - 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, filter, 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; -} - -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: - ERR("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_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 draw_image(SDL_Surface *screen, SDL_Surface *image) -{ - if (screen == NULL || image == NULL) { - return; - } - - int dst_x = 0; int dst_y = 0; - int dst_w = 0; int dst_h = 0; - - int margin_w = screen->w - image->w; - int margin_h = screen->h - image->h; - - if (margin_w < 0 || margin_h < 0) { - /* guide image scaling */ - int margin = (margin_w < margin_h)? margin_w : margin_h; - dst_w = image->w + margin; - dst_h = image->h + margin; - - SDL_Surface *scaled_image = SDL_CreateRGBSurface( - SDL_SWSURFACE, dst_w, dst_h, - image->format->BitsPerPixel, - image->format->Rmask, image->format->Gmask, - image->format->Bmask, image->format->Amask); - - scaled_image = maru_do_pixman_scale( - image, scaled_image, PIXMAN_FILTER_BEST); - - dst_x = (screen->w - dst_w) / 2; - dst_y = (screen->h - dst_h) / 2; - SDL_Rect dst_rect = { dst_x, dst_y, dst_w, dst_h }; - - SDL_BlitSurface(scaled_image, NULL, screen, &dst_rect); - SDL_UpdateRect(screen, 0, 0, 0, 0); - - SDL_FreeSurface(scaled_image); - } else { - dst_w = image->w; - dst_h = image->h; - dst_x = (screen->w - dst_w) / 2; - dst_y = (screen->h - dst_h) / 2; - SDL_Rect dst_rect = { dst_x, dst_y, dst_w, dst_h }; - - SDL_BlitSurface(image, NULL, screen, &dst_rect); - SDL_UpdateRect(screen, 0, 0, 0, 0); - } -} diff --git a/tizen/src/display/maru_sdl_processing.h b/tizen/src/display/maru_sdl_processing.h deleted file mode 100644 index 51fbbddc74..0000000000 --- a/tizen/src/display/maru_sdl_processing.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Image Processing - * - * Copyright (C) 2011 - 2014 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> - * SangHo Park <sangho1206.park@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 MARU_SDL_PROCESSING_H_ -#define MARU_SDL_PROCESSING_H_ - -#include <SDL.h> -#include "ui/console.h" - -SDL_Surface *maru_do_pixman_scale(SDL_Surface *src, SDL_Surface *dst, pixman_filter_t filter); -SDL_Surface *maru_do_pixman_rotate(SDL_Surface *src, SDL_Surface *dst, int angle); - -void draw_image(SDL_Surface *screen, SDL_Surface *image); - -#endif /* MARU_SDL_PROCESSING_H_ */ diff --git a/tizen/src/display/maru_shm.c b/tizen/src/display/maru_shm.c deleted file mode 100644 index 3efa780df4..0000000000 --- a/tizen/src/display/maru_shm.c +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Shared memory - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 <sys/types.h> -#include <sys/ipc.h> -#include <sys/shm.h> - -#include <png.h> -#include "qemu/main-loop.h" -#include "qemu/error-report.h" - -#include "maru_display.h" -#include "emul_state.h" -#include "maru_display_processing.h" -#include "hw/pci/maru_brightness.h" -#include "skin/maruskin_server.h" -#include "debug_ch.h" - -#include "eventcast/encode_fb.h" - -MULTI_DEBUG_CHANNEL(tizen, shm); - -static DisplayChangeListener *dcl; - -static DisplaySurface *dpy_surface; -static void *shared_memory = (void *) 0; -static int skin_shmid; -static bool is_fit_console_size; - -static int shm_skip_update; -static int shm_skip_count; - -static bool blank_guide_enable; -static int blank_cnt; -#define MAX_DPY_BLANK_FRAME_CNT 10 - -extern QemuMutex mutex_draw_display; -extern int draw_display_state; - -//#define INFO_FRAME_DROP_RATE -#ifdef INFO_FRAME_DROP_RATE -static unsigned int draw_frame; -static unsigned int drop_frame; -#endif - -static void qemu_ds_shm_update(DisplayChangeListener *dcl, - int x, int y, int w, int h) -{ - if (shared_memory != NULL) { - qemu_mutex_lock(&mutex_draw_display); - - if (draw_display_state == 0) { - draw_display_state = 1; - - qemu_mutex_unlock(&mutex_draw_display); - - if (is_fit_console_size == true) { - composite_brightness_image(dpy_surface->image); - - save_screenshot(dpy_surface); - - memcpy(shared_memory, - surface_data(dpy_surface), - surface_stride(dpy_surface) * - surface_height(dpy_surface)); - } else { - int shm_size = - get_display_resolution_width() * - get_display_resolution_height() * 4; - memset(shared_memory, 0x00, (size_t)shm_size); - } - -#ifdef INFO_FRAME_DROP_RATE - draw_frame++; -#endif - notify_draw_frame(); - } else { -#ifdef INFO_FRAME_DROP_RATE - drop_frame++; -#endif - qemu_mutex_unlock(&mutex_draw_display); - } - -#ifdef INFO_FRAME_DROP_RATE - INFO("! frame drop rate = (%d/%d)\n", - drop_frame, draw_frame + drop_frame); -#endif - } - - set_display_dirty(true); -} - -static void qemu_ds_shm_switch(DisplayChangeListener *dcl, - struct DisplaySurface *new_surface) -{ - int console_width = 0, console_height = 0; - - shm_skip_update = 0; - shm_skip_count = 0; - - if (!new_surface) { - ERR("qemu_ds_shm_switch : new_surface is NULL\n"); - return; - } - - dpy_surface = new_surface; - console_width = surface_width(new_surface); - console_height = surface_height(new_surface); - - INFO("qemu_ds_shm_switch : (%d, %d)\n", - console_width, console_height); - - if (console_width == get_display_resolution_width() && - console_height == get_display_resolution_height()) { - is_fit_console_size = true; - } -} - -static void qemu_ds_shm_refresh(DisplayChangeListener *dcl) -{ - /* If the display is turned off, - the screen does not update until the it is turned on */ - if (shm_skip_update && display_off) { - if (blank_cnt > MAX_DPY_BLANK_FRAME_CNT) { - /* do nothing */ - return; - } else if (blank_cnt == MAX_DPY_BLANK_FRAME_CNT) { - if (blank_guide_enable == true) { - INFO("draw a blank guide image\n"); - - if (is_skin_enabled()) { - /* draw guide image */ - notify_draw_blank_guide(); - } - } - } else if (blank_cnt == 0) { - INFO("skipping of the display updating is started\n"); - } - - blank_cnt++; - - return; - } else { - if (blank_cnt != 0) { - INFO("skipping of the display updating is ended\n"); - blank_cnt = 0; - } - } - - graphic_hw_update(NULL); - - /* Usually, continuously updated. - But when the display is turned off, - ten more updates the surface for a black screen. */ - if (display_off) { - if (++shm_skip_count > 10) { - shm_skip_update = 1; - } else { - shm_skip_update = 0; - } - } else { - shm_skip_count = 0; - shm_skip_update = 0; - } -} - -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, -}; - -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 = 0; - } - - 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 { - INFO("number of current attaches = %d\n", - (int)shm_info.shm_nattch); - } - - unregister_displaychangelistener(dcl); - g_free(dcl); -} - -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) -{ - blank_guide_enable = blank_guide; - - INFO("maru shm init\n"); - - set_emul_sdl_bpp(32); - - if (blank_guide_enable == true) { - INFO("blank guide is on\n"); - } - - /* byte */ - int shm_size = - get_display_resolution_width() * - get_display_resolution_height() * 4; - - /* base + 1 = sdb port */ - /* base + 2 = shared memory key */ - int mykey = get_emul_vm_base_port() + 2; - - INFO("shared memory key: %d, size: %d bytes\n", mykey, shm_size); - - /* make a shared framebuffer */ - skin_shmid = shmget((key_t)mykey, (size_t)shm_size, 0666 | IPC_CREAT); - if (skin_shmid == -1) { - ERR("shmget failed\n"); - perror("maru_vga: "); - - error_report("Cannot launch this VM." - "Failed to get identifier of the shared memory segment."); - exit(1); - } - - shared_memory = shmat(skin_shmid, (void*)0, 0); - if (shared_memory == (void *)-1) { - ERR("shmat failed\n"); - perror("maru_vga: "); - - error_report("Cannot launch this VM. " - "Failed to attach the shared memory segment."); - exit(1); - } - - /* default screen */ - memset(shared_memory, 0x00, (size_t)shm_size); - INFO("Memory attached at 0x%X\n", (int)shared_memory); -} - -void maru_shm_pre_init(MaruDisplayChangeListener *mdcl) -{ - dcl = g_malloc0(sizeof(DisplayChangeListener)); - dcl->ops = &dcl_ops; - - mdcl->surface_init = maru_shm_init; - mdcl->fini = maru_shm_quit; - - mdcl->resize = maru_shm_resize; - - register_displaychangelistener(dcl); -} - -bool maru_extract_framebuffer(void *buffer) -{ - uint32_t buffer_size = 0; - - if (!buffer) { - ERR("given buffer is null\n"); - return false; - } - - composite_brightness_image(dpy_surface->image); - - buffer_size = surface_stride(dpy_surface) * surface_height(dpy_surface); - TRACE("extract framebuffer %d\n", buffer_size); - - memcpy(buffer, surface_data(dpy_surface), buffer_size); - return true; -} diff --git a/tizen/src/display/maru_shm.h b/tizen/src/display/maru_shm.h deleted file mode 100644 index 14eb281971..0000000000 --- a/tizen/src/display/maru_shm.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Shared memory - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 MARU_SHM_H_ -#define MARU_SHM_H_ - -#include "ui/console.h" -#include "maru_display.h" - -void maru_shm_pre_init(MaruDisplayChangeListener *mdcl); - -#endif /* MARU_SHM_H_ */ diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index 3962298767..ef382b5b60 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -58,11 +58,6 @@ extern bool hax_allowed; #include "hw/virtio/maru_virtio_touchscreen.h" #include "hw/virtio/maru_virtio_evdi.h" #include "util/net_helper.h" - -#ifdef CONFIG_JAVA_UI -#include "skin/maruskin_server.h" -#endif - #include "util/new_debug_ch.h" DECLARE_DEBUG_CHANNEL(emul_state); @@ -71,24 +66,9 @@ DECLARE_DEBUG_CHANNEL(emul_state); #define HTTP_PROXY_PREFIX "http_proxy=" #define HOST_IP_PREFIX "host_ip=" -static EmulatorConfigInfo _emul_info = {0,}; +static EmulatorConfigInfo _emul_info; static EmulatorConfigState _emul_state; -/* sdl bits per pixel */ -void set_emul_sdl_bpp(int bpp) -{ - _emul_info.sdl_bpp = bpp; - - if (_emul_info.sdl_bpp != 32) { - LOG_INFO("sdl bpp : %d\n", _emul_info.sdl_bpp); - } -} - -int get_emul_sdl_bpp(void) -{ - return _emul_info.sdl_bpp; -} - void set_emul_guest_ip(char *ip) { strncpy(_emul_info.guest_ip, ip, strlen(ip)); @@ -149,63 +129,20 @@ 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; } -/* emulator window scale */ -void set_emul_win_scale(double scale_factor) -{ - if (scale_factor < 0.0 || scale_factor > 2.0) { - LOG_INFO("scale_factor is out of range : %f\n", scale_factor); - scale_factor = 1.0; - } - - _emul_state.scale_factor = scale_factor; - LOG_INFO("emulator window scale_factor : %f\n", _emul_state.scale_factor); -} - -double get_emul_win_scale(void) -{ - return _emul_state.scale_factor; -} - -/* emulator rotation */ -void set_emul_rotation(short rotation_type) -{ - if (rotation_type < ROTATION_PORTRAIT || - rotation_type > ROTATION_REVERSE_LANDSCAPE) { - LOG_INFO("rotation type is out of range : %d\n", rotation_type); - rotation_type = ROTATION_PORTRAIT; - } - - _emul_state.rotation_type = rotation_type; - LOG_INFO("emulator rotation type : %d\n", _emul_state.rotation_type); -} - -short get_emul_rotation(void) -{ - return _emul_state.rotation_type; -} - /* emulator multi-touch */ -MultiTouchState *get_emul_multi_touch_state(void) -{ - return &(_emul_state.qemu_mts); -} - void set_multi_touch_enable(int mode) { - _emul_state.qemu_mts.multitouch_enable = mode; + _emul_state.multitouch_enable = mode; } int get_multi_touch_enable(void) { - return _emul_state.qemu_mts.multitouch_enable; + return _emul_state.multitouch_enable; } /* retrieves the status of the host lock key */ @@ -779,28 +716,6 @@ const char *get_sdcard_image_path(void) int initial_resolution_width = -1; int initial_resolution_height = -1; -#ifdef CONFIG_JAVA_UI -static void set_resolution_legacy(void) -{ - char *resolution = get_variable("display_resolution"); - if (!resolution) { - error_report("variable [display_resolution] is required."); - exit(1); - } - char **splitted = g_strsplit(resolution, "x", 2); - if (!splitted[0] || !splitted[1]) { - error_report("resolution value [%s] is weird. Please use format \"WIDTHxHEIGHT\"", resolution); - g_strfreev(splitted); - exit(1); - } - else { - set_initial_display_resolution(g_ascii_strtoull(splitted[0], NULL, 0), - g_ascii_strtoull(splitted[1], NULL, 0)); - } - g_strfreev(splitted); -} -#endif - void set_initial_display_resolution(int width, int height) { LOG_INFO("initial display resolution: %dx%d\n", width, height); @@ -811,53 +726,14 @@ void set_initial_display_resolution(int width, int height) int get_display_resolution_width(void) { -#ifndef CONFIG_JAVA_UI return qemu_console_get_width(NULL, initial_resolution_width); -#else - if (display_type == DT_MARU_QT_ONSCREEN || - display_type == DT_MARU_QT_OFFSCREEN) { - return qemu_console_get_width(NULL, -1); - } - if (initial_resolution_width == -1) { - set_resolution_legacy(); - } - // for JAVA_UI - return initial_resolution_width; -#endif } int get_display_resolution_height(void) { -#ifndef CONFIG_JAVA_UI return qemu_console_get_height(NULL, initial_resolution_height); -#else - if (display_type == DT_MARU_QT_ONSCREEN || - display_type == DT_MARU_QT_OFFSCREEN) { - return qemu_console_get_height(NULL, -1); - } - if (initial_resolution_height == -1) { - set_resolution_legacy(); - } - // for JAVA_UI - return initial_resolution_height; -#endif } -#ifdef CONFIG_JAVA_UI -/* skin enabled */ -static bool skin_enabled = true; - -void set_skin_enabled(bool enabled) -{ - skin_enabled = enabled; -} - -bool is_skin_enabled(void) -{ - return skin_enabled; -} -#endif - static void emul_state_notify_exit(Notifier *notifier, void *data) { g_free((void *)launch_conf_file); diff --git a/tizen/src/emul_state.h b/tizen/src/emul_state.h index bcdc04e8d9..dcaad447c9 100644 --- a/tizen/src/emul_state.h +++ b/tizen/src/emul_state.h @@ -33,9 +33,7 @@ #ifndef __EMUL_STATE_H__ #define __EMUL_STATE_H__ -#include "config-host.h" - -#include "display/maru_finger.h" +#include "emulator_common.h" #include "hw/maru_device_ids.h" #define MAX_ADDR_LEN 256 @@ -78,22 +76,12 @@ enum { KEY_RELEASED = 2, }; -/* keep it consistent with emulator-skin definition */ -enum { - ROTATION_PORTRAIT = 0, - ROTATION_LANDSCAPE = 1, - ROTATION_REVERSE_PORTRAIT = 2, - ROTATION_REVERSE_LANDSCAPE = 3, -}; - enum { HOST_CAPSLOCK_KEY = 1, HOST_NUMLOCK_KEY = 2, }; typedef struct EmulatorConfigInfo { - int sdl_bpp; - char guest_ip[16]; char host_ip[16]; @@ -103,11 +91,9 @@ typedef struct EmulatorConfigInfo { } EmulatorConfigInfo; typedef struct EmulatorConfigState { - int emulator_condition; //TODO : enum + int emulator_condition; int emuld_condition; - double scale_factor; - short rotation_type; - MultiTouchState qemu_mts; + int multitouch_enable; int qemu_caps_lock; int qemu_num_lock; /* add here */ @@ -117,13 +103,10 @@ typedef struct EmulatorConfigState { } EmulatorConfigState; /* setter */ -void set_emul_win_scale(double scale); -void set_emul_sdl_bpp(int bpp); void set_emul_guest_ip(char *ip); void set_emul_host_ip(char *ip); void set_emulator_condition(int state); -void set_emul_rotation(short rotation_type); void set_emul_caps_lock_state(int state); void set_emul_num_lock_state(int state); void set_emul_tap_enable(bool enable); @@ -131,13 +114,10 @@ void set_emuld_connection(bool connected); void set_sdb_connection(bool connected); /* getter */ -double get_emul_win_scale(void); -int get_emul_sdl_bpp(void); const char* get_emul_skin_path(void); bool get_emul_cpu_accel(void); int get_emulator_condition(void); -short get_emul_rotation(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); @@ -150,7 +130,6 @@ bool get_sdb_connection(void); int get_max_touch_point(void); /* multi-touch */ -MultiTouchState *get_emul_multi_touch_state(void); void set_multi_touch_enable(int mode); int get_multi_touch_enable(void); @@ -190,10 +169,6 @@ int get_vm_spice_port(void); void set_initial_display_resolution(int width, int height); int get_display_resolution_width(void); int get_display_resolution_height(void); -#ifdef CONFIG_JAVA_UI -void set_skin_enabled(bool enabled); -bool is_skin_enabled(void); -#endif void init_emul_state(void); #endif /* __EMUL_STATE_H__ */ diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 0e1277989b..bbb3726c68 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -47,11 +47,6 @@ #include "util/device_hotplug.h" #include "util/exported_strings.h" -#ifdef CONFIG_JAVA_UI -#include "skin/maruskin_server.h" -#include "skin/maruskin_client.h" -#endif - #ifdef CONFIG_QT #include <qt5_supplement.h> #endif @@ -73,10 +68,6 @@ char *maru_kernel_cmdline; char tizen_target_path[PATH_MAX]; -#if defined(CONFIG_JAVA_UI) -int _skin_argc; -char **_skin_argv; -#endif int _qemu_argc; char **_qemu_argv; @@ -85,42 +76,12 @@ void emulator_add_exit_notifier(Notifier *notify) qemu_add_exit_notifier(notify); } -#if defined(CONFIG_JAVA_UI) -static void construct_main_window(bool skin_enabled, - int skin_argc, char *skin_argv[], - int qemu_argc, char *qemu_argv[]) -{ - LOG_INFO("construct main window\n"); - - start_skin_server(skin_argc, skin_argv, qemu_argc, qemu_argv); - - set_emul_caps_lock_state(0); - set_emul_num_lock_state(0); - - set_skin_enabled(skin_enabled); - - /* do not start skin client process if skin is disabled*/ - /* the next line checks for debugging and etc.. */ - if (skin_enabled) { - if (0 > start_skin_client(skin_argc, skin_argv)) { - error_report(FAILED_TO_INITIALIZE_SKIN); - exit(1); - } - } -} -#endif - static void emulator_notify_exit(Notifier *notifier, void *data) { int i; for (i = 0; i < _qemu_argc; ++i) { g_free(_qemu_argv[i]); } -#if defined(CONFIG_JAVA_UI) - for (i = 0; i < _skin_argc; ++i) { - g_free(_skin_argv[i]); - } -#endif reset_variables(); LOG_INFO("Exit emulator...\n"); @@ -245,16 +206,6 @@ static void print_options_info(void) } fprintf(stdout, "\n====================================================\n"); -#if defined(CONFIG_JAVA_UI) - if (_skin_argc > 0) { - fprintf(stdout, "skin args: =========================================\n"); - for (i = 0; i < _skin_argc; ++i) { - fprintf(stdout, "%s ", _skin_argv[i]); - } - fprintf(stdout, "\n====================================================\n"); - } -#endif - fflush(stdout); } @@ -297,16 +248,6 @@ void prepare_maru_after_device_init(void) get_vm_data_path(); } -#if defined(CONFIG_JAVA_UI) -void start_skin(bool skin_enabled) -{ - LOG_INFO("Start skin\n"); - - construct_main_window(skin_enabled, - _skin_argc, _skin_argv, _qemu_argc, _qemu_argv); -} -#endif - #ifdef CONFIG_COCOA int cocoa_main(int argc, const char * argv[]); #else @@ -319,9 +260,6 @@ static int emulator_main(int argc, char *argv[], char **envp) int qemu_arg_index = 0; _qemu_argv = g_malloc(sizeof(char*) * ARGS_LIMIT); -#if defined(CONFIG_JAVA_UI) - _skin_argv = g_malloc(sizeof(char*) * ARGS_LIMIT); -#endif // parse arguments // prevent the error message for undefined options @@ -373,27 +311,10 @@ static int emulator_main(int argc, char *argv[], char **envp) return -1; } - // assemble arguments for qemu and skin -#ifdef SUPPORT_SKIN_OPTIONS - if (!assemble_emulator_args(&_qemu_argc, _qemu_argv, - &_skin_argc, _skin_argv)) { - return -1; - } -#else + // assemble arguments for qemu if (!assemble_emulator_args(&_qemu_argc, _qemu_argv)) { return -1; } - #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()); - _skin_argv[_skin_argc++] = - g_strdup_printf("resolution=%s", get_variable("resolution")); - _skin_argv[_skin_argc++] = - g_strdup_printf("vm.path=%s/%s", - get_variable("vms_path"), get_variable("vm_name")); - #endif -#endif } // if "--qemu" is specified, we should respect specified args diff --git a/tizen/src/emulator.h b/tizen/src/emulator.h index 496a4ebc40..a48c083348 100644 --- a/tizen/src/emulator.h +++ b/tizen/src/emulator.h @@ -48,8 +48,4 @@ void print_system_info(void); void emulator_add_exit_notifier(Notifier *notify); void qemu_system_graceful_shutdown_request(unsigned int sec); -#if defined(CONFIG_JAVA_UI) -void start_skin(bool skin_enabled); -#endif - #endif /* __EMULATOR_H__ */ diff --git a/tizen/src/emulator_common.h b/tizen/src/emulator_common.h index 1e0ea8d913..f365614abf 100644 --- a/tizen/src/emulator_common.h +++ b/tizen/src/emulator_common.h @@ -68,18 +68,4 @@ #endif #endif -#define JAVA_MAX_COMMAND_LENGTH 1024 - -#ifdef CONFIG_JAVA_UI -#define JAR_SKINFILE "emulator-skin.jar" -#define JAVA_LIBRARY_PATH "-Djava.library.path" -#define JAVA_SIMPLEMODE_OPTION "simple.msg" -#define JAVA_EXEFILE_PATH "java" -#ifndef CONFIG_DARWIN -#define JAVA_EXEOPTION "-jar" -#else -#define JAVA_EXEOPTION "-XstartOnFirstThread -jar" // Must start the Java window on the first thread on Mac -#endif -#endif - #endif /* __EMULATOR_COMMON_H__ */ diff --git a/tizen/src/emulator_options.c b/tizen/src/emulator_options.c index 2fcbce4dfb..19f823c7fc 100644 --- a/tizen/src/emulator_options.c +++ b/tizen/src/emulator_options.c @@ -52,9 +52,6 @@ struct emulator_opts { }; static struct emulator_opts default_qemu_opts; -#ifdef SUPPORT_SKIN_OPTIONS -static struct emulator_opts default_skin_opts; -#endif void set_variable(const char * const arg1, const char * const arg2, bool override) @@ -132,11 +129,6 @@ static void reset_default_opts(void) for (i = 0; i < default_qemu_opts.num; ++i) { g_free(default_qemu_opts.options[i]); } -#ifdef SUPPORT_SKIN_OPTIONS - for (i = 0; i < default_skin_opts.num; ++i) { - g_free(default_skin_opts.options[i]); - } -#endif } static char *substitute_variables(const char *src, bool recursive) @@ -284,13 +276,6 @@ bool load_conf(const char * const conf) classification = 1; continue; } -#ifdef SUPPORT_SKIN_OPTIONS - else if (!g_strcmp0(token, "[[SKIN_OPTIONS]]")) { - default_opts = &default_skin_opts; - classification = 2; - continue; - } -#endif // process line switch (classification) { @@ -311,9 +296,6 @@ bool load_conf(const char * const conf) break; } case 1: // qemu options -#ifdef SUPPORT_SKIN_OPTIONS - case 2: // skin options -#endif default_opts->options[default_opts->num++] = g_strdup(token); break; @@ -376,25 +358,6 @@ static bool assemble_args(int *argc, char **argv, return true; } -#ifdef SUPPORT_SKIN_OPTIONS -bool assemble_emulator_args(int *qemu_argc, char **qemu_argv, - int *skin_argc, char **skin_argv) -{ - if (!assemble_args(qemu_argc, qemu_argv, - &default_qemu_opts)) { - reset_default_opts(); - return false; - } - if (!assemble_args(skin_argc, skin_argv, - &default_skin_opts)) { - reset_default_opts(); - return false; - } - - reset_default_opts(); - return true; -} -#else bool assemble_emulator_args(int *qemu_argc, char **qemu_argv) { if (!assemble_args(qemu_argc, qemu_argv, @@ -406,4 +369,3 @@ bool assemble_emulator_args(int *qemu_argc, char **qemu_argv) reset_default_opts(); return true; } -#endif diff --git a/tizen/src/emulator_options.h b/tizen/src/emulator_options.h index 40396c6a2a..4e4538e02e 100644 --- a/tizen/src/emulator_options.h +++ b/tizen/src/emulator_options.h @@ -31,21 +31,10 @@ #include "emulator_common.h" -// "SKIN_OPTIONS" field is deprecated -// but it still can be used -#if defined(CONFIG_JAVA_UI) - #define SUPPORT_SKIN_OPTIONS -#endif - void set_variable(const char * const arg1, const char * const arg2, bool override); const char *get_variable(const char * const name); void reset_variables(void); bool load_conf(const char * const conf); -#ifdef SUPPORT_SKIN_OPTIONS -bool assemble_emulator_args(int *qemu_argc, char **qemu_argv, - int *skin_argc, char **skin_argv); -#else bool assemble_emulator_args(int *qemu_argc, char **qemu_argv); -#endif #endif /* __EMULATOR_OPTIONS_H__ */ diff --git a/tizen/src/eventcast/encode_fb.c b/tizen/src/eventcast/encode_fb.c index 78c48527c9..39cde9de4a 100644 --- a/tizen/src/eventcast/encode_fb.c +++ b/tizen/src/eventcast/encode_fb.c @@ -46,13 +46,11 @@ DECLARE_DEBUG_CHANNEL(eventcast); -#if !defined(CONFIG_JAVA_UI) bool maru_extract_framebuffer(void *buffer) { LOG_INFO("SDL or SHM module is not enabled"); return false; } -#endif #ifdef CONFIG_WEBP /* diff --git a/tizen/src/hw/pci/maru_brightness.c b/tizen/src/hw/pci/maru_brightness.c index 7be99fc717..39c761eab7 100644 --- a/tizen/src/hw/pci/maru_brightness.c +++ b/tizen/src/hw/pci/maru_brightness.c @@ -40,10 +40,6 @@ MULTI_DEBUG_CHANNEL(tizen, brightness); -#ifdef CONFIG_JAVA_UI -#include "skin/maruskin_server.h" -#endif - #define QEMU_DEV_NAME "maru-brightness" #define BRIGHTNESS_MEM_SIZE (4 * 1024) /* 4KB */ @@ -77,10 +73,6 @@ uint8_t brightness_tbl[] = {155, /* level 0 : for dimming */ /* level 81 ~ 90 */ 29, 27, 26, 24, 23, 21, 20, 18, 17, 15, /* level 91 ~ 99 */ 14, 12, 11, 9, 8, 6, 5, 3, 2, 0}; -#ifdef CONFIG_JAVA_UI -QEMUBH *display_bh = NULL; -#endif - /* Image processing functions using the pixman library */ void composite_brightness_image(pixman_image_t *dst_image) { @@ -183,11 +175,6 @@ static void brightness_reg_write(void *opaque, maru_pixman_image_set_alpha(brightness_tbl[brightness_level]); } -#ifdef CONFIG_JAVA_UI - /* notify to skin process */ - qemu_bh_schedule(display_bh); -#endif - return; default: ERR("wrong brightness register write - addr : %d\n", (int)addr); @@ -203,11 +190,6 @@ static const MemoryRegionOps brightness_mmio_ops = { static void brightness_exitfn(PCIDevice *dev) { -#ifdef CONFIG_JAVA_UI - if (display_bh) { - qemu_bh_delete(display_bh); - } -#endif if (brightness_image) { pixman_image_unref(brightness_image); brightness_image = NULL; @@ -216,13 +198,6 @@ static void brightness_exitfn(PCIDevice *dev) INFO("finalize maru-brightness device\n"); } -#ifdef CONFIG_JAVA_UI -static void maru_display_bh(void *opaque) -{ - notify_display_power(!display_off); -} -#endif - static int brightness_initfn(PCIDevice *dev) { BrightnessState *s = DO_UPCAST(BrightnessState, dev, dev); @@ -236,9 +211,6 @@ static int brightness_initfn(PCIDevice *dev) "maru-brightness-mmio", BRIGHTNESS_REG_SIZE); pci_register_bar(&s->dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio_addr); -#ifdef CONFIG_JAVA_UI - display_bh = qemu_bh_new(maru_display_bh, s); -#endif brightness_level = BRIGHTNESS_MAX; level_color.alpha = 0x0000; level_color.red = 0x0000; diff --git a/tizen/src/hw/virtio/maru_virtio_esm.c b/tizen/src/hw/virtio/maru_virtio_esm.c index 20566c4911..068e17c8c1 100644 --- a/tizen/src/hw/virtio/maru_virtio_esm.c +++ b/tizen/src/hw/virtio/maru_virtio_esm.c @@ -33,10 +33,6 @@ MULTI_DEBUG_CHANNEL(qemu, esm); -#ifdef CONFIG_JAVA_UI -#include "skin/maruskin_server.h" -#endif - #define SYSTEM_MODE_LAYER 1 #define USER_MODE_LAYER 0 static uint8_t boot_complete; @@ -80,23 +76,14 @@ static void virtio_esm_handle(VirtIODevice *vdev, VirtQueue *vq) progress.percentage, progress.mode == 's' || progress.mode == 'S' ? "system mode" : "user mode"); - /* notify to skin */ if (progress.mode == 's' || progress.mode == 'S') { if (progress.percentage >= 100) { boot_complete |= (1 << SYSTEM_MODE_LAYER); } - -#ifdef CONFIG_JAVA_UI - notify_booting_progress(SYSTEM_MODE_LAYER, progress.percentage); -#endif } else { if (progress.percentage >= 100) { boot_complete |= (1 << USER_MODE_LAYER); } - -#ifdef CONFIG_JAVA_UI - notify_booting_progress(USER_MODE_LAYER, progress.percentage); -#endif } /* booting complete check */ diff --git a/tizen/src/skin/Makefile.objs b/tizen/src/skin/Makefile.objs deleted file mode 100644 index 4825f204d7..0000000000 --- a/tizen/src/skin/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += maruskin_client.o maruskin_server.o -obj-y += maruskin_operation.o -obj-y += maruskin_keymap.o diff --git a/tizen/src/skin/client/.classpath b/tizen/src/skin/client/.classpath deleted file mode 100644 index fb93363cc1..0000000000 --- a/tizen/src/skin/client/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="jaxb_src"/> - <classpathentry kind="src" path="resource"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="lib" path="lib/swt.jar" sourcepath="lib/src.zip"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/tizen/src/skin/client/.project b/tizen/src/skin/client/.project deleted file mode 100644 index cdb4a9e099..0000000000 --- a/tizen/src/skin/client/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>EmulatorSkin</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/tizen/src/skin/client/.settings/org.eclipse.core.resources.prefs b/tizen/src/skin/client/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/tizen/src/skin/client/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/<project>=UTF-8 diff --git a/tizen/src/skin/client/build.xml b/tizen/src/skin/client/build.xml deleted file mode 100644 index 8be8e7d5dd..0000000000 --- a/tizen/src/skin/client/build.xml +++ /dev/null @@ -1,152 +0,0 @@ -<?xml version="1.0" standalone="yes"?> -<project name="emulator-skin" basedir="." default="make-jar"> - <condition property="isWindows"> - <os family="windows" /> - </condition> - <condition property="isLinux"> - <and> - <os family="unix" /> - <not><os family="mac" /></not> - </and> - </condition> - <condition property="isMac"> - <and> - <os family="mac" /> - <!-- we don't support legacy mac --> - <and><os family="unix" /></and> - </and> - </condition> - - <property environment="env" /> - <property name="jar.file" value="emulator-skin.jar" /> - <property name="mainclass" value="org.tizen.emulator.skin.EmulatorSkinMain" /> - - <property name="swt.file" value="swt.jar" /> - - <path id="classpath"> - <pathelement location="${env.TIZEN_SDK_DEV_PATH}/distrib/swt_4.3/${swt.file}" /> - <pathelement location="lib/${swt.file}" /> - <pathelement location="build/" /> - <pathelement location="${swt.path}/${swt.file}" /> - </path> - - <target name="clean"> - <echo message="cleaning..." /> - <delete dir="build" /> - <delete file="${jar.file}" /> - </target> - - <target name="make-properties"> - <echo message="make properties..." /> - <tstamp> - <format property="build_time" pattern="yyyyMMdd-HHmm" timezone="GMT+9" locale="en" /> - </tstamp> - <exec executable="cat" outputproperty="version"> - <arg value="../../VERSION" /> - </exec> - <exec executable="git" outputproperty="build_git_commit" failifexecutionfails="false"> - <arg value="rev-parse" /> - <arg value="--short" /> - <arg value="HEAD" /> - </exec> - <propertyfile file="src/about.properties" comment="Auto-generated properties - DO NOT EDIT"> - <entry key="version" value="${version}" /> - <entry key="build_time" value="${build_time}" /> - <entry key="build_git_commit" value="${build_git_commit}" /> - </propertyfile> - </target> - - <target name="prepare-compile" depends="make-properties"> - <echo message="prepare for compile..." /> - <delete dir="build" /> - <mkdir dir="build" /> - </target> - - <target name="compile" depends="prepare-compile"> - <echo message="compiling..." /> - <javac encoding="UTF-8" fork="true" srcdir="src:jaxb_src" destdir="build" debug="on" memorymaximumsize="128m"> - <classpath refid="classpath" /> - </javac> - </target> - - <target name="create-jar"> - <echo message="creating jar..." /> - <mkdir dir="build/icons" /> - <copy todir="build/icons"> - <fileset dir="resource/icons" /> - </copy> - <copy todir="build/images"> - <fileset dir="resource/images" /> - </copy> - <jar jarfile="${jar.file}" basedir="build" duplicate="add"> - <fileset file="src/about.properties" /> - <manifest> - <attribute name="Main-Class" value="${mainclass}" /> - <attribute name="Class-path" value="${swt.file}" /> - </manifest> - </jar> - <delete dir="build" /> - </target> - - <condition property="isLinuxSHM"> - <and> - <isTrue value="${isLinux}" /> - <isTrue value="${useSHM}" /> - </and> - </condition> - - <target name="create-native-linux" if="${isLinuxSHM}"> - <echo message="create native shared library on linux..." /> - <javah destdir="native_src"> - <classpath refid="classpath" /> - <class name="org.tizen.emulator.skin.EmulatorShmSkin" /> - </javah> - <echo message="build libshared.so" /> - <exec dir="native_src" executable="gcc" failifexecutionfails="false"> - <arg line="-c" /> - <arg line="-fPIC" /> - <arg line="share.c" /> - <arg line="-o" /> - <arg line="shared.o" /> - <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}" /> - <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}/linux" /> - </exec> - <exec dir="native_src" executable="gcc" failifexecutionfails="false"> - <arg line="shared.o" /> - <arg line="-shared" /> - <arg line="-o" /> - <arg line="libshared.so" /> - </exec> - <delete> - <fileset dir="native_src" includes="**/*.h" /> - </delete> - </target> - - <target name="create-native-mac" if="isMac"> - <echo message="create native shared library on mac..." /> - <javah destdir="native_src"> - <classpath refid="classpath" /> - <class name="org.tizen.emulator.skin.EmulatorShmSkin" /> - </javah> - <exec dir="native_src" executable="cc" failifexecutionfails="false"> - <arg line="-mmacosx-version-min=10.4" /> - <arg line="-c" /> - <arg line="share.c" /> - <arg line="-o" /> - <arg line="share.o" /> - <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}" /> - <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}/darwin" /> - </exec> - <exec dir="native_src" executable="cc" failifexecutionfails="false"> - <arg line="-dynamiclib" /> - <arg line="share.o" /> - <arg line="-o" /> - <arg line="libshared.dylib" /> - </exec> - <delete> - <fileset dir="native_src" includes="**/*.h" /> - </delete> - </target> - - <target name="make-jar" depends="compile, create-native-linux, create-native-mac, create-jar" /> -</project> diff --git a/tizen/src/skin/client/dev/.skin.properties b/tizen/src/skin/client/dev/.skin.properties deleted file mode 100644 index 077f3332b5..0000000000 --- a/tizen/src/skin/client/dev/.skin.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Automatically generated by emulator skin. -#Tue Mar 27 16:56:00 KST 2012 -window.y=50 -window.x=100 -window.scale=50 -window.rotate=0 diff --git a/tizen/src/skin/client/dev/.skinconfig.properties b/tizen/src/skin/client/dev/.skinconfig.properties deleted file mode 100644 index 224e847610..0000000000 --- a/tizen/src/skin/client/dev/.skinconfig.properties +++ /dev/null @@ -1,11 +0,0 @@ -########################################## -### Emulator Skin system configuration ### -########################################## - -# heartbeat ignore setting -# ( true:ignore heartbeat operation in Skin, false:do heartbeat operation in Skin ) -test.hb.ignore=false - -# log level -# ( trace/debug/warn/error ) -log.level=trace diff --git a/tizen/src/skin/client/dev/dbi-sample.xml b/tizen/src/skin/client/dev/dbi-sample.xml deleted file mode 100644 index 529d17661f..0000000000 --- a/tizen/src/skin/client/dev/dbi-sample.xml +++ /dev/null @@ -1,180 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <rotations> - <rotation id="0" name="Portrait"> - <lcd id="0"> - <region height="800" left="35" top="86" width="480"/> - </lcd> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region height="74" left="238" top="887" width="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region height="74" left="541" top="819" width="20"/> - <eventInfo> - <keyCode>103</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_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region height="74" left="541" top="167" width="20"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation id="1" 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 height="74" left="887" top="249" width="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region height="20" left="818" top="2" width="74"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region height="20" left="80" top="2" width="74"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region height="20" left="165" top="2" width="74"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation id="2" 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="249" top="14" width="74" height="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="2" top="84" width="20" height="74"/> - <eventInfo> - <keyCode>103</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_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="2" top="735" width="20" height="74"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation id="3" 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="239" width="74" height="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="84" top="539" width="74" height="20"/> - <eventInfo> - <keyCode>103</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_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="735" top="539" width="74" height="20"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <colors> - <hoverColor B="255" G="255" R="255" /> - </colors> -</EmulatorUI> diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/DisplayType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/DisplayType.java deleted file mode 100644 index 7851bf2e65..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/DisplayType.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2014.12.22 at 07:46:39 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for displayType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="displayType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="region" type="{http://www.tizen.org/emulator/skin/dbi}regionType"/> - * <element name="maskImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="rotaryImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </all> - * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "displayType", propOrder = { - -}) -public class DisplayType { - - @XmlElement(required = true) - protected RegionType region; - protected String maskImage; - protected String rotaryImage; - @XmlAttribute(name = "id", required = true) - protected int id; - - /** - * Gets the value of the region property. - * - * @return - * possible object is - * {@link RegionType } - * - */ - public RegionType getRegion() { - return region; - } - - /** - * Sets the value of the region property. - * - * @param value - * allowed object is - * {@link RegionType } - * - */ - public void setRegion(RegionType value) { - this.region = value; - } - - /** - * Gets the value of the maskImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMaskImage() { - return maskImage; - } - - /** - * Sets the value of the maskImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMaskImage(String value) { - this.maskImage = value; - } - - /** - * Gets the value of the rotaryImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRotaryImage() { - return rotaryImage; - } - - /** - * Sets the value of the rotaryImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRotaryImage(String value) { - this.rotaryImage = value; - } - - /** - * Gets the value of the id property. - * - */ - public int getId() { - return id; - } - - /** - * Sets the value of the id property. - * - */ - public void setId(int value) { - this.id = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/EmulatorUI.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/EmulatorUI.java deleted file mode 100644 index 6abf1b343f..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/EmulatorUI.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2014.12.22 at 07:36:35 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for anonymous complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="dbi_version" type="{http://www.w3.org/2001/XMLSchema}float"/> - * <element name="layer" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="rotations" type="{http://www.tizen.org/emulator/skin/dbi}rotationsType"/> - * <element name="hover" type="{http://www.tizen.org/emulator/skin/dbi}hoverType" minOccurs="0"/> - * <element name="popupMenu" type="{http://www.tizen.org/emulator/skin/dbi}popupMenuType" minOccurs="0"/> - * <element name="option" type="{http://www.tizen.org/emulator/skin/dbi}optionType" minOccurs="0"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - -}) -@XmlRootElement(name = "EmulatorUI") -public class EmulatorUI { - - @XmlElement(name = "dbi_version") - protected float dbiVersion; - protected String layer; - @XmlElement(required = true) - protected RotationsType rotations; - protected HoverType hover; - protected PopupMenuType popupMenu; - protected OptionType option; - - /** - * Gets the value of the dbiVersion property. - * - */ - public float getDbiVersion() { - return dbiVersion; - } - - /** - * Sets the value of the dbiVersion property. - * - */ - public void setDbiVersion(float value) { - this.dbiVersion = value; - } - - /** - * Gets the value of the layer property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLayer() { - return layer; - } - - /** - * Sets the value of the layer property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLayer(String value) { - this.layer = value; - } - - /** - * Gets the value of the rotations property. - * - * @return - * possible object is - * {@link RotationsType } - * - */ - public RotationsType getRotations() { - return rotations; - } - - /** - * Sets the value of the rotations property. - * - * @param value - * allowed object is - * {@link RotationsType } - * - */ - public void setRotations(RotationsType value) { - this.rotations = value; - } - - /** - * Gets the value of the hover property. - * - * @return - * possible object is - * {@link HoverType } - * - */ - public HoverType getHover() { - return hover; - } - - /** - * Sets the value of the hover property. - * - * @param value - * allowed object is - * {@link HoverType } - * - */ - public void setHover(HoverType value) { - this.hover = value; - } - - /** - * Gets the value of the popupMenu property. - * - * @return - * possible object is - * {@link PopupMenuType } - * - */ - public PopupMenuType getPopupMenu() { - return popupMenu; - } - - /** - * Sets the value of the popupMenu property. - * - * @param value - * allowed object is - * {@link PopupMenuType } - * - */ - public void setPopupMenu(PopupMenuType value) { - this.popupMenu = value; - } - - /** - * Gets the value of the option property. - * - * @return - * possible object is - * {@link OptionType } - * - */ - public OptionType getOption() { - return option; - } - - /** - * Sets the value of the option property. - * - * @param value - * allowed object is - * {@link OptionType } - * - */ - public void setOption(OptionType value) { - this.option = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/EventInfoType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/EventInfoType.java deleted file mode 100644 index ee302a643b..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/EventInfoType.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for eventInfoType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="eventInfoType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="keyCode" type="{http://www.w3.org/2001/XMLSchema}int"/> - * <element name="keyName" type="{http://www.w3.org/2001/XMLSchema}string"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "eventInfoType", propOrder = { - -}) -public class EventInfoType { - - protected int keyCode; - @XmlElement(required = true) - protected String keyName; - - /** - * Gets the value of the keyCode property. - * - */ - public int getKeyCode() { - return keyCode; - } - - /** - * Sets the value of the keyCode property. - * - */ - public void setKeyCode(int value) { - this.keyCode = value; - } - - /** - * Gets the value of the keyName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getKeyName() { - return keyName; - } - - /** - * Sets the value of the keyName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKeyName(String value) { - this.keyName = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/HoverType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/HoverType.java deleted file mode 100644 index ced0d34d79..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/HoverType.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for hoverType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="hoverType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="color" type="{http://www.tizen.org/emulator/skin/dbi}rgbType" minOccurs="0"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "hoverType", propOrder = { - -}) -public class HoverType { - - protected RgbType color; - - /** - * Gets the value of the color property. - * - * @return - * possible object is - * {@link RgbType } - * - */ - public RgbType getColor() { - return color; - } - - /** - * Sets the value of the color property. - * - * @param value - * allowed object is - * {@link RgbType } - * - */ - public void setColor(RgbType value) { - this.color = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ImageListType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ImageListType.java deleted file mode 100644 index 302ec979a0..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ImageListType.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for imageListType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="imageListType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="mainImage" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="keyPressedImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "imageListType", propOrder = { - -}) -public class ImageListType { - - @XmlElement(required = true) - protected String mainImage; - protected String keyPressedImage; - - /** - * Gets the value of the mainImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMainImage() { - return mainImage; - } - - /** - * Sets the value of the mainImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMainImage(String value) { - this.mainImage = value; - } - - /** - * Gets the value of the keyPressedImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getKeyPressedImage() { - return keyPressedImage; - } - - /** - * Sets the value of the keyPressedImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKeyPressedImage(String value) { - this.keyPressedImage = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/KeyMapListType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/KeyMapListType.java deleted file mode 100644 index fa0f701b2d..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/KeyMapListType.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for keyMapListType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="keyMapListType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="keyMap" type="{http://www.tizen.org/emulator/skin/dbi}keyMapType" maxOccurs="unbounded" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "keyMapListType", propOrder = { - "keyMap" -}) -public class KeyMapListType { - - protected List<KeyMapType> keyMap; - - /** - * Gets the value of the keyMap property. - * - * <p> - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a <CODE>set</CODE> method for the keyMap property. - * - * <p> - * For example, to add a new item, do as follows: - * <pre> - * getKeyMap().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list - * {@link KeyMapType } - * - * - */ - public List<KeyMapType> getKeyMap() { - if (keyMap == null) { - keyMap = new ArrayList<KeyMapType>(); - } - return this.keyMap; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/KeyMapType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/KeyMapType.java deleted file mode 100644 index 64e9b32004..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/KeyMapType.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for keyMapType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="keyMapType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="region" type="{http://www.tizen.org/emulator/skin/dbi}regionType"/> - * <element name="eventInfo" type="{http://www.tizen.org/emulator/skin/dbi}eventInfoType" minOccurs="0"/> - * <element name="tooltip" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "keyMapType", propOrder = { - "region", - "eventInfo", - "tooltip" -}) -public class KeyMapType { - - @XmlElement(required = true) - protected RegionType region; - protected EventInfoType eventInfo; - protected String tooltip; - - /** - * Gets the value of the region property. - * - * @return - * possible object is - * {@link RegionType } - * - */ - public RegionType getRegion() { - return region; - } - - /** - * Sets the value of the region property. - * - * @param value - * allowed object is - * {@link RegionType } - * - */ - public void setRegion(RegionType value) { - this.region = value; - } - - /** - * Gets the value of the eventInfo property. - * - * @return - * possible object is - * {@link EventInfoType } - * - */ - public EventInfoType getEventInfo() { - return eventInfo; - } - - /** - * Sets the value of the eventInfo property. - * - * @param value - * allowed object is - * {@link EventInfoType } - * - */ - public void setEventInfo(EventInfoType value) { - this.eventInfo = value; - } - - /** - * Gets the value of the tooltip property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTooltip() { - return tooltip; - } - - /** - * Sets the value of the tooltip property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTooltip(String value) { - this.tooltip = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/MenuItemType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/MenuItemType.java deleted file mode 100644 index e79d6b44b4..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/MenuItemType.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 04:55:34 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for menuItemType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="menuItemType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" /> - * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "menuItemType") -public class MenuItemType { - - @XmlAttribute(name = "itemName") - protected String itemName; - @XmlAttribute(name = "visible") - protected Boolean visible; - - /** - * Gets the value of the itemName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getItemName() { - if (itemName == null) { - return ""; - } else { - return itemName; - } - } - - /** - * Sets the value of the itemName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItemName(String value) { - this.itemName = value; - } - - /** - * Gets the value of the visible property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isVisible() { - if (visible == null) { - return true; - } else { - return visible; - } - } - - /** - * Sets the value of the visible property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setVisible(Boolean value) { - this.visible = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ObjectFactory.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ObjectFactory.java deleted file mode 100644 index 8aca4a8011..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ObjectFactory.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.11.20 at 02:29:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.tizen.emulator.skin.dbi package. - * <p>An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.tizen.emulator.skin.dbi - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link ScaleItemType } - * - */ - public ScaleItemType createScaleItemType() { - return new ScaleItemType(); - } - - /** - * Create an instance of {@link OptionType } - * - */ - public OptionType createOptionType() { - return new OptionType(); - } - - /** - * Create an instance of {@link EmulatorUI } - * - */ - public EmulatorUI createEmulatorUI() { - return new EmulatorUI(); - } - - /** - * Create an instance of {@link RotationsType } - * - */ - public RotationsType createRotationsType() { - return new RotationsType(); - } - - /** - * Create an instance of {@link HoverType } - * - */ - public HoverType createHoverType() { - return new HoverType(); - } - - /** - * Create an instance of {@link PopupMenuType } - * - */ - public PopupMenuType createPopupMenuType() { - return new PopupMenuType(); - } - - /** - * Create an instance of {@link EventInfoType } - * - */ - public EventInfoType createEventInfoType() { - return new EventInfoType(); - } - - /** - * Create an instance of {@link RotationType } - * - */ - public RotationType createRotationType() { - return new RotationType(); - } - - /** - * Create an instance of {@link KeyMapListType } - * - */ - public KeyMapListType createKeyMapListType() { - return new KeyMapListType(); - } - - /** - * Create an instance of {@link KeyMapType } - * - */ - public KeyMapType createKeyMapType() { - return new KeyMapType(); - } - - /** - * Create an instance of {@link RegionType } - * - */ - public RegionType createRegionType() { - return new RegionType(); - } - - /** - * Create an instance of {@link RgbType } - * - */ - public RgbType createRgbType() { - return new RgbType(); - } - - /** - * Create an instance of {@link DisplayType } - * - */ - public DisplayType createDisplayType() { - return new DisplayType(); - } - - /** - * Create an instance of {@link MenuItemType } - * - */ - public MenuItemType createMenuItemType() { - return new MenuItemType(); - } - - /** - * Create an instance of {@link ImageListType } - * - */ - public ImageListType createImageListType() { - return new ImageListType(); - } - - /** - * Create an instance of {@link ScaleItemType.FactorItem } - * - */ - public ScaleItemType.FactorItem createScaleItemTypeFactorItem() { - return new ScaleItemType.FactorItem(); - } - - /** - * Create an instance of {@link OptionType.BlankGuide } - * - */ - public OptionType.BlankGuide createOptionTypeBlankGuide() { - return new OptionType.BlankGuide(); - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/OptionType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/OptionType.java deleted file mode 100644 index eb498d83a6..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/OptionType.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.11.20 at 02:29:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for optionType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="optionType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="blankGuide" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "optionType", propOrder = { - -}) -public class OptionType { - - protected OptionType.BlankGuide blankGuide; - - /** - * Gets the value of the blankGuide property. - * - * @return - * possible object is - * {@link OptionType.BlankGuide } - * - */ - public OptionType.BlankGuide getBlankGuide() { - return blankGuide; - } - - /** - * Sets the value of the blankGuide property. - * - * @param value - * allowed object is - * {@link OptionType.BlankGuide } - * - */ - public void setBlankGuide(OptionType.BlankGuide value) { - this.blankGuide = value; - } - - - /** - * <p>Java class for anonymous complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class BlankGuide { - - @XmlAttribute(name = "visible") - protected Boolean visible; - - /** - * Gets the value of the visible property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isVisible() { - if (visible == null) { - return true; - } else { - return visible; - } - } - - /** - * Sets the value of the visible property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setVisible(Boolean value) { - this.visible = value; - } - - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/PopupMenuType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/PopupMenuType.java deleted file mode 100644 index 2cd497c03e..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/PopupMenuType.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2014.06.17 at 03:54:23 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for popupMenuType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="popupMenuType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="topmostItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="rotateItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="scaleItem" type="{http://www.tizen.org/emulator/skin/dbi}scaleItemType" minOccurs="0"/> - * <element name="keywindowItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="hostKeyboardItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="ramdumpItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="shellItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="controlPanelItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="forceCloseItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * <element name="closeItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "popupMenuType", propOrder = { - -}) -public class PopupMenuType { - - protected MenuItemType topmostItem; - protected MenuItemType rotateItem; - protected ScaleItemType scaleItem; - protected MenuItemType keywindowItem; - protected MenuItemType hostKeyboardItem; - protected MenuItemType ramdumpItem; - protected MenuItemType shellItem; - protected MenuItemType controlPanelItem; - protected MenuItemType forceCloseItem; - protected MenuItemType closeItem; - - /** - * Gets the value of the topmostItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getTopmostItem() { - return topmostItem; - } - - /** - * Sets the value of the topmostItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setTopmostItem(MenuItemType value) { - this.topmostItem = value; - } - - /** - * Gets the value of the rotateItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getRotateItem() { - return rotateItem; - } - - /** - * Sets the value of the rotateItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setRotateItem(MenuItemType value) { - this.rotateItem = value; - } - - /** - * Gets the value of the scaleItem property. - * - * @return - * possible object is - * {@link ScaleItemType } - * - */ - public ScaleItemType getScaleItem() { - return scaleItem; - } - - /** - * Sets the value of the scaleItem property. - * - * @param value - * allowed object is - * {@link ScaleItemType } - * - */ - public void setScaleItem(ScaleItemType value) { - this.scaleItem = value; - } - - /** - * Gets the value of the keywindowItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getKeywindowItem() { - return keywindowItem; - } - - /** - * Sets the value of the keywindowItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setKeywindowItem(MenuItemType value) { - this.keywindowItem = value; - } - - /** - * Gets the value of the hostKeyboardItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getHostKeyboardItem() { - return hostKeyboardItem; - } - - /** - * Sets the value of the hostKeyboardItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setHostKeyboardItem(MenuItemType value) { - this.hostKeyboardItem = value; - } - - /** - * Gets the value of the ramdumpItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getRamdumpItem() { - return ramdumpItem; - } - - /** - * Sets the value of the ramdumpItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setRamdumpItem(MenuItemType value) { - this.ramdumpItem = value; - } - - /** - * Gets the value of the shellItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getShellItem() { - return shellItem; - } - - /** - * Sets the value of the shellItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setShellItem(MenuItemType value) { - this.shellItem = value; - } - - /** - * Gets the value of the controlPanelItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getControlPanelItem() { - return controlPanelItem; - } - - /** - * Sets the value of the controlPanelItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setControlPanelItem(MenuItemType value) { - this.controlPanelItem = value; - } - - /** - * Gets the value of the forceCloseItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getForceCloseItem() { - return forceCloseItem; - } - - /** - * Sets the value of the forceCloseItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setForceCloseItem(MenuItemType value) { - this.forceCloseItem = value; - } - - /** - * Gets the value of the closeItem property. - * - * @return - * possible object is - * {@link MenuItemType } - * - */ - public MenuItemType getCloseItem() { - return closeItem; - } - - /** - * Sets the value of the closeItem property. - * - * @param value - * allowed object is - * {@link MenuItemType } - * - */ - public void setCloseItem(MenuItemType value) { - this.closeItem = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java deleted file mode 100644 index 9a6cd3a271..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java +++ /dev/null @@ -1,205 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.29 at 04:58:23 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for regionType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="regionType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="left" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="top" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="width" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="height" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="update" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "regionType") -public class RegionType { - - @XmlAttribute(name = "left") - protected Integer left; - @XmlAttribute(name = "top") - protected Integer top; - @XmlAttribute(name = "width") - protected Integer width; - @XmlAttribute(name = "height") - protected Integer height; - @XmlAttribute(name = "update") - protected Boolean update; - - /** - * Gets the value of the left property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getLeft() { - return left; - } - - /** - * Sets the value of the left property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setLeft(Integer value) { - this.left = value; - } - - /** - * Gets the value of the top property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getTop() { - return top; - } - - /** - * Sets the value of the top property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setTop(Integer value) { - this.top = value; - } - - /** - * Gets the value of the width property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getWidth() { - return width; - } - - /** - * Sets the value of the width property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setWidth(Integer value) { - this.width = value; - } - - /** - * Gets the value of the height property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getHeight() { - return height; - } - - /** - * Sets the value of the height property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setHeight(Integer value) { - this.height = value; - } - - /** - * Gets the value of the update property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isUpdate() { - if (update == null) { - return false; - } else { - return update; - } - } - - /** - * Sets the value of the update property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setUpdate(Boolean value) { - this.update = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java deleted file mode 100644 index 3a6abf2539..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for rgbType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rgbType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="R" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" /> - * <attribute name="G" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" /> - * <attribute name="B" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rgbType") -public class RgbType { - - @XmlAttribute(name = "R") - @XmlSchemaType(name = "unsignedInt") - protected Long r; - @XmlAttribute(name = "G") - @XmlSchemaType(name = "unsignedInt") - protected Long g; - @XmlAttribute(name = "B") - @XmlSchemaType(name = "unsignedInt") - protected Long b; - - /** - * Gets the value of the r property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getR() { - return r; - } - - /** - * Sets the value of the r property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setR(Long value) { - this.r = value; - } - - /** - * Gets the value of the g property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getG() { - return g; - } - - /** - * Sets the value of the g property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setG(Long value) { - this.g = value; - } - - /** - * Gets the value of the b property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getB() { - return b; - } - - /** - * Sets the value of the b property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setB(Long value) { - this.b = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationNameType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationNameType.java deleted file mode 100644 index 4959ceb300..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationNameType.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for rotationNameType. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * <p> - * <pre> - * <simpleType name="rotationNameType"> - * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> - * <enumeration value="Portrait"/> - * <enumeration value="Landscape"/> - * <enumeration value="Reverse Portrait"/> - * <enumeration value="Reverse Landscape"/> - * </restriction> - * </simpleType> - * </pre> - * - */ -@XmlType(name = "rotationNameType") -@XmlEnum -public enum RotationNameType { - - @XmlEnumValue("Portrait") - PORTRAIT("Portrait"), - @XmlEnumValue("Landscape") - LANDSCAPE("Landscape"), - @XmlEnumValue("Reverse Portrait") - REVERSE_PORTRAIT("Reverse Portrait"), - @XmlEnumValue("Reverse Landscape") - REVERSE_LANDSCAPE("Reverse Landscape"); - private final String value; - - RotationNameType(String v) { - value = v; - } - - public String value() { - return value; - } - - public static RotationNameType fromValue(String v) { - for (RotationNameType c: RotationNameType.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationType.java deleted file mode 100644 index 1289703387..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationType.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for rotationType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rotationType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="display" type="{http://www.tizen.org/emulator/skin/dbi}displayType"/> - * <element name="imageList" type="{http://www.tizen.org/emulator/skin/dbi}imageListType"/> - * <element name="keyMapList" type="{http://www.tizen.org/emulator/skin/dbi}keyMapListType"/> - * </sequence> - * <attribute name="name" use="required" type="{http://www.tizen.org/emulator/skin/dbi}rotationNameType" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rotationType", propOrder = { - "display", - "imageList", - "keyMapList" -}) -public class RotationType { - - @XmlElement(required = true) - protected DisplayType display; - @XmlElement(required = true) - protected ImageListType imageList; - @XmlElement(required = true) - protected KeyMapListType keyMapList; - @XmlAttribute(name = "name", required = true) - protected RotationNameType name; - - /** - * Gets the value of the display property. - * - * @return - * possible object is - * {@link DisplayType } - * - */ - public DisplayType getDisplay() { - return display; - } - - /** - * Sets the value of the display property. - * - * @param value - * allowed object is - * {@link DisplayType } - * - */ - public void setDisplay(DisplayType value) { - this.display = value; - } - - /** - * Gets the value of the imageList property. - * - * @return - * possible object is - * {@link ImageListType } - * - */ - public ImageListType getImageList() { - return imageList; - } - - /** - * Sets the value of the imageList property. - * - * @param value - * allowed object is - * {@link ImageListType } - * - */ - public void setImageList(ImageListType value) { - this.imageList = value; - } - - /** - * Gets the value of the keyMapList property. - * - * @return - * possible object is - * {@link KeyMapListType } - * - */ - public KeyMapListType getKeyMapList() { - return keyMapList; - } - - /** - * Sets the value of the keyMapList property. - * - * @param value - * allowed object is - * {@link KeyMapListType } - * - */ - public void setKeyMapList(KeyMapListType value) { - this.keyMapList = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link RotationNameType } - * - */ - public RotationNameType getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link RotationNameType } - * - */ - public void setName(RotationNameType value) { - this.name = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationsType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationsType.java deleted file mode 100644 index 63ee8437eb..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RotationsType.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for rotationsType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rotationsType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="rotation" type="{http://www.tizen.org/emulator/skin/dbi}rotationType" maxOccurs="unbounded"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rotationsType", propOrder = { - "rotation" -}) -public class RotationsType { - - @XmlElement(required = true) - protected List<RotationType> rotation; - - /** - * Gets the value of the rotation property. - * - * <p> - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a <CODE>set</CODE> method for the rotation property. - * - * <p> - * For example, to add a new item, do as follows: - * <pre> - * getRotation().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list - * {@link RotationType } - * - * - */ - public List<RotationType> getRotation() { - if (rotation == null) { - rotation = new ArrayList<RotationType>(); - } - return this.rotation; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ScaleItemType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ScaleItemType.java deleted file mode 100644 index a1ed3afe39..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ScaleItemType.java +++ /dev/null @@ -1,249 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.11.20 at 02:29:25 PM KST -// - - -package org.tizen.emulator.skin.dbi; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - - -/** - * <p>Java class for scaleItemType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="scaleItemType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="factorItem" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>int"> - * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" /> - * </extension> - * </simpleContent> - * </complexType> - * </element> - * </sequence> - * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" /> - * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "scaleItemType", propOrder = { - "factorItem" -}) -public class ScaleItemType { - - protected List<ScaleItemType.FactorItem> factorItem; - @XmlAttribute(name = "itemName") - protected String itemName; - @XmlAttribute(name = "visible") - protected Boolean visible; - - /** - * Gets the value of the factorItem property. - * - * <p> - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a <CODE>set</CODE> method for the factorItem property. - * - * <p> - * For example, to add a new item, do as follows: - * <pre> - * getFactorItem().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list - * {@link ScaleItemType.FactorItem } - * - * - */ - public List<ScaleItemType.FactorItem> getFactorItem() { - if (factorItem == null) { - factorItem = new ArrayList<ScaleItemType.FactorItem>(); - } - return this.factorItem; - } - - /** - * Gets the value of the itemName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getItemName() { - if (itemName == null) { - return ""; - } else { - return itemName; - } - } - - /** - * Sets the value of the itemName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItemName(String value) { - this.itemName = value; - } - - /** - * Gets the value of the visible property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isVisible() { - if (visible == null) { - return true; - } else { - return visible; - } - } - - /** - * Sets the value of the visible property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setVisible(Boolean value) { - this.visible = value; - } - - - /** - * <p>Java class for anonymous complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>int"> - * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" /> - * </extension> - * </simpleContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "value" - }) - public static class FactorItem { - - @XmlValue - protected int value; - @XmlAttribute(name = "itemName") - protected String itemName; - - /** - * Gets the value of the value property. - * - */ - public int getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(int value) { - this.value = value; - } - - /** - * Gets the value of the itemName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getItemName() { - if (itemName == null) { - return ""; - } else { - return itemName; - } - } - - /** - * Sets the value of the itemName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItemName(String value) { - this.itemName = value; - } - - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/package-info.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/package-info.java deleted file mode 100644 index bbce9c1d59..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/package-info.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.11 at 12:12:25 PM KST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/emulator/skin/dbi", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.tizen.emulator.skin.dbi; diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/EventInfoType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/EventInfoType.java deleted file mode 100644 index e68840fcbf..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/EventInfoType.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for eventInfoType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="eventInfoType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="keyCode" type="{http://www.w3.org/2001/XMLSchema}int"/> - * <element name="keyName" type="{http://www.w3.org/2001/XMLSchema}string"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "eventInfoType", propOrder = { - -}) -public class EventInfoType { - - protected int keyCode; - @XmlElement(required = true) - protected String keyName; - - /** - * Gets the value of the keyCode property. - * - */ - public int getKeyCode() { - return keyCode; - } - - /** - * Sets the value of the keyCode property. - * - */ - public void setKeyCode(int value) { - this.keyCode = value; - } - - /** - * Gets the value of the keyName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getKeyName() { - return keyName; - } - - /** - * Sets the value of the keyName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKeyName(String value) { - this.keyName = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/HoverType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/HoverType.java deleted file mode 100644 index 676c268f98..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/HoverType.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for hoverType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="hoverType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="color" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}rgbType" minOccurs="0"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "hoverType", propOrder = { - -}) -public class HoverType { - - protected RgbType color; - - /** - * Gets the value of the color property. - * - * @return - * possible object is - * {@link RgbType } - * - */ - public RgbType getColor() { - return color; - } - - /** - * Sets the value of the color property. - * - * @param value - * allowed object is - * {@link RgbType } - * - */ - public void setColor(RgbType value) { - this.color = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/ImageListType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/ImageListType.java deleted file mode 100644 index cd3bed6956..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/ImageListType.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for imageListType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="imageListType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <all> - * <element name="mainImage" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="keyPressedImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </all> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "imageListType", propOrder = { - -}) -public class ImageListType { - - @XmlElement(required = true) - protected String mainImage; - protected String keyPressedImage; - - /** - * Gets the value of the mainImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMainImage() { - return mainImage; - } - - /** - * Sets the value of the mainImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMainImage(String value) { - this.mainImage = value; - } - - /** - * Gets the value of the keyPressedImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getKeyPressedImage() { - return keyPressedImage; - } - - /** - * Sets the value of the keyPressedImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKeyPressedImage(String value) { - this.keyPressedImage = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyMapListType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyMapListType.java deleted file mode 100644 index 34afcf7acb..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyMapListType.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for keyMapListType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="keyMapListType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="keyMap" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}keyMapType" maxOccurs="unbounded" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "keyMapListType", propOrder = { - "keyMap" -}) -public class KeyMapListType { - - protected List<KeyMapType> keyMap; - - /** - * Gets the value of the keyMap property. - * - * <p> - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a <CODE>set</CODE> method for the keyMap property. - * - * <p> - * For example, to add a new item, do as follows: - * <pre> - * getKeyMap().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list - * {@link KeyMapType } - * - * - */ - public List<KeyMapType> getKeyMap() { - if (keyMap == null) { - keyMap = new ArrayList<KeyMapType>(); - } - return this.keyMap; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyMapType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyMapType.java deleted file mode 100644 index 55321e1dca..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyMapType.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for keyMapType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="keyMapType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="region" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}regionType"/> - * <element name="eventInfo" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}eventInfoType" minOccurs="0"/> - * <element name="tooltip" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "keyMapType", propOrder = { - "region", - "eventInfo", - "tooltip" -}) -public class KeyMapType { - - @XmlElement(required = true) - protected RegionType region; - protected EventInfoType eventInfo; - protected String tooltip; - - /** - * Gets the value of the region property. - * - * @return - * possible object is - * {@link RegionType } - * - */ - public RegionType getRegion() { - return region; - } - - /** - * Sets the value of the region property. - * - * @param value - * allowed object is - * {@link RegionType } - * - */ - public void setRegion(RegionType value) { - this.region = value; - } - - /** - * Gets the value of the eventInfo property. - * - * @return - * possible object is - * {@link EventInfoType } - * - */ - public EventInfoType getEventInfo() { - return eventInfo; - } - - /** - * Sets the value of the eventInfo property. - * - * @param value - * allowed object is - * {@link EventInfoType } - * - */ - public void setEventInfo(EventInfoType value) { - this.eventInfo = value; - } - - /** - * Gets the value of the tooltip property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTooltip() { - return tooltip; - } - - /** - * Sets the value of the tooltip property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTooltip(String value) { - this.tooltip = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyWindowUI.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyWindowUI.java deleted file mode 100644 index fffeeb4f1c..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/KeyWindowUI.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for anonymous complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="dbi_version" type="{http://www.w3.org/2001/XMLSchema}float"/> - * <element name="imageList" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}imageListType"/> - * <element name="keyMapList" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}keyMapListType"/> - * <element name="hover" type="{http://www.tizen.org/emulator/skin/keywindow/dbi}hoverType" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "dbiVersion", - "imageList", - "keyMapList", - "hover" -}) -@XmlRootElement(name = "KeyWindowUI") -public class KeyWindowUI { - - @XmlElement(name = "dbi_version") - protected float dbiVersion; - @XmlElement(required = true) - protected ImageListType imageList; - @XmlElement(required = true) - protected KeyMapListType keyMapList; - protected HoverType hover; - - /** - * Gets the value of the dbiVersion property. - * - */ - public float getDbiVersion() { - return dbiVersion; - } - - /** - * Sets the value of the dbiVersion property. - * - */ - public void setDbiVersion(float value) { - this.dbiVersion = value; - } - - /** - * Gets the value of the imageList property. - * - * @return - * possible object is - * {@link ImageListType } - * - */ - public ImageListType getImageList() { - return imageList; - } - - /** - * Sets the value of the imageList property. - * - * @param value - * allowed object is - * {@link ImageListType } - * - */ - public void setImageList(ImageListType value) { - this.imageList = value; - } - - /** - * Gets the value of the keyMapList property. - * - * @return - * possible object is - * {@link KeyMapListType } - * - */ - public KeyMapListType getKeyMapList() { - return keyMapList; - } - - /** - * Sets the value of the keyMapList property. - * - * @param value - * allowed object is - * {@link KeyMapListType } - * - */ - public void setKeyMapList(KeyMapListType value) { - this.keyMapList = value; - } - - /** - * Gets the value of the hover property. - * - * @return - * possible object is - * {@link HoverType } - * - */ - public HoverType getHover() { - return hover; - } - - /** - * Sets the value of the hover property. - * - * @param value - * allowed object is - * {@link HoverType } - * - */ - public void setHover(HoverType value) { - this.hover = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/ObjectFactory.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/ObjectFactory.java deleted file mode 100644 index 4890caf706..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/ObjectFactory.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.tizen.emulator.skin.keywindow.dbi package. - * <p>An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.tizen.emulator.skin.keywindow.dbi - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link KeyWindowUI } - * - */ - public KeyWindowUI createKeyWindowUI() { - return new KeyWindowUI(); - } - - /** - * Create an instance of {@link ImageListType } - * - */ - public ImageListType createImageListType() { - return new ImageListType(); - } - - /** - * Create an instance of {@link KeyMapListType } - * - */ - public KeyMapListType createKeyMapListType() { - return new KeyMapListType(); - } - - /** - * Create an instance of {@link HoverType } - * - */ - public HoverType createHoverType() { - return new HoverType(); - } - - /** - * Create an instance of {@link EventInfoType } - * - */ - public EventInfoType createEventInfoType() { - return new EventInfoType(); - } - - /** - * Create an instance of {@link RgbType } - * - */ - public RgbType createRgbType() { - return new RgbType(); - } - - /** - * Create an instance of {@link RegionType } - * - */ - public RegionType createRegionType() { - return new RegionType(); - } - - /** - * Create an instance of {@link KeyMapType } - * - */ - public KeyMapType createKeyMapType() { - return new KeyMapType(); - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/RegionType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/RegionType.java deleted file mode 100644 index 310613b1c4..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/RegionType.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for regionType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="regionType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="left" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="top" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="width" type="{http://www.w3.org/2001/XMLSchema}int" /> - * <attribute name="height" type="{http://www.w3.org/2001/XMLSchema}int" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "regionType") -public class RegionType { - - @XmlAttribute(name = "left") - protected Integer left; - @XmlAttribute(name = "top") - protected Integer top; - @XmlAttribute(name = "width") - protected Integer width; - @XmlAttribute(name = "height") - protected Integer height; - - /** - * Gets the value of the left property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getLeft() { - return left; - } - - /** - * Sets the value of the left property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setLeft(Integer value) { - this.left = value; - } - - /** - * Gets the value of the top property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getTop() { - return top; - } - - /** - * Sets the value of the top property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setTop(Integer value) { - this.top = value; - } - - /** - * Gets the value of the width property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getWidth() { - return width; - } - - /** - * Sets the value of the width property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setWidth(Integer value) { - this.width = value; - } - - /** - * Gets the value of the height property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getHeight() { - return height; - } - - /** - * Sets the value of the height property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setHeight(Integer value) { - this.height = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/RgbType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/RgbType.java deleted file mode 100644 index bec97970cc..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/RgbType.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - - -package org.tizen.emulator.skin.keywindow.dbi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for rgbType complex type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rgbType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="R" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" /> - * <attribute name="G" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" /> - * <attribute name="B" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" /> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rgbType") -public class RgbType { - - @XmlAttribute(name = "R") - @XmlSchemaType(name = "unsignedInt") - protected Long r; - @XmlAttribute(name = "G") - @XmlSchemaType(name = "unsignedInt") - protected Long g; - @XmlAttribute(name = "B") - @XmlSchemaType(name = "unsignedInt") - protected Long b; - - /** - * Gets the value of the r property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getR() { - return r; - } - - /** - * Sets the value of the r property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setR(Long value) { - this.r = value; - } - - /** - * Gets the value of the g property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getG() { - return g; - } - - /** - * Sets the value of the g property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setG(Long value) { - this.g = value; - } - - /** - * Gets the value of the b property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getB() { - return b; - } - - /** - * Sets the value of the b property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setB(Long value) { - this.b = value; - } - -} diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/package-info.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/package-info.java deleted file mode 100644 index df2b3fd0b0..0000000000 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/keywindow/dbi/package-info.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * XML Binding - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.10.01 at 01:25:35 PM KST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/emulator/skin/keywindow/dbi", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.tizen.emulator.skin.keywindow.dbi; diff --git a/tizen/src/skin/client/native_src/check-gtk.sh b/tizen/src/skin/client/native_src/check-gtk.sh deleted file mode 100755 index 28f7d7a6d3..0000000000 --- a/tizen/src/skin/client/native_src/check-gtk.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -GTK3="gtk+-3.0" -GTK2="gtk+-2.0" - -pkg-config --exists $GTK3 -if [ "$?" = "0" ] -then - echo $GTK3 -else - echo $GTK2 -fi diff --git a/tizen/src/skin/client/native_src/clipboard.c b/tizen/src/skin/client/native_src/clipboard.c deleted file mode 100644 index 8df8df3025..0000000000 --- a/tizen/src/skin/client/native_src/clipboard.c +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copy framebuffer to clipboard by JNI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 <jni.h> -#include <stdio.h> -#include <gdk/gdk.h> -#include <gtk/gtk.h> -#include "org_tizen_emulator_skin_screenshot_ScreenShotDialog.h" - -JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_screenshot_ScreenShotDialog_copyToClipboard - (JNIEnv *env, jobject obj, jint width, jint height, jbyteArray pixels) -{ - int len = (*env)->GetArrayLength(env, pixels); - if (len <= 0) { - fprintf(stderr, "clipboard.c: failed to get length\n"); - fflush(stderr); - return -1; - } - - fprintf(stdout, "clipboard.c: copy to clipboard (%dx%d:%d)\n", width, height, len); - fflush(stdout); - - GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - if (clipboard == NULL) { - fprintf(stderr, "clipboard.c: failed to get clipboard\n"); - fflush(stderr); - return -1; - } - - char *data = (char *)g_malloc(len); - if (data == NULL) { - fprintf(stderr, "clipboard.c: failed to g_malloc\n"); - fflush(stderr); - return -1; - } - (*env)->GetByteArrayRegion(env, pixels, 0, len, data); - - GdkPixbuf *image = gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, FALSE, 8, - width, height, width * 3, NULL, NULL); - if (image == NULL) { - fprintf(stderr, "clipboard.c: failed to get pixbuf\n"); - fflush(stderr); - - g_free(data); - return -1; - } - - gtk_clipboard_set_image(clipboard, image); - - g_object_unref(image); - - return 0; -} - diff --git a/tizen/src/skin/client/native_src/clipboard.py b/tizen/src/skin/client/native_src/clipboard.py deleted file mode 100644 index 074e827b94..0000000000 --- a/tizen/src/skin/client/native_src/clipboard.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -import pygtk -import gtk -import sys - -def copy_image(f): - image = gtk.gdk.pixbuf_new_from_file(f) - - clipboard = gtk.clipboard_get() - clipboard.set_image(image) - clipboard.store() - - -copy_image(sys.argv[1]); diff --git a/tizen/src/skin/client/native_src/make_so_linux.sh b/tizen/src/skin/client/native_src/make_so_linux.sh deleted file mode 100755 index aaa260343f..0000000000 --- a/tizen/src/skin/client/native_src/make_so_linux.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -#Example - -javah -classpath ../bin/:../lib/swt.jar -jni org.tizen.emulator.skin.EmulatorShmSkin -rm ./org_tizen_emulator_skin_EmulatorShmSkin_PollFBThread.h -#TODO: jdk path -gcc -c share.c -o share.o -I /usr/lib/jvm/jdk1.7.0_04/include -I /usr/lib/jvm/jdk1.7.0_04/include/linux -gcc -shared share.o -o libshared.so -fPIC diff --git a/tizen/src/skin/client/native_src/make_so_mac.sh b/tizen/src/skin/client/native_src/make_so_mac.sh deleted file mode 100755 index 2ecbba95e2..0000000000 --- a/tizen/src/skin/client/native_src/make_so_mac.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -#Example - -javah -classpath ../emulator-skin.jar:../lib/swt.jar -jni org.tizen.emulator.skin.EmulatorShmSkin -rm ./org_tizen_emulator_skin_EmulatorShmSkin_PollFBThread.h -#TODO: jdk path -cc -c share.c -o share.o -I/System/Library/Frameworks/JavaVM.framework/Headers -cc -dynamiclib share.o -o libshared.dylib diff --git a/tizen/src/skin/client/native_src/share.c b/tizen/src/skin/client/native_src/share.c deleted file mode 100644 index b96d48e9ac..0000000000 --- a/tizen/src/skin/client/native_src/share.c +++ /dev/null @@ -1,157 +0,0 @@ -/** - * Transmit the framebuffer from shared memory by JNI - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 <jni.h> -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/ipc.h> -#include <sys/shm.h> -#include <errno.h> -#include "org_tizen_emulator_skin_EmulatorShmSkin.h" - -#define MAXLEN 512 - -void *shared_memory = (void *)0; -int shmid; - - -JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_shmget - (JNIEnv *env, jobject obj, jint shmkey, jint size) -{ - fprintf(stdout, "share.c: shared memory key=%d, size=%d bytes\n", - shmkey, size); - fflush(stdout); - - shmid = shmget((key_t)shmkey, (size_t)size, 0666 | IPC_CREAT); - if (shmid == -1) { - fprintf(stderr, "share.c: shmget failed\n"); - fflush(stderr); - - if (errno == EINVAL) { - /* get identifiedr of unavailable segment */ - shmid = shmget((key_t)shmkey, (size_t)1, 0666 | IPC_CREAT); - if (shmid == -1) { - perror("share.c: "); - return 1; - } - - /* a segment with given key existed, but size is greater than - the size of that segment */ - if (shmctl(shmid, IPC_RMID, 0) == -1) { - perror("share.c: "); - return 1; - } - - /* try to shmget one more time */ - shmid = shmget((key_t)shmkey, (size_t)size, 0666 | IPC_CREAT); - if (shmid == -1) { - perror("share.c: "); - return 1; - } else { - fprintf(stdout, "share.c: new segment was to be created!\n"); - fflush(stdout); - } - } - } - - /* We now make the shared memory accessible to the program */ - shared_memory = shmat(shmid, (void *)0, 0); - if (shared_memory == (void *)-1) { - fprintf(stderr, "share.c: shmat failed\n"); - fflush(stderr); - return 2; - } - - fprintf(stdout, "share.c: memory attached at 0x%X\n", - (int)shared_memory); - fflush(stdout); - - return 0; -} - -JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_shmdt - (JNIEnv *env, jobject obj) -{ - struct shmid_ds shm_info; - - if (shmctl(shmid, IPC_STAT, &shm_info) == -1) { - fprintf(stderr, "share.c: shmctl failed\n"); - fflush(stderr); - perror("share.c: "); - - shm_info.shm_nattch = 0; - } - - fprintf(stdout, "share.c: clean up the shared memory\n"); - fflush(stdout); - - /* Lastly, the shared memory is detached */ - if (shmdt(shared_memory) == -1) { - fprintf(stderr, "share.c: shmdt failed\n"); - fflush(stderr); - perror("share.c: "); - return 1; - } - shared_memory = NULL; - - if (shm_info.shm_nattch == 1) { - /* remove */ - if (shmctl(shmid, IPC_RMID, 0) == -1) { - fprintf(stdout, "share.c: segment was already removed\n"); - fflush(stdout); - perror("share.c: "); - return 2; - } - } else { - fprintf(stdout, "share.c: number of current attaches = %d\n", - (int)shm_info.shm_nattch); - fflush(stdout); - } - - return 0; -} - -JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_getPixels - (JNIEnv *env, jobject obj, jintArray array) -{ - int len = (*env)->GetArrayLength(env, array); - if (len <= 0) { - fprintf(stderr, "share.c: get length failed\n"); - fflush(stderr); - return -1; - } - - if (shared_memory != NULL) { - (*env)->SetIntArrayRegion(env, array, 0, len, shared_memory); - } - - return len; -} - diff --git a/tizen/src/skin/client/resource/icons/about.png b/tizen/src/skin/client/resource/icons/about.png Binary files differdeleted file mode 100644 index 4f76588f80..0000000000 --- a/tizen/src/skin/client/resource/icons/about.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/advanced.png b/tizen/src/skin/client/resource/icons/advanced.png Binary files differdeleted file mode 100644 index 14cf9fae59..0000000000 --- a/tizen/src/skin/client/resource/icons/advanced.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/close.png b/tizen/src/skin/client/resource/icons/close.png Binary files differdeleted file mode 100644 index a1395ce2c4..0000000000 --- a/tizen/src/skin/client/resource/icons/close.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/copy_screenshot_dialog.png b/tizen/src/skin/client/resource/icons/copy_screenshot_dialog.png Binary files differdeleted file mode 100644 index a07a5f720b..0000000000 --- a/tizen/src/skin/client/resource/icons/copy_screenshot_dialog.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/decrease_scale.png b/tizen/src/skin/client/resource/icons/decrease_scale.png Binary files differdeleted file mode 100644 index 756c3e74dc..0000000000 --- a/tizen/src/skin/client/resource/icons/decrease_scale.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/detail_info.png b/tizen/src/skin/client/resource/icons/detail_info.png Binary files differdeleted file mode 100644 index 149ffa263e..0000000000 --- a/tizen/src/skin/client/resource/icons/detail_info.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/diagnosis.png b/tizen/src/skin/client/resource/icons/diagnosis.png Binary files differdeleted file mode 100644 index 4912a4c33a..0000000000 --- a/tizen/src/skin/client/resource/icons/diagnosis.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/ecp.png b/tizen/src/skin/client/resource/icons/ecp.png Binary files differdeleted file mode 100644 index 3da7e80dfd..0000000000 --- a/tizen/src/skin/client/resource/icons/ecp.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/emulator_icon.ico b/tizen/src/skin/client/resource/icons/emulator_icon.ico Binary files differdeleted file mode 100644 index a170e86812..0000000000 --- a/tizen/src/skin/client/resource/icons/emulator_icon.ico +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/emulator_icon.png b/tizen/src/skin/client/resource/icons/emulator_icon.png Binary files differdeleted file mode 100644 index 62538e9d51..0000000000 --- a/tizen/src/skin/client/resource/icons/emulator_icon.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/force_close.png b/tizen/src/skin/client/resource/icons/force_close.png Binary files differdeleted file mode 100644 index a506b4d96d..0000000000 --- a/tizen/src/skin/client/resource/icons/force_close.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/host_keyboard.png b/tizen/src/skin/client/resource/icons/host_keyboard.png Binary files differdeleted file mode 100644 index 69a87f3207..0000000000 --- a/tizen/src/skin/client/resource/icons/host_keyboard.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/increase_scale.png b/tizen/src/skin/client/resource/icons/increase_scale.png Binary files differdeleted file mode 100644 index 0ab249d791..0000000000 --- a/tizen/src/skin/client/resource/icons/increase_scale.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/refresh_screenshot_dialog.png b/tizen/src/skin/client/resource/icons/refresh_screenshot_dialog.png Binary files differdeleted file mode 100644 index e1616d9bc2..0000000000 --- a/tizen/src/skin/client/resource/icons/refresh_screenshot_dialog.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/rotate.png b/tizen/src/skin/client/resource/icons/rotate.png Binary files differdeleted file mode 100644 index b2fc00f1f5..0000000000 --- a/tizen/src/skin/client/resource/icons/rotate.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/save_screenshot_dialog.png b/tizen/src/skin/client/resource/icons/save_screenshot_dialog.png Binary files differdeleted file mode 100644 index 523fe9efd3..0000000000 --- a/tizen/src/skin/client/resource/icons/save_screenshot_dialog.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/scale.png b/tizen/src/skin/client/resource/icons/scale.png Binary files differdeleted file mode 100644 index 1f3f872b52..0000000000 --- a/tizen/src/skin/client/resource/icons/scale.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/screenshot.png b/tizen/src/skin/client/resource/icons/screenshot.png Binary files differdeleted file mode 100644 index 74c85152f2..0000000000 --- a/tizen/src/skin/client/resource/icons/screenshot.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/icons/shell.png b/tizen/src/skin/client/resource/icons/shell.png Binary files differdeleted file mode 100644 index e89f1b1690..0000000000 --- a/tizen/src/skin/client/resource/icons/shell.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/about_Tizen_SDK.png b/tizen/src/skin/client/resource/images/about_Tizen_SDK.png Binary files differdeleted file mode 100644 index b276703a7a..0000000000 --- a/tizen/src/skin/client/resource/images/about_Tizen_SDK.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/display_off_guide.png b/tizen/src/skin/client/resource/images/display_off_guide.png Binary files differdeleted file mode 100644 index 2ef27c0337..0000000000 --- a/tizen/src/skin/client/resource/images/display_off_guide.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/B.png b/tizen/src/skin/client/resource/images/emul-window/B.png Binary files differdeleted file mode 100644 index fc512a1f79..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/B.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/L.png b/tizen/src/skin/client/resource/images/emul-window/L.png Binary files differdeleted file mode 100644 index 33e409cc91..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/L.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/LB.png b/tizen/src/skin/client/resource/images/emul-window/LB.png Binary files differdeleted file mode 100644 index 6e4775a7f5..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/LB.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/LT.png b/tizen/src/skin/client/resource/images/emul-window/LT.png Binary files differdeleted file mode 100644 index ed6dd3da94..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/LT.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/R.png b/tizen/src/skin/client/resource/images/emul-window/R.png Binary files differdeleted file mode 100644 index edd377d1fc..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/R.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/RB.png b/tizen/src/skin/client/resource/images/emul-window/RB.png Binary files differdeleted file mode 100644 index 64533f793c..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/RB.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/RT.png b/tizen/src/skin/client/resource/images/emul-window/RT.png Binary files differdeleted file mode 100644 index eb4210fc4f..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/RT.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/T.png b/tizen/src/skin/client/resource/images/emul-window/T.png Binary files differdeleted file mode 100644 index bf81220640..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/T.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/arrow_hover.png b/tizen/src/skin/client/resource/images/emul-window/arrow_hover.png Binary files differdeleted file mode 100644 index f3f5565485..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/arrow_hover.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/arrow_nml.png b/tizen/src/skin/client/resource/images/emul-window/arrow_nml.png Binary files differdeleted file mode 100644 index 60122377be..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/arrow_nml.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/emul-window/arrow_pushed.png b/tizen/src/skin/client/resource/images/emul-window/arrow_pushed.png Binary files differdeleted file mode 100644 index 75c39084cb..0000000000 --- a/tizen/src/skin/client/resource/images/emul-window/arrow_pushed.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/B.png b/tizen/src/skin/client/resource/images/key-window/B.png Binary files differdeleted file mode 100644 index 7f79e11233..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/B.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/L.png b/tizen/src/skin/client/resource/images/key-window/L.png Binary files differdeleted file mode 100644 index 8dfa47acd8..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/L.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/LB.png b/tizen/src/skin/client/resource/images/key-window/LB.png Binary files differdeleted file mode 100644 index 89d0126de0..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/LB.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/LT.png b/tizen/src/skin/client/resource/images/key-window/LT.png Binary files differdeleted file mode 100644 index 3e0e9dc38f..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/LT.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/R.png b/tizen/src/skin/client/resource/images/key-window/R.png Binary files differdeleted file mode 100644 index df904e0a04..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/R.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/RB.png b/tizen/src/skin/client/resource/images/key-window/RB.png Binary files differdeleted file mode 100644 index 526ecc2283..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/RB.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/RT.png b/tizen/src/skin/client/resource/images/key-window/RT.png Binary files differdeleted file mode 100644 index 45b30498b4..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/RT.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/T.png b/tizen/src/skin/client/resource/images/key-window/T.png Binary files differdeleted file mode 100644 index 9efb7c6914..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/T.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/keybutton_hover.png b/tizen/src/skin/client/resource/images/key-window/keybutton_hover.png Binary files differdeleted file mode 100644 index fc341a1bb8..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/keybutton_hover.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/keybutton_nml.png b/tizen/src/skin/client/resource/images/key-window/keybutton_nml.png Binary files differdeleted file mode 100644 index 06a0b40081..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/keybutton_nml.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/keybutton_pushed.png b/tizen/src/skin/client/resource/images/key-window/keybutton_pushed.png Binary files differdeleted file mode 100644 index e161dc719b..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/keybutton_pushed.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_back.png b/tizen/src/skin/client/resource/images/key-window/scroll_back.png Binary files differdeleted file mode 100644 index 5f8c377805..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_back.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_button_down_hover.png b/tizen/src/skin/client/resource/images/key-window/scroll_button_down_hover.png Binary files differdeleted file mode 100644 index 62f58d14b5..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_button_down_hover.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_button_down_nml.png b/tizen/src/skin/client/resource/images/key-window/scroll_button_down_nml.png Binary files differdeleted file mode 100644 index 7ced278fc8..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_button_down_nml.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_button_down_pushed.png b/tizen/src/skin/client/resource/images/key-window/scroll_button_down_pushed.png Binary files differdeleted file mode 100644 index 68cc7f2afc..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_button_down_pushed.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_button_up_hover.png b/tizen/src/skin/client/resource/images/key-window/scroll_button_up_hover.png Binary files differdeleted file mode 100644 index a362b4e7f1..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_button_up_hover.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_button_up_nml.png b/tizen/src/skin/client/resource/images/key-window/scroll_button_up_nml.png Binary files differdeleted file mode 100644 index 29882e087b..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_button_up_nml.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_button_up_pushed.png b/tizen/src/skin/client/resource/images/key-window/scroll_button_up_pushed.png Binary files differdeleted file mode 100644 index 6c510c132e..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_button_up_pushed.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/key-window/scroll_thumb.png b/tizen/src/skin/client/resource/images/key-window/scroll_thumb.png Binary files differdeleted file mode 100644 index b33ca1fbdf..0000000000 --- a/tizen/src/skin/client/resource/images/key-window/scroll_thumb.png +++ /dev/null diff --git a/tizen/src/skin/client/resource/images/process.gif b/tizen/src/skin/client/resource/images/process.gif Binary files differdeleted file mode 100644 index 0a6e355d02..0000000000 --- a/tizen/src/skin/client/resource/images/process.gif +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default.dbi b/tizen/src/skin/client/skins/mobile-320x480-3btn/default.dbi deleted file mode 100644 index 6b1310b3ae..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default.dbi +++ /dev/null @@ -1,250 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="26" top="70" width="320" height="480"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="71" top="552" width="54" height="54"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="159" top="552" width="54" height="54"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="247" top="552" width="54" height="54"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="362" top="487" width="15" height="70" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="362" top="63" width="15" height="70" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="362" top="140" width="15" height="70" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="70" top="34" width="480" height="320"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="552" top="256" width="54" height="54"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="552" top="167" width="54" height="54"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="552" top="79" width="54" height="54"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="486" top="3" width="70" height="15" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="63" top="3" width="70" height="15" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="139" top="3" width="70" height="15" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="34" top="70" width="320" height="480"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="255" top="14" width="54" height="54"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="167" top="14" width="54" height="54"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="78" top="14" width="54" height="54"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="3" top="64" width="15" height="70" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="3" top="488" width="15" height="70" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="3" top="412" width="15" height="70" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="70" top="26" width="480" height="320"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="14" top="71" width="54" height="54"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="14" top="159" width="54" height="54"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="14" top="248" width="54" height="54"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="64" top="362" width="70" height="15" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="488" top="362" width="70" height="15" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="412" top="362" width="70" height="15" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_0.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_0.png Binary files differdeleted file mode 100644 index 68e5aaa02c..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_0_p.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_0_p.png Binary files differdeleted file mode 100644 index 4dbbc834f3..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_180.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_180.png Binary files differdeleted file mode 100644 index 2c0be13782..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_180_p.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_180_p.png Binary files differdeleted file mode 100644 index a547822ced..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_L90.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_L90.png Binary files differdeleted file mode 100644 index da79f5ee51..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_L90_p.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_L90_p.png Binary files differdeleted file mode 100644 index 91fef2f148..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_R90.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_R90.png Binary files differdeleted file mode 100644 index 7606fec6c8..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_R90_p.png b/tizen/src/skin/client/skins/mobile-320x480-3btn/default_R90_p.png Binary files differdeleted file mode 100644 index c96631a745..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/info.ini b/tizen/src/skin/client/skins/mobile-320x480-3btn/info.ini deleted file mode 100644 index 2b6b687378..0000000000 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Phone 320x480 -resolution.width=320 -resolution.height=480 -manager.priority=3 diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi deleted file mode 100644 index 08084aa0af..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi +++ /dev/null @@ -1,185 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="52" top="109" width="600" height="1024"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="310" top="1139" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="690" top="1055" width="24" height="88" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="690" top="101" width="24" height="88" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="690" top="194" width="24" height="88" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="109" top="62" width="1024" height="600"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="1138" top="321" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="1054" top="1" width="88" height="24" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="99" top="1" width="88" height="24" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="194" top="1" width="88" height="24" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="62" top="113" width="600" height="1024"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="320" top="24" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="1" top="106" width="24" height="88" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="1" top="1059" width="24" height="88" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="1" top="964" width="24" height="88" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="113" top="52" width="1024" height="600"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="23" top="310" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="105" top="690" width="88" height="24" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="1058" top="690" width="88" height="24" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="965" top="690" width="88" height="24" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <keywindowItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_0.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_0.png Binary files differdeleted file mode 100644 index bf63d2fc0e..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_0_p.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_0_p.png Binary files differdeleted file mode 100644 index 7e165904df..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_180.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_180.png Binary files differdeleted file mode 100644 index 198d4e966c..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_180_p.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_180_p.png Binary files differdeleted file mode 100644 index c77beafa37..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_L90.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_L90.png Binary files differdeleted file mode 100644 index a3a3d40a84..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_L90_p.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_L90_p.png Binary files differdeleted file mode 100644 index 3a110eb666..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_R90.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_R90.png Binary files differdeleted file mode 100644 index 2b94d2183d..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_R90_p.png b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_R90_p.png Binary files differdeleted file mode 100644 index ae3b0693d5..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/info.ini b/tizen/src/skin/client/skins/mobile-600x1024-1btn/info.ini deleted file mode 100644 index 8d257953f6..0000000000 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Phone 1btn 600x1024 -resolution.width=600 -resolution.height=1024 -manager.priority=3 diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default.dbi b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default.dbi deleted file mode 100644 index 97d42dadb0..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default.dbi +++ /dev/null @@ -1,250 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="30" top="81" width="480" height="800"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="113" top="882" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="233" top="882" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="355" top="882" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="536" top="814" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="536" top="76" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="536" top="162" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="81" top="42" width="800" height="480"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="882" top="364" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="882" top="244" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="882" top="122" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="813" top="0" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="75" top="0" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="161" top="0" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="42" top="84" width="480" height="800"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="363" top="9" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="244" top="9" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="121" top="9" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="0" top="79" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="0" top="816" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="0" top="730" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="84" top="30" width="800" height="480"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="9" top="113" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="9" top="234" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="9" top="355" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="78" top="534" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="816" top="534" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="730" top="534" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_0.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_0.png Binary files differdeleted file mode 100644 index 75576c2163..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_0_p.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_0_p.png Binary files differdeleted file mode 100644 index 7dcde121cc..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_180.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_180.png Binary files differdeleted file mode 100644 index 170161f664..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_180_p.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_180_p.png Binary files differdeleted file mode 100644 index e11181aac7..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_L90.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_L90.png Binary files differdeleted file mode 100644 index c135fc3a02..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_L90_p.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_L90_p.png Binary files differdeleted file mode 100644 index 954da91f02..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_R90.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_R90.png Binary files differdeleted file mode 100644 index 1d68991bf3..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_R90_p.png b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_R90_p.png Binary files differdeleted file mode 100644 index 8d056d9cc7..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/info.ini b/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/info.ini deleted file mode 100644 index cc898a8d7e..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-480x800-3btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Phone 480x800 -resolution.width=480 -resolution.height=800 -manager.priority=3 diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default.dbi b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default.dbi deleted file mode 100644 index 5466edb13f..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default.dbi +++ /dev/null @@ -1,250 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="30" top="81" width="540" height="960"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="124" top="1044" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="264" top="1044" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="406" top="1044" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="595" top="974" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="595" top="75" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="595" top="162" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="81" top="42" width="960" height="540"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="1044" top="414" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="1044" top="274" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="1044" top="134" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="973" top="0" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="75" top="0" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="161" top="0" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="42" top="84" width="540" height="960"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="415" top="9" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="273" top="9" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="132" top="9" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="0" top="79" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="0" top="976" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="0" top="890" width="20" height="74" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="84" top="30" width="960" height="540"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="9" top="123" width="74" height="74"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="9" top="265" width="74" height="74"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="9" top="408" width="74" height="74"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="79" top="595" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="975" top="595" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="889" top="595" width="74" height="20" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_0.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_0.png Binary files differdeleted file mode 100644 index c70c05c4cf..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_0_p.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_0_p.png Binary files differdeleted file mode 100644 index 11afc3956a..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_180.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_180.png Binary files differdeleted file mode 100644 index fda0c165fe..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_180_p.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_180_p.png Binary files differdeleted file mode 100644 index ca4a332fb5..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_L90.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_L90.png Binary files differdeleted file mode 100644 index bda521f1ba..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_L90_p.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_L90_p.png Binary files differdeleted file mode 100644 index 4aea3fc279..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_R90.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_R90.png Binary files differdeleted file mode 100644 index 8e0a1b6ede..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_R90_p.png b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_R90_p.png Binary files differdeleted file mode 100644 index bbc522b835..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/info.ini b/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/info.ini deleted file mode 100644 index fb76cbf34a..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-540x960-3btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Phone 540x960 -resolution.width=540 -resolution.height=960 -manager.priority=3 diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default.dbi b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default.dbi deleted file mode 100644 index 8b2169d6ec..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default.dbi +++ /dev/null @@ -1,250 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="62" top="111" width="720" height="1280"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="205" top="1396" width="84" height="84"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="385" top="1396" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="565" top="1396" width="84" height="84"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="836" top="1304" width="24" height="96" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="836" top="103" width="24" height="96" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="836" top="213" width="24" height="96" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="111" top="74" width="1280" height="720"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="1395" top="566" width="84" height="84"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="1395" top="387" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="1395" top="205" width="84" height="84"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="1303" top="0" width="96" height="24" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="103" top="0" width="96" height="24" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="212" top="0" width="96" height="24" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="74" top="112" width="720" height="1280"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="566" top="25" width="84" height="84"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="386" top="25" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="205" top="25" width="84" height="84"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="0" top="105" width="24" height="96" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="0" top="1305" width="24" height="96" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="0" top="1195" width="24" height="96" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="112" top="62" width="1280" height="720"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="23" top="204" width="84" height="84"/> - <eventInfo> - <keyCode>169</keyCode> - <keyName>Menu</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="23" top="385" width="84" height="84"/> - <eventInfo> - <keyCode>139</keyCode> - <keyName>Home</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="23" top="565" width="84" height="84"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="104" top="836" width="96" height="24" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="1304" top="836" width="96" height="24" update="true"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>Volume +</keyName> - </eventInfo> - <tooltip>Volume +</tooltip> - </keyMap> - <keyMap> - <region left="1194" top="836" width="96" height="24" update="true"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>Volume -</keyName> - </eventInfo> - <tooltip>Volume -</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_0.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_0.png Binary files differdeleted file mode 100644 index 919442890c..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_0_p.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_0_p.png Binary files differdeleted file mode 100644 index 4beca5a19d..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_180.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_180.png Binary files differdeleted file mode 100644 index cd0a47d4ba..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_180_p.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_180_p.png Binary files differdeleted file mode 100644 index e2fcbfde68..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_L90.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_L90.png Binary files differdeleted file mode 100644 index fdc04d1e3b..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_L90_p.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_L90_p.png Binary files differdeleted file mode 100644 index 74fbd322fe..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_R90.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_R90.png Binary files differdeleted file mode 100644 index 0fb06e9eac..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_R90_p.png b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_R90_p.png Binary files differdeleted file mode 100644 index b83d97efd0..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/info.ini b/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/info.ini deleted file mode 100644 index efd4490dcf..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-720x1280-3btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Phone 720x1280 -resolution.width=720 -resolution.height=1280 -manager.priority=3 diff --git a/tizen/src/skin/client/skins/mobile/mobile-general-3btn/default.dbi b/tizen/src/skin/client/skins/mobile/mobile-general-3btn/default.dbi deleted file mode 100644 index 6e2780764f..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-general-3btn/default.dbi +++ /dev/null @@ -1,84 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - </display> - <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"> - <display id="0"> - </display> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - </display> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - </display> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <topmostItem visible="true" /> - <rotateItem visible="true" /> - <scaleItem visible="true" /> - <keywindowItem visible="true" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - <shellItem visible="true" /> - <controlPanelItem visible="true" /> - <forceCloseItem visible="true" /> - <closeItem visible="true" /> - </popupMenu> - <option> - <blankGuide visible="true" /> - </option> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/mobile/mobile-general-3btn/info.ini b/tizen/src/skin/client/skins/mobile/mobile-general-3btn/info.ini deleted file mode 100644 index 59ea685969..0000000000 --- a/tizen/src/skin/client/skins/mobile/mobile-general-3btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=General purpose mobile -resolution.width=all -resolution.height=all -manager.priority=2 diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/background.png b/tizen/src/skin/client/skins/tv/tv-1920x1080/background.png Binary files differdeleted file mode 100644 index 73094ddb06..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/background.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/default.dbi b/tizen/src/skin/client/skins/tv/tv-1920x1080/default.dbi deleted file mode 100644 index 5e8aa9f737..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/default.dbi +++ /dev/null @@ -1,47 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="28" top="28" width="1920" height="1080"/> - </display> - <imageList> - <mainImage>background.png</mainImage> - <keyPressedImage>background.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="0" top="0" width="0" height="0"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - </display> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - </display> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - </display> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <topmostItem visible="true" /> - <rotateItem visible="false" /> - <keywindowItem visible="true" /> - <shellItem visible="false" /> - <controlPanelItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/info.ini b/tizen/src/skin/client/skins/tv/tv-1920x1080/info.ini deleted file mode 100644 index a1076947c2..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=TV 1920X1080 -resolution.width=1920 -resolution.height=1080 -manager.priority=1 diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/basic_US_normal.png b/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/basic_US_normal.png Binary files differdeleted file mode 100644 index 1fc3e33368..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/basic_US_normal.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/basic_US_pushed.png b/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/basic_US_pushed.png Binary files differdeleted file mode 100644 index 54a53628a7..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/basic_US_pushed.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/default.dbi b/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/default.dbi deleted file mode 100644 index c7868ef8a9..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/default.dbi +++ /dev/null @@ -1,397 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<KeyWindowUI xmlns="http://www.tizen.org/emulator/skin/keywindow/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <dbi_version>2.3</dbi_version> - <imageList> - <mainImage>basic_US_normal.png</mainImage> - <keyPressedImage>basic_US_pushed.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="13" top="21" width="36" height="36"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>KEY_POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="85" top="23" width="36" height="32"/> - <eventInfo> - <keyCode>64</keyCode> - <keyName>KEY_SOURCE</keyName> - </eventInfo> - <tooltip>Source</tooltip> - </keyMap> - <keyMap> - <region left="10" top="68" width="36" height="26"/> - <eventInfo> - <keyCode>2</keyCode> - <keyName>KEY_1</keyName> - </eventInfo> - <tooltip>1</tooltip> - </keyMap> - <keyMap> - <region left="50" top="68" width="36" height="26"/> - <eventInfo> - <keyCode>3</keyCode> - <keyName>KEY_2</keyName> - </eventInfo> - <tooltip>2</tooltip> - </keyMap> - <keyMap> - <region left="88" top="68" width="36" height="26"/> - <eventInfo> - <keyCode>4</keyCode> - <keyName>KEY_3</keyName> - </eventInfo> - <tooltip>3</tooltip> - </keyMap> - <keyMap> - <region left="10" top="101" width="36" height="26"/> - <eventInfo> - <keyCode>5</keyCode> - <keyName>KEY_4</keyName> - </eventInfo> - <tooltip>4</tooltip> - </keyMap> - <keyMap> - <region left="50" top="101" width="36" height="26"/> - <eventInfo> - <keyCode>6</keyCode> - <keyName>KEY_5</keyName> - </eventInfo> - <tooltip>5</tooltip> - </keyMap> - <keyMap> - <region left="88" top="101" width="36" height="26"/> - <eventInfo> - <keyCode>7</keyCode> - <keyName>KEY_6</keyName> - </eventInfo> - <tooltip>6</tooltip> - </keyMap> - <keyMap> - <region left="10" top="134" width="36" height="26"/> - <eventInfo> - <keyCode>8</keyCode> - <keyName>KEY_7</keyName> - </eventInfo> - <tooltip>7</tooltip> - </keyMap> - <keyMap> - <region left="50" top="134" width="36" height="26"/> - <eventInfo> - <keyCode>9</keyCode> - <keyName>KEY_8</keyName> - </eventInfo> - <tooltip>8</tooltip> - </keyMap> - <keyMap> - <region left="88" top="134" width="36" height="26"/> - <eventInfo> - <keyCode>10</keyCode> - <keyName>KEY_9</keyName> - </eventInfo> - <tooltip>9</tooltip> - </keyMap> - <keyMap> - <region left="10" top="167" width="36" height="26"/> - <eventInfo> - <keyCode>12</keyCode> - <keyName>KEY_MINUS</keyName> - </eventInfo> - <tooltip>Plus100</tooltip> - </keyMap> - <keyMap> - <region left="50" top="167" width="36" height="26"/> - <eventInfo> - <keyCode>11</keyCode> - <keyName>KEY_0</keyName> - </eventInfo> - <tooltip>0</tooltip> - </keyMap> - <keyMap> - <region left="88" top="167" width="36" height="26"/> - <eventInfo> - <keyCode>182</keyCode> - <keyName>KEY_PRECH</keyName> - </eventInfo> - <tooltip>Prev</tooltip> - </keyMap> - <keyMap> - <region left="10" top="204" width="40" height="38"/> - <eventInfo> - <keyCode>68</keyCode> - <keyName>KEY_VOLUP</keyName> - </eventInfo> - <tooltip>VOL+</tooltip> - </keyMap> - <keyMap> - <region left="10" top="242" width="40" height="38"/> - <eventInfo> - <keyCode>67</keyCode> - <keyName>KEY_VOLDOWN</keyName> - </eventInfo> - <tooltip>VOL-</tooltip> - </keyMap> - <keyMap> - <region left="56" top="204" width="26" height="34"/> - <eventInfo> - <keyCode>66</keyCode> - <keyName>KEY_MUTE</keyName> - </eventInfo> - <tooltip>Mute</tooltip> - </keyMap> - <keyMap> - <region left="56" top="244" width="26" height="34"/> - <eventInfo> - <keyCode>65</keyCode> - <keyName>KEY_CH_LIST</keyName> - </eventInfo> - <tooltip>ChannelList</tooltip> - </keyMap> - <keyMap> - <region left="85" top="204" width="40" height="38"/> - <eventInfo> - <keyCode>88</keyCode> - <keyName>KEY_CHUP</keyName> - </eventInfo> - <tooltip>CH+</tooltip> - </keyMap> - <keyMap> - <region left="85" top="242" width="40" height="38"/> - <eventInfo> - <keyCode>87</keyCode> - <keyName>KEY_CHDOWN</keyName> - </eventInfo> - <tooltip>CH-</tooltip> - </keyMap> - <keyMap> - <region left="10" top="289" width="36" height="28"/> - <eventInfo> - <keyCode>125</keyCode> - <keyName>KEY_MENU</keyName> - </eventInfo> - <tooltip>Menu</tooltip> - </keyMap> - <keyMap> - <region left="50" top="281" width="36" height="46"/> - <eventInfo> - <keyCode>63</keyCode> - <keyName>KEY_HOME</keyName> - </eventInfo> - <tooltip>SmartHome</tooltip> - </keyMap> - <keyMap> - <region left="88" top="289" width="36" height="28"/> - <eventInfo> - <keyCode>130</keyCode> - <keyName>KEY_GUIDE</keyName> - </eventInfo> - <tooltip>Guide</tooltip> - </keyMap> - <keyMap> - <region left="10" top="332" width="36" height="28"/> - <eventInfo> - <keyCode>127</keyCode> - <keyName>KEY_TOOLS</keyName> - </eventInfo> - <tooltip>Tools</tooltip> - </keyMap> - <keyMap> - <region left="88" top="332" width="36" height="28"/> - <eventInfo> - <keyCode>188</keyCode> - <keyName>KEY_INFO</keyName> - </eventInfo> - <tooltip>Info</tooltip> - </keyMap> - <keyMap> - <region left="10" top="395" width="36" height="28"/> - <eventInfo> - <keyCode>1</keyCode> - <keyName>KEY_RETURN</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="88" top="395" width="36" height="28"/> - <eventInfo> - <keyCode>174</keyCode> - <keyName>KEY_EXIT</keyName> - </eventInfo> - <tooltip>Exit</tooltip> - </keyMap> - <keyMap> - <region left="53" top="328" width="28" height="33"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>KEY_UP</keyName> - </eventInfo> - <tooltip>Up</tooltip> - </keyMap> - <keyMap> - <region left="15" top="364" width="34" height="26"/> - <eventInfo> - <keyCode>105</keyCode> - <keyName>KEY_LEFT</keyName> - </eventInfo> - <tooltip>Left</tooltip> - </keyMap> - <keyMap> - <region left="85" top="364" width="34" height="26"/> - <eventInfo> - <keyCode>106</keyCode> - <keyName>KEY_RIGHT</keyName> - </eventInfo> - <tooltip>Right</tooltip> - </keyMap> - <keyMap> - <region left="53" top="393" width="28" height="33"/> - <eventInfo> - <keyCode>108</keyCode> - <keyName>KEY_DOWN</keyName> - </eventInfo> - <tooltip>Down</tooltip> - </keyMap> - <keyMap> - <region left="53" top="364" width="28" height="24"/> - <eventInfo> - <keyCode>28</keyCode> - <keyName>KEY_OK</keyName> - </eventInfo> - <tooltip>Ok</tooltip> - </keyMap> - <keyMap> - <region left="10" top="431" width="26" height="18"/> - <eventInfo> - <keyCode>59</keyCode> - <keyName>KEY_RED</keyName> - </eventInfo> - <tooltip>A</tooltip> - </keyMap> - <keyMap> - <region left="40" top="431" width="26" height="18"/> - <eventInfo> - <keyCode>60</keyCode> - <keyName>KEY_GREEN</keyName> - </eventInfo> - <tooltip>B</tooltip> - </keyMap> - <keyMap> - <region left="70" top="431" width="26" height="18"/> - <eventInfo> - <keyCode>61</keyCode> - <keyName>KEY_YELLOW</keyName> - </eventInfo> - <tooltip>C</tooltip> - </keyMap> - <keyMap> - <region left="99" top="431" width="26" height="18"/> - <eventInfo> - <keyCode>62</keyCode> - <keyName>KEY_CYAN</keyName> - </eventInfo> - <tooltip>D</tooltip> - </keyMap> - <keyMap> - <region left="11" top="456" width="36" height="18"/> - <eventInfo> - <keyCode>213</keyCode> - <keyName>KEY_CAPTION</keyName> - </eventInfo> - <tooltip>CC</tooltip> - </keyMap> - <keyMap> - <region left="51" top="456" width="36" height="18"/> - <eventInfo> - <keyCode>187</keyCode> - <keyName>KEY_MTS</keyName> - </eventInfo> - <tooltip>MTS</tooltip> - </keyMap> - <keyMap> - <region left="89" top="456" width="36" height="18"/> - <eventInfo> - <keyCode>132</keyCode> - <keyName>KEY_PICTURESIZE</keyName> - </eventInfo> - <tooltip>PictureSize</tooltip> - </keyMap> - <keyMap> - <region left="11" top="482" width="36" height="18"/> - <eventInfo> - <keyCode>140</keyCode> - <keyName>KEY_KEYPAD</keyName> - </eventInfo> - <tooltip>KeyPad</tooltip> - </keyMap> - <keyMap> - <region left="51" top="482" width="36" height="18"/> - <eventInfo> - <keyCode>217</keyCode> - <keyName>KEY_SEARCH</keyName> - </eventInfo> - <tooltip>Search</tooltip> - </keyMap> - <keyMap> - <region left="89" top="482" width="36" height="18"/> - <eventInfo> - <keyCode>191</keyCode> - <keyName>KEY_3D</keyName> - </eventInfo> - <tooltip>3D</tooltip> - </keyMap> - <keyMap> - <region left="11" top="519" width="36" height="18"/> - <eventInfo> - <keyCode>168</keyCode> - <keyName>KEY_REWIND</keyName> - </eventInfo> - <tooltip>Rewind</tooltip> - </keyMap> - <keyMap> - <region left="51" top="519" width="36" height="18"/> - <eventInfo> - <keyCode>201</keyCode> - <keyName>KEY_PAUSE</keyName> - </eventInfo> - <tooltip>Pause</tooltip> - </keyMap> - <keyMap> - <region left="89" top="519" width="36" height="18"/> - <eventInfo> - <keyCode>208</keyCode> - <keyName>KEY_FF</keyName> - </eventInfo> - <tooltip>FF</tooltip> - </keyMap> - <keyMap> - <region left="11" top="545" width="36" height="18"/> - <eventInfo> - <keyCode>167</keyCode> - <keyName>KEY_REC</keyName> - </eventInfo> - <tooltip>Rec</tooltip> - </keyMap> - <keyMap> - <region left="51" top="545" width="36" height="18"/> - <eventInfo> - <keyCode>200</keyCode> - <keyName>KEY_PLAY</keyName> - </eventInfo> - <tooltip>Play</tooltip> - </keyMap> - <keyMap> - <region left="89" top="545" width="36" height="18"/> - <eventInfo> - <keyCode>166</keyCode> - <keyName>KEY_STOP</keyName> - </eventInfo> - <tooltip>Stop</tooltip> - </keyMap> - </keyMapList> - <hover> - <color B="255" G="255" R="255" /> - </hover> -</KeyWindowUI> diff --git a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/info.ini b/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/info.ini deleted file mode 100644 index dc7933877c..0000000000 --- a/tizen/src/skin/client/skins/tv/tv-1920x1080/keywindow-layout/Basic(US)/info.ini +++ /dev/null @@ -1 +0,0 @@ -priority=5 diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default.dbi b/tizen/src/skin/client/skins/wearable-360x360-1btn/default.dbi deleted file mode 100644 index e04de57a8c..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default.dbi +++ /dev/null @@ -1,91 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="18" top="92" width="360" height="360"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="396" top="243" width="28" height="58" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="92" top="46" width="360" height="360"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="243" top="0" width="58" height="28" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="46" top="92" width="360" height="360"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="0" top="243" width="28" height="58" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="92" top="18" width="360" height="360"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="243" top="396" width="58" height="28" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <scaleItem visible="false" /> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_0.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_0.png Binary files differdeleted file mode 100644 index cbebacecdf..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_0_p.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_0_p.png Binary files differdeleted file mode 100644 index 50c493299a..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_180.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_180.png Binary files differdeleted file mode 100644 index 6bd1cdd5de..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_180_p.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_180_p.png Binary files differdeleted file mode 100644 index 835c155a48..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_L90.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_L90.png Binary files differdeleted file mode 100644 index c4984f4128..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_L90_p.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_L90_p.png Binary files differdeleted file mode 100644 index dd0eb82bcd..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_R90.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_R90.png Binary files differdeleted file mode 100644 index 0f854a7436..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_R90_p.png b/tizen/src/skin/client/skins/wearable-360x360-1btn/default_R90_p.png Binary files differdeleted file mode 100644 index 1845e6fee1..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable-360x360-1btn/info.ini b/tizen/src/skin/client/skins/wearable-360x360-1btn/info.ini deleted file mode 100644 index 38062e8f71..0000000000 --- a/tizen/src/skin/client/skins/wearable-360x360-1btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=W square 360x360 -resolution.width=360 -resolution.height=360 -manager.priority=1 diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default.dbi b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default.dbi deleted file mode 100644 index fd75d8016f..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default.dbi +++ /dev/null @@ -1,91 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="26" top="60" width="320" height="320"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="372" top="116" width="12" height="80" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="60" top="38" width="320" height="320"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="116" top="0" width="80" height="12" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="38" top="60" width="320" height="320"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="0" top="244" width="12" height="80" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="60" top="26" width="320" height="320"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="244" top="372" width="80" height="12" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <scaleItem visible="false" /> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_0.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_0.png Binary files differdeleted file mode 100644 index cd23252ee7..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_0_p.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_0_p.png Binary files differdeleted file mode 100644 index 4cfaf7874f..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_180.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_180.png Binary files differdeleted file mode 100644 index c641763f50..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_180_p.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_180_p.png Binary files differdeleted file mode 100644 index 871720d0f3..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_L90.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_L90.png Binary files differdeleted file mode 100644 index e7f089b7a7..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_L90_p.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_L90_p.png Binary files differdeleted file mode 100644 index 4d00686f18..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_R90.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_R90.png Binary files differdeleted file mode 100644 index 349d8adb91..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_R90_p.png b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_R90_p.png Binary files differdeleted file mode 100644 index c5b5e6d422..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/info.ini b/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/info.ini deleted file mode 100644 index 91e5967ba4..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-320x320-1btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Wearable 320x320 -resolution.width=320 -resolution.height=320 -manager.priority=1 diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default.dbi b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default.dbi deleted file mode 100644 index d008aa2707..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default.dbi +++ /dev/null @@ -1,91 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="26" top="60" width="360" height="480"/> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="412" top="116" width="12" height="80" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="60" top="38" width="480" height="360"/> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="116" top="0" width="80" height="12" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="38" top="60" width="360" height="480"/> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="0" top="404" width="12" height="80" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="60" top="26" width="480" height="360"/> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="404" top="412" width="80" height="12" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <scaleItem visible="false" /> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_0.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_0.png Binary files differdeleted file mode 100644 index e0ad03ff37..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_0_p.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_0_p.png Binary files differdeleted file mode 100644 index 8d37efa423..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_180.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_180.png Binary files differdeleted file mode 100644 index 18d069c431..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_180_p.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_180_p.png Binary files differdeleted file mode 100644 index da4a6d12c0..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_L90.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_L90.png Binary files differdeleted file mode 100644 index e9da28d2fa..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_L90_p.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_L90_p.png Binary files differdeleted file mode 100644 index 6da71a8f91..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_R90.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_R90.png Binary files differdeleted file mode 100644 index c2a610f092..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_R90_p.png b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_R90_p.png Binary files differdeleted file mode 100644 index 6fdaf197e8..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/info.ini b/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/info.ini deleted file mode 100644 index 97aa980b09..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-360x480-1btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=Wearable 360x480 -resolution.width=360 -resolution.height=480 -manager.priority=1 diff --git a/tizen/src/skin/client/skins/wearable/wearable-general-1btn/default.dbi b/tizen/src/skin/client/skins/wearable/wearable-general-1btn/default.dbi deleted file mode 100644 index 07656109f8..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-general-1btn/default.dbi +++ /dev/null @@ -1,49 +0,0 @@ -<?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.3</dbi_version> - <rotations> - <rotation name="Portrait"> - <display id="0"> - </display> - <keyMapList> - <keyMap> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - </display> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - </display> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - </display> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <topmostItem visible="true" /> - <rotateItem visible="true" /> - <scaleItem visible="false" /> - <keywindowItem visible="true" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - <shellItem visible="true" /> - <controlPanelItem visible="true" /> - <forceCloseItem visible="true" /> - <closeItem visible="true" /> - </popupMenu> - <option> - <blankGuide visible="true" /> - </option> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/wearable/wearable-general-1btn/info.ini b/tizen/src/skin/client/skins/wearable/wearable-general-1btn/info.ini deleted file mode 100644 index 96ef1c0064..0000000000 --- a/tizen/src/skin/client/skins/wearable/wearable-general-1btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=General purpose wearable -resolution.width=all -resolution.height=all -manager.priority=2 diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default.dbi b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default.dbi deleted file mode 100644 index 6fc6b78fbf..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default.dbi +++ /dev/null @@ -1,100 +0,0 @@ -<?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.3</dbi_version> - <layer>rotary</layer> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="18" top="92" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_0.png</rotaryImage> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="396" top="243" width="28" height="58" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="92" top="46" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_L90.png</rotaryImage> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="243" top="0" width="58" height="28" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="46" top="92" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_180.png</rotaryImage> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="0" top="243" width="28" height="58" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="92" top="18" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_R90.png</rotaryImage> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="243" top="396" width="58" height="28" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <scaleItem visible="false" /> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_0.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_0.png Binary files differdeleted file mode 100644 index b717be1035..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_0_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_0_p.png Binary files differdeleted file mode 100644 index 9cc0ff0558..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_180.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_180.png Binary files differdeleted file mode 100644 index de4a7d3b75..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_180_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_180_p.png Binary files differdeleted file mode 100644 index 52b662765c..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_L90.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_L90.png Binary files differdeleted file mode 100644 index 0502f5a2a5..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_L90_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_L90_p.png Binary files differdeleted file mode 100644 index fe6a23bc94..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_R90.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_R90.png Binary files differdeleted file mode 100644 index 9528d00524..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_R90_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_R90_p.png Binary files differdeleted file mode 100644 index bd917a8168..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/info.ini b/tizen/src/skin/client/skins/wearableO-360x360-1btn/info.ini deleted file mode 100644 index bc28dbc866..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/info.ini +++ /dev/null @@ -1,4 +0,0 @@ -skin.name=W circle 360x360 -resolution.width=360 -resolution.height=360 -manager.priority=1 diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/mask.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/mask.png Binary files differdeleted file mode 100644 index 64f34c28fa..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/mask.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_0.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_0.png Binary files differdeleted file mode 100644 index c925de8a04..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_0_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_0_p.png Binary files differdeleted file mode 100644 index 2d615b469a..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_180.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_180.png Binary files differdeleted file mode 100644 index 8256ee7f6e..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_180_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_180_p.png Binary files differdeleted file mode 100644 index 054b2983d4..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_L90.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_L90.png Binary files differdeleted file mode 100644 index c4af05a04a..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_L90_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_L90_p.png Binary files differdeleted file mode 100644 index 8785523c9a..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_R90.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_R90.png Binary files differdeleted file mode 100644 index 355ec648c6..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_R90_p.png b/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_R90_p.png Binary files differdeleted file mode 100644 index 87eb34ffe0..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-1btn/rotary_default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default.dbi b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default.dbi deleted file mode 100644 index dd4ef52820..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default.dbi +++ /dev/null @@ -1,132 +0,0 @@ -<?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.3</dbi_version> - <layer>rotary</layer> - <rotations> - <rotation name="Portrait"> - <display id="0"> - <region left="18" top="92" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_0.png</rotaryImage> - </display> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="368" top="145" width="32" height="36" update="true"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="368" top="363" width="32" height="36" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <display id="0"> - <region left="92" top="22" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_L90.png</rotaryImage> - </display> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="145" top="0" width="36" height="32" update="true"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="363" top="0" width="36" height="32" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <display id="0"> - <region left="22" top="92" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_180.png</rotaryImage> - </display> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="0" top="363" width="32" height="36" update="true"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="0" top="145" width="32" height="36" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <display id="0"> - <region left="92" top="18" width="360" height="360"/> - <maskImage>mask.png</maskImage> - <rotaryImage>rotary_default_R90.png</rotaryImage> - </display> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="363" top="368" width="36" height="32" update="true"/> - <eventInfo> - <keyCode>158</keyCode> - <keyName>Back</keyName> - </eventInfo> - <tooltip>Back</tooltip> - </keyMap> - <keyMap> - <region left="145" top="368" width="36" height="32" update="true"/> - <eventInfo> - <keyCode>116</keyCode> - <keyName>Power</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <hover> - <color B="255" G="255" R="255" /> - </hover> - <popupMenu> - <scaleItem visible="false" /> - <keywindowItem visible="false" /> - <hostKeyboardItem visible="false" /> - <ramdumpItem visible="false" /> - </popupMenu> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_0.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_0.png Binary files differdeleted file mode 100644 index c000929cc9..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_0_p.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_0_p.png Binary files differdeleted file mode 100644 index bdc874ff65..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_180.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_180.png Binary files differdeleted file mode 100644 index b81ac207a5..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_180_p.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_180_p.png Binary files differdeleted file mode 100644 index 0f081ad078..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_L90.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_L90.png Binary files differdeleted file mode 100644 index 33f4e17854..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_L90_p.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_L90_p.png Binary files differdeleted file mode 100644 index afc28acb25..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_R90.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_R90.png Binary files differdeleted file mode 100644 index c3d1fd5ff1..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_R90_p.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_R90_p.png Binary files differdeleted file mode 100644 index 5ef9920cc6..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/info.ini b/tizen/src/skin/client/skins/wearableO-360x360-2btn/info.ini deleted file mode 100644 index 3120a23c25..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/info.ini +++ /dev/null @@ -1,6 +0,0 @@ -skin.name=W circle 360x360 -skin.shape=circle -resolution.width=360 -resolution.height=360 -manager.priority=1 -manager.image.except=x86-standard diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/mask.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/mask.png Binary files differdeleted file mode 100644 index 64f34c28fa..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/mask.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_0.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_0.png Binary files differdeleted file mode 100644 index c925de8a04..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_180.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_180.png Binary files differdeleted file mode 100644 index 8256ee7f6e..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_L90.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_L90.png Binary files differdeleted file mode 100644 index c4af05a04a..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_R90.png b/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_R90.png Binary files differdeleted file mode 100644 index 355ec648c6..0000000000 --- a/tizen/src/skin/client/skins/wearableO-360x360-2btn/rotary_default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/DisplayCanvas.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/DisplayCanvas.java deleted file mode 100644 index 462fd099dc..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/DisplayCanvas.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Display - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -package org.tizen.emulator.skin; - -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.log.SkinLogger; - -public class DisplayCanvas extends Canvas { - private Image maskImage; - - private static Logger logger = SkinLogger.getSkinLogger( - DisplayCanvas.class).getLogger(); - - /** - * Constructor - */ - public DisplayCanvas(Shell parent, int style) { - super(parent, style); - } - - public Image getMaskImage() { - return maskImage; - } - - public void setMaskImage(Image image) { - logger.info("set mask image : " + - image.getImageData().width + "x" + image.getImageData().height); - - maskImage = image; - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorFingers.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorFingers.java deleted file mode 100644 index 470a997dc7..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorFingers.java +++ /dev/null @@ -1,764 +0,0 @@ -/** - * Multi-touch - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Munkyu Im <munkyu.im@samsung.com> - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin; - -import java.util.ArrayList; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.graphics.Region; -import org.tizen.emulator.skin.comm.ICommunicator.MouseButtonType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.data.MouseEventData; -import org.tizen.emulator.skin.info.EmulatorSkinState; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; - -public class EmulatorFingers { - private static final int MAX_FINGER_CNT = 10; - private static final int FINGER_POINT_SIZE = 32; - private static final int FINGER_POINT_ALPHA = 0x7E; - - private Logger logger = - SkinLogger.getSkinLogger(EmulatorFingers.class).getLogger(); - - private EmulatorSkin skin; - protected SocketCommunicator communicator; - private EmulatorSkinState currentState; - - private int multiTouchEnable; - private int maxTouchPoint; - protected int fingerCnt; - - private int grabFingerID = 0; - private ArrayList<FingerPoint> FingerPointList; - - protected int fingerPointSize; - protected int fingerPointSizeHalf; - protected Image fingerPointImage; - - /** - * Constructor - */ - EmulatorFingers(EmulatorSkin skin, PaletteData palette, int maximum) { - this.skin = skin; - this.currentState = skin.currentState; - this.communicator = skin.communicator; - this.fingerPointImage = null; - - initMultiTouchState(maximum, palette); - } - - /* a finger */ - static class FingerPoint { - private int id; - private int originX; /* host position */ - private int originY; - private int x; /* guest position */ - private int y; - - FingerPoint(int originX, int originY, int x, int y) { - this.originX = originX; - this.originY = originY; - this.x = x; - this.y = y; - } - - FingerPoint(int id, int originX, int originY, int x, int y) { - this.id = id; - this.originX = originX; - this.originY = originY; - this.x = x; - this.y = y; - } - }; - - public int removeFingerPointFromSlot(int index) { - grabFingerID = 0; - - FingerPoint finger = getFingerPointFromSlot(index); - if (finger != null) { - logger.info("id " + finger.id + " finger releasing"); - - if (finger.id > 0) { - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - 0, 0, finger.x, finger.y, finger.id - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - finger.id = 0; - finger.originX = finger.originY = finger.x = finger.y = -1; - - fingerCnt--; - } - - return fingerCnt; - } - - public FingerPoint getFingerPointFromSlot(int index) { - if (index < 0 || index >= getMaxTouchPoint()) { - return null; - } - - return FingerPointList.get(index); - } - - public FingerPoint getFingerPointSearch(int x, int y) { - FingerPoint finger = null; - int fingerArea = fingerPointSizeHalf + 2 + - ((100 - skin.currentState.getCurrentScale()) * 4 / 100); - - for (int i = fingerCnt - 1; i >= 0; i--) { - finger = getFingerPointFromSlot(i); - - if (finger != null) { - if (x >= (finger.x - fingerArea) && - x < (finger.x + fingerArea) && - y >= (finger.y - fingerArea) && - y < (finger.y + fingerArea)) { - return finger; - } - } - } - - return null; - } - - private void initMultiTouchState(int maximum, PaletteData palette) { - multiTouchEnable = 0; - - int fingerCntMax = maximum; - if (fingerCntMax > MAX_FINGER_CNT) { - fingerCntMax = MAX_FINGER_CNT; - } - setMaxTouchPoint(fingerCntMax); - - logger.info("maxTouchPoint : " + getMaxTouchPoint()); - fingerCnt = 0; - - FingerPointList = new ArrayList<FingerPoint>(); - for (int i = 0; i < getMaxTouchPoint(); i++) { - FingerPointList.add(new FingerPoint(-1, -1, -1, -1)); - } - - fingerPointSize = FINGER_POINT_SIZE; - fingerPointSizeHalf = fingerPointSize / 2; - - if (palette != null) { - Color pointOutlineColor = new Color(skin.getShell().getDisplay(), - 0xDD, 0xDD, 0xDD); - Color pointColor = new Color(skin.getShell().getDisplay(), - 0x0F, 0x0F, 0x0F); - - ImageData imageData = new ImageData( - fingerPointSize + 4, fingerPointSize + 4, 32, palette); - imageData.transparentPixel = 0; - fingerPointImage = new Image(skin.getShell().getDisplay(), imageData); - - /* draw point image */ - GC gc = new GC(fingerPointImage); - - gc.setBackground(pointColor); - gc.fillOval(2, 2, fingerPointSize, fingerPointSize); - gc.setForeground(pointOutlineColor); - gc.drawOval(0, 0, fingerPointSize + 2, fingerPointSize + 2); - - gc.dispose(); - pointOutlineColor.dispose(); - pointColor.dispose(); - } - } - - public void setMultiTouchEnable(int mode) { - multiTouchEnable = mode; - } - - public int getMultiTouchEnable() { - return multiTouchEnable; - } - - public int getFingerCnt() { - return fingerCnt; - } - - protected int addFingerPoint(int originX, int originY, int x, int y) { - if (fingerCnt == getMaxTouchPoint()) { - logger.warning("support multi-touch up to " - + getMaxTouchPoint() + " fingers"); - return -1; - } - - fingerCnt += 1; - - FingerPointList.get(fingerCnt - 1).id = fingerCnt; - FingerPointList.get(fingerCnt - 1).originX = originX; - FingerPointList.get(fingerCnt - 1).originY = originY; - FingerPointList.get(fingerCnt - 1).x = x; - FingerPointList.get(fingerCnt - 1).y = y; - - logger.info("id " + fingerCnt + " finger touching"); - - return fingerCnt; - } - - protected void drawFingerPoints(GC gc) { - int alpha = gc.getAlpha(); - gc.setAlpha(FINGER_POINT_ALPHA); - - FingerPoint fingerSlot = null; - for (int i = 0; i < fingerCnt; i++) { - fingerSlot = getFingerPointFromSlot(i); - - if (fingerSlot != null) { - gc.drawImage(fingerPointImage, - fingerSlot.originX - fingerPointSizeHalf - 2, - fingerSlot.originY - fingerPointSizeHalf - 2); - } - } - - gc.setAlpha(alpha); - } - - public void maruFingerProcessing1( - int touchType, int originX, int originY, int x, int y) { - FingerPoint finger = null; - MouseEventData mouseEventData = null; - - if (touchType == MouseEventType.PRESS.value() || - touchType == MouseEventType.DRAG.value()) { /* pressed */ - if (grabFingerID > 0) { - finger = getFingerPointFromSlot(grabFingerID - 1); - if (finger != null) { - finger.originX = originX; - finger.originY = originY; - finger.x = x; - finger.y = y; - - if (finger.id != 0) { - /* logger.info("id " + grabFingerID + - " finger multi-touch dragging : (" + x + ", " + y + ")"); */ - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, grabFingerID - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - } - - return; - } - - if (fingerCnt == 0) - { /* first finger touch input */ - logger.info("multi-touch mode 1 processing"); - - if (addFingerPoint(originX, originY, x, y) == -1) { - return; - } - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, 0); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - else if ((finger = getFingerPointSearch(x, y)) != null) - { /* check the position of previous touch event */ - /* finger point is selected */ - grabFingerID = finger.id; - logger.info("id " + grabFingerID + " finger is grabbed"); - } - else if (fingerCnt == getMaxTouchPoint()) - { /* Let's assume that this event is last finger touch input */ - finger = getFingerPointFromSlot(fingerCnt - 1); - if (finger != null) { - /* send release event */ - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - originX, originY, finger.x, finger.y, fingerCnt - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - - /* update position */ - finger.originX = originX; - finger.originY = originY; - finger.x = x; - finger.y = y; - - if (finger.id != 0) { - logger.info("id " + finger.id + " finger touching"); - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, fingerCnt - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - } - } - else /* one more finger */ - { - if (addFingerPoint(originX, originY, x, y) == -1) { - return; - } - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, fingerCnt - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - } else if (touchType == MouseEventType.RELEASE.value()) { /* released */ - //logger.info("mouse up for multi touch"); - grabFingerID = 0; - } - } - - public void maruFingerProcessing2( - int touchType, int originX, int originY, int x, int y) { - FingerPoint finger = null; - MouseEventData mouseEventData = null; - - if (touchType == MouseEventType.PRESS.value() || - touchType == MouseEventType.DRAG.value()) { /* pressed */ - if (grabFingerID > 0) { - finger = getFingerPointFromSlot(grabFingerID - 1); - if (finger != null) { - final int originDistanceX = originX - finger.originX; - final int originDistanceY = originY - finger.originY; - final int distanceX = x - finger.x; - final int distanceY = y - finger.y; - - int i = 0; - - /* bounds checking */ - Region maskRegion = skin.getDisplayCanvas().getRegion(); - if (maskRegion == null) { - final int currrntScreenW = currentState.getCurrentResolutionWidth(); - final int currrntScreenH = currentState.getCurrentResolutionHeight(); - - for (i = 0; i < fingerCnt; i++) { - finger = getFingerPointFromSlot(i); - if (finger != null) { - if (finger.x + distanceX >= currrntScreenW || - finger.x + distanceX < 0 || - finger.y + distanceY >= currrntScreenH || - finger.y + distanceY < 0) { - logger.info("id " + (i + 1) + " finger is out of bounds : (" + - (finger.x + distanceX) + ", " + - (finger.y + distanceY) + ")"); - /* do nothing */ - return; - } - } - } - } else { - for (i = 0; i < fingerCnt; i++) { - finger = getFingerPointFromSlot(i); - if (finger != null) { - if (maskRegion.contains(finger.originX + originDistanceX, - finger.originY + originDistanceY) == false) { - logger.info("id " + (i + 1) + " finger is out of bounds : (" + - (finger.originX + originDistanceX) + ", " + - (finger.originY + originDistanceY) + ")"); - /* do nothing */ - return; - } - } - } - } - - /* move */ - for (i = 0; i < fingerCnt; i++) { - finger = getFingerPointFromSlot(i); - if (finger != null) { - finger.originX += originDistanceX; - finger.originY += originDistanceY; - finger.x += distanceX; - finger.y += distanceY; - - if (finger.id != 0) { - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - finger.originX, finger.originY, finger.x, finger.y, i); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - - /* logger.info(String.format( - "id %d finger multi-touch dragging = (%d, %d)", - i + 1, finger.x, finger.y)); */ - } - - try { - Thread.sleep(1); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - } - - return; - } - - if (fingerCnt == 0) - { /* first finger touch input */ - logger.info("multi-touch mode 2 processing"); - - if (addFingerPoint(originX, originY, x, y) == -1) { - return; - } - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, 0); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - else if ((finger = getFingerPointSearch(x, y)) != null) - { /* check the position of previous touch event */ - /* finger point is selected */ - grabFingerID = finger.id; - logger.info("id " + grabFingerID + " finger is grabbed"); - } - else if (fingerCnt == getMaxTouchPoint()) - { - /* do nothing */ - return; - } - else /* one more finger */ - { - if (addFingerPoint(originX, originY, x, y) == -1) { - return; - } - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, fingerCnt - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - } else if (touchType == MouseEventType.RELEASE.value()) { /* released */ - //logger.info("mouse up for multi touch"); - grabFingerID = 0; - } - } - - public void maruFingerProcessing3( - int touchType, int originX, int originY, int x, int y) { - FingerPoint finger = null; - MouseEventData mouseEventData = null; - - if (touchType == MouseEventType.PRESS.value() || - touchType == MouseEventType.DRAG.value()) { /* pressed */ - if (grabFingerID > 0) { - finger = getFingerPointFromSlot(grabFingerID - 1); - if (finger != null) { - final int originDistanceX = originX - finger.originX; - final int originDistanceY = originY - finger.originY; - final int distanceX = x - finger.x; - final int distanceY = y - finger.y; - - /* move */ - finger.originX += originDistanceX; - finger.originY += originDistanceY; - finger.x += distanceX; - finger.y += distanceY; - if (finger.id != 0) { - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - finger.originX, finger.originY, finger.x, finger.y, finger.id - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - - /* logger.info(String.format( - "id %d finger multi-touch dragging = (%d, %d)", - i + 1, finger.x, finger.y)); */ - } - - if (fingerCnt > 1) { - FingerPoint coFinger = getFingerPointFromSlot( - (grabFingerID == 2) ? 0 : 1); - if (coFinger != null) { - /* bounds checking */ - Region maskRegion = skin.getDisplayCanvas().getRegion(); - if (maskRegion == null) { - final int currrntScreenW = currentState.getCurrentResolutionWidth(); - final int currrntScreenH = currentState.getCurrentResolutionHeight(); - - if (coFinger.x - distanceX >= currrntScreenW || - coFinger.x - distanceX < 0 || - coFinger.y - distanceY >= currrntScreenH || - coFinger.y - distanceY < 0) { - logger.info("id " + coFinger.id + " finger is out of bounds : (" + - (coFinger.x - distanceX) + ", " + - (coFinger.y - distanceY) + ")"); - /* do nothing */ - return; - } - } else { - if (maskRegion.contains(coFinger.originX - originDistanceX, - coFinger.originY - originDistanceY) == false) { - logger.info("id " + coFinger.id + " finger is out of bounds : (" + - (coFinger.originX - originDistanceX) + ", " + - (coFinger.originY - originDistanceY) + ")"); - /* do nothing */ - return; - } - } - - /* move */ - coFinger.originX -= originDistanceX; - coFinger.originY -= originDistanceY; - coFinger.x -= distanceX; - coFinger.y -= distanceY; - if (coFinger.id != 0) { - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - coFinger.originX, coFinger.originY, - coFinger.x, coFinger.y, coFinger.id - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - } - } - } - - return; - } - - if (fingerCnt == 0) - { /* first finger touch input */ - logger.info("multi-touch mode 3 processing"); - - if (addFingerPoint(originX, originY, x, y) == -1) { - return; - } - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, 0); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - else if ((finger = getFingerPointSearch(x, y)) != null) - { /* check the position of previous touch event */ - /* finger point is selected */ - grabFingerID = finger.id; - logger.info("id " + grabFingerID + " finger is grabbed"); - } - else if (fingerCnt >= 2) /* supports up to 2 fingers */ - { /* Let's assume that this event is last finger touch input */ - finger = getFingerPointFromSlot(1); - if (finger != null) { - /* send release event */ - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - originX, originY, finger.x, finger.y, 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - - /* update position */ - finger.originX = originX; - finger.originY = originY; - finger.x = x; - finger.y = y; - - if (finger.id != 0) { - logger.info("id " + finger.id + " finger touching"); - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - } - } - else /* one more finger */ - { - if (addFingerPoint(originX, originY, x, y) == -1) { - return; - } - - mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - originX, originY, x, y, fingerCnt - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - } else if (touchType == MouseEventType.RELEASE.value()) { /* released */ - if (grabFingerID != 0) { - logger.info("id " + grabFingerID + " finger releasing"); - } - grabFingerID = 0; - } - } - - private Boolean calculateOriginCoordinates( - int scaledDisplayWitdh, int scaledDisplayHeight, - double scaleFactor, short rotationId, FingerPoint finger) { - int pointX = 0, pointY = 0; - int rotatedPointX = 0, rotatedPointY = 0; - int flag = 0; - - /* logger.info("ScaledLcdWitdh:" + ScaledLcdWitdh + - " ScaledLcdHeight:" + ScaledLcdHeight + - " scaleFactor:" + scaleFactor + " rotationType:" + rotationType); */ - - rotatedPointX = pointX = (int)(finger.x * scaleFactor); - rotatedPointY = pointY = (int)(finger.y * scaleFactor); - - /* logger.info("rotatedPointX:" + rotatedPointX + - " rotatedPointY:" + rotatedPointY); */ - - if (rotationId == SkinRotations.LANDSCAPE_ID) { - rotatedPointX = pointY; - rotatedPointY = scaledDisplayWitdh - pointX; - } else if (rotationId == SkinRotations.REVERSE_PORTRAIT_ID) { - rotatedPointX = scaledDisplayWitdh - pointX; - rotatedPointY = scaledDisplayHeight - pointY; - } else if (rotationId == SkinRotations.REVERSE_LANDSCAPE_ID) { - rotatedPointX = scaledDisplayHeight - pointY; - rotatedPointY = pointX; - } else { - /* PORTRAIT: do nothing */ - } - - if (finger.originX != rotatedPointX) { - logger.info("finger.originX: " +finger.originX); - finger.originX = rotatedPointX; - flag = 1; - } - if (finger.originY != rotatedPointY) { - logger.info("finger.originY: " +finger.originY); - finger.originY = rotatedPointY; - flag = 1; - } - - if (flag != 0) { - return true; - } - - return false; - } - - public int rearrangeFingerPoints(int displayWidth, int displayHeight, - double scaleFactor, short rotationId) { - if (multiTouchEnable == 0) { - return 0; - } - - int count = 0; - FingerPoint finger = null; - - scaleFactor = scaleFactor / 100; - displayWidth *= scaleFactor; - displayHeight *= scaleFactor; - - for (int i = 0; i < fingerCnt; i++) { - finger = getFingerPointFromSlot(i); - if (finger != null && finger.id != 0) { - if (calculateOriginCoordinates(displayWidth, displayHeight, - scaleFactor, rotationId, finger) == true) { - count++; - } - } - } - - /* if (count != 0) { - grabFingerID = 0; - }*/ - - return count; - } - - public void clearFingerSlot(boolean keepEnable) { - int i = 0; - FingerPoint finger = null; - - if (keepEnable == false) { - setMultiTouchEnable(0); - } - - logger.info("clear multi-touch : " + getMultiTouchEnable()); - - for (i = 0; i < fingerCnt; i++) { - finger = getFingerPointFromSlot(i); - if (finger != null) { - if (finger.id > 0) { - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - 0, 0, finger.x, finger.y, finger.id - 1); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - finger.id = 0; - finger.originX = finger.originY = finger.x = finger.y = -1; - } - } - - grabFingerID = 0; - fingerCnt = 0; - } - - public void cleanupMultiTouchState() { - clearFingerSlot(false); - - fingerPointImage.dispose(); - } - - public int getMaxTouchPoint() { - if (maxTouchPoint <= 0) { - setMaxTouchPoint(1); - } - - return maxTouchPoint; - } - - public void setMaxTouchPoint(int cnt) { - if (cnt <= 0) { - cnt = 1; - } - - maxTouchPoint = cnt; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java deleted file mode 100644 index 98ee4d9e3f..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java +++ /dev/null @@ -1,405 +0,0 @@ -/** - * Emulator Skin Process - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin; - -import java.lang.reflect.Field; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.graphics.PaletteData; -import org.tizen.emulator.skin.comm.ICommunicator.MouseButtonType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.data.DisplayStateData; -import org.tizen.emulator.skin.comm.sock.data.MouseEventData; -import org.tizen.emulator.skin.comm.sock.data.StartData; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.dbi.OptionType; -import org.tizen.emulator.skin.exception.ScreenShotException; -import org.tizen.emulator.skin.image.ImageRegistry.IconName; -import org.tizen.emulator.skin.info.SkinInformation; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.screenshot.SdlScreenShotWindow; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class EmulatorSdlSkin extends EmulatorSkin { - public static final int DISPLAY_COLOR_DEPTH = 32; - - private Logger logger = SkinLogger.getSkinLogger( - EmulatorSdlSkin.class).getLogger(); - - private PaletteData palette; - - /* touch values */ - protected static int pressingX = -1, pressingY = -1; - protected static int pressingOriginX = -1, pressingOriginY = -1; - - private EmulatorFingers fingers; - private int multiTouchKey; - private int multiTouchKeySub1; - private int multiTouchKeySub2; - - /** - * Constructor - */ - public EmulatorSdlSkin(EmulatorConfig config, - SkinInformation skinInfo, boolean isOnTop) { - super(config, skinInfo, SWT.EMBEDDED, isOnTop); - - /* BGRA */ - this.palette = new PaletteData(0x0000FF00, 0x00FF0000, 0xFF000000); - } - - @Override - protected void skinFinalize() { - /* remove multi-touch points */ - if (fingers != null) { - fingers.cleanupMultiTouchState(); - } - - super.skinFinalize(); - } - - @Override - public StartData initSkin() { - initLayout(); - - /* multi-touch toggle key */ - multiTouchKey = SWT.CTRL; - multiTouchKeySub1 = SWT.SHIFT; - multiTouchKeySub2 = SWT.ALT; - - fingers = new EmulatorFingers(this, palette, - config.getArgInt(ArgsConstants.INPUT_TOUCH_MAXPOINT)); - - /* maru_sdl uses this handle ID */ - long id = getDisplayHandleId(); - - /* generate a start data */ - int width = getEmulatorSkinState().getCurrentResolutionWidth(); - int height = getEmulatorSkinState().getCurrentResolutionHeight(); - int scale = getEmulatorSkinState().getCurrentScale(); - short rotation = getEmulatorSkinState().getCurrentRotationId(); - - boolean isBlankGuide = true; - OptionType option = config.getDbiContents().getOption(); - if (option != null) { - isBlankGuide = (option.getBlankGuide() == null) ? - true : option.getBlankGuide().isVisible(); - } - - StartData startData = new StartData(id, - width, height, scale, rotation, isBlankGuide); - logger.info("" + startData); - - return startData; - } - - private long getDisplayHandleId() { - long windowHandleId = 0; - - /* org.eclipse.swt.widgets.Widget */ - if (SwtUtil.isLinuxPlatform()) { - try { - Field field = displayCanvas.getClass().getField("embeddedHandle"); - windowHandleId = field.getLong(displayCanvas); - logger.info("displayCanvas.embeddedHandle:" + windowHandleId); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } catch (IllegalAccessException e ) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } catch (SecurityException e ) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } catch (NoSuchFieldException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } - } else if (SwtUtil.isWindowsPlatform()) { - try { - Field field = displayCanvas.getClass().getField("handle"); - windowHandleId = field.getLong(displayCanvas); - logger.info("displayCanvas.handle:" + windowHandleId); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } catch (IllegalAccessException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } catch (SecurityException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } catch (NoSuchFieldException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - shutdown(); - } - } else { - /* not supported */ - logger.severe("Not Supported OS platform:" + SWT.getPlatform()); - shutdown(); - } - - return windowHandleId; - } - - @Override - public void updateDisplay() { - logger.info("update display"); - - DisplayStateData stateData = new DisplayStateData( - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE, - stateData, false); - } - - @Override - public void displayOn() { - super.displayOn(); - } - - @Override - public void displayOff() { - super.displayOff(); - } - - /* mouse event */ - @Override - protected void mouseMoveDelivery(MouseEvent e, int eventType) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - - /* filtering for multi-touch */ - if (fingers.getMultiTouchEnable() == 1) { - /* Ctrl or Shift */ - fingers.maruFingerProcessing1(eventType, - e.x, e.y, geometry[0], geometry[1]); - return; - } else if (fingers.getMultiTouchEnable() == 2) { - /* Ctrl + Shift */ - fingers.maruFingerProcessing2(eventType, - e.x, e.y, geometry[0], geometry[1]); - return; - } else if (fingers.getMultiTouchEnable() == 3) { - /* Ctrl + Alt */ - fingers.maruFingerProcessing3(eventType, - e.x, e.y, geometry[0], geometry[1]); - return; - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), eventType, - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - @Override - protected void mouseUpDelivery(MouseEvent e) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseUp in display" + - " x:" + geometry[0] + " y:" + geometry[1]); - - pressingX = pressingY = -1; - pressingOriginX = pressingOriginY = -1; - - /* filtering for multi-touch */ - if (fingers.getMultiTouchEnable() == 1) { - fingers.maruFingerProcessing1(MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1]); - return; - } else if (fingers.getMultiTouchEnable() == 2) { - fingers.maruFingerProcessing2(MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1]); - return; - } else if (fingers.getMultiTouchEnable() == 3) { - fingers.maruFingerProcessing3(MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1]); - return; - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - @Override - protected void mouseDownDelivery(MouseEvent e) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseDown in display" + - " x:" + geometry[0] + " y:" + geometry[1]); - - pressingX = geometry[0]; - pressingY = geometry[1]; - pressingOriginX = e.x; - pressingOriginY = e.y; - - /* filtering for multi-touch */ - if (fingers.getMultiTouchEnable() == 1) { - fingers.maruFingerProcessing1(MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1]); - return; - } else if (fingers.getMultiTouchEnable() == 2) { - fingers.maruFingerProcessing2(MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1]); - return; - } else if (fingers.getMultiTouchEnable() == 3) { - fingers.maruFingerProcessing3(MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1]); - return; - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - /* keyboard event */ - @Override - protected void keyReleasedDelivery(int keyCode, - int stateMask, int keyLocation, boolean remove) { - if (fingers.getMaxTouchPoint() > 1) { - /* multi-touch checking */ - final int tempStateMask = stateMask & ~SWT.BUTTON1; - - if (keyCode == multiTouchKey || keyCode == multiTouchKeySub1) { - if (tempStateMask == (multiTouchKeySub1 | multiTouchKey)) { - fingers.setMultiTouchEnable(1); - logger.info("enable multi-touch mode 2->1"); - } else { - fingers.clearFingerSlot(false); - logger.info("disable multi-touch"); - } - } else if (keyCode == multiTouchKeySub2) { - if (tempStateMask == (multiTouchKey | multiTouchKeySub2)) { - fingers.setMultiTouchEnable(1); - logger.info("enable multi-touch mode 3->1"); - } else { - fingers.clearFingerSlot(false); - logger.info("disable multi-touch"); - } - } - } - - super.keyReleasedDelivery(keyCode, stateMask, keyLocation, remove); - } - - @Override - protected void keyPressedDelivery(int keyCode, - int stateMask, int keyLocation, boolean add) { - if (fingers.getMaxTouchPoint() > 1) { - /* multi-touch checking */ - final int tempStateMask = stateMask & ~SWT.BUTTON1; - - if ((keyCode == multiTouchKey && tempStateMask == multiTouchKeySub2) || - (keyCode == multiTouchKeySub2 && tempStateMask == multiTouchKey)) - { - /* multi-touch mode 3 supports up to 2 fingers */ - int i = fingers.getFingerCnt(); - for ( ; i > 2; i--) { - fingers.removeFingerPointFromSlot(i - 1); - } - - fingers.setMultiTouchEnable(3); - - logger.info("enable multi-touch mode 3"); - } - else if ((keyCode == multiTouchKey && tempStateMask == multiTouchKeySub1) || - (keyCode == multiTouchKeySub1 && tempStateMask == multiTouchKey)) - { - fingers.setMultiTouchEnable(2); - - logger.info("enable multi-touch mode 2"); - } else if (keyCode == multiTouchKeySub1 || keyCode == multiTouchKey) { - fingers.setMultiTouchEnable(1); - - logger.info("enable multi-touch mode 1"); - } else { - if (fingers.getMultiTouchEnable() != 0) { - fingers.clearFingerSlot(false); - logger.info("disable multi-touch"); - } - } - } - - super.keyPressedDelivery(keyCode, stateMask, keyLocation, add); - } - - @Override - protected void openScreenShotWindow() { - if (screenShotDialog != null) { - logger.info("screenshot window was already opened"); - return; - } - - screenShotDialog = new SdlScreenShotWindow(this, config, - palette, imageRegistry.getIcon(IconName.SCREENSHOT)); - - try { - screenShotDialog.open(); - } catch (ScreenShotException ex) { - screenShotDialog = null; - logger.log(Level.SEVERE, ex.getMessage(), ex); - - SkinUtil.openMessage(shell, null, - "Fail to create a screen shot.", SWT.ICON_ERROR, config); - } catch (Exception ex) { - screenShotDialog = null; - logger.log(Level.SEVERE, ex.getMessage(), ex); - - SkinUtil.openMessage(shell, null, "ScreenShot is not ready.\n" + - "Please wait until the emulator is completely boot up.", - SWT.ICON_WARNING, config); - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java deleted file mode 100644 index ca327cead8..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java +++ /dev/null @@ -1,711 +0,0 @@ -/** - * Emulator Skin Process - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.comm.ICommunicator.MouseButtonType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.data.MouseEventData; -import org.tizen.emulator.skin.comm.sock.data.StartData; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.dbi.OptionType; -import org.tizen.emulator.skin.exception.ScreenShotException; -import org.tizen.emulator.skin.image.ImageRegistry.IconName; -import org.tizen.emulator.skin.info.SkinInformation; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.screenshot.ShmScreenShotWindow; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class EmulatorShmSkin extends EmulatorSkin { - public static final String JNI_LIBRARY_FILE = "shared"; - public static final int DISPLAY_COLOR_DEPTH = 24; /* no need to get Alpha channel */ - - private static Logger logger = SkinLogger.getSkinLogger( - EmulatorShmSkin.class).getLogger(); - - static { - /* load JNI library file */ - try { - System.loadLibrary(JNI_LIBRARY_FILE); - } catch (UnsatisfiedLinkError e) { - logger.severe("Failed to load a " + JNI_LIBRARY_FILE + " file.\n" + e); - - Shell temp = new Shell(Display.getDefault()); - MessageBox messageBox = new MessageBox(temp, SWT.ICON_ERROR); - messageBox.setText("Emulator"); - messageBox.setMessage( - "Failed to load a JNI library file from " - + System.getProperty("java.library.path") + ".\n\n" + e); - messageBox.open(); - temp.dispose(); - - EmulatorSkinMain.terminateImmediately(-1); - } - } - - /* define JNI functions */ - public native int shmget(int shmkey, int size); - public native int shmdt(); - public native int getPixels(int[] array); - - private PaletteData palette; - private BufferPainter bufferPainter; - private Image imageCover; - - /* touch values */ - protected static int pressingX = -1, pressingY = -1; - protected static int pressingOriginX = -1, pressingOriginY = -1; - - private EmulatorFingers fingers; - private int multiTouchKey; - private int multiTouchKeySub1; - private int multiTouchKeySub2; - - class BufferPainter extends Thread { - private Display display; - private int widthFB; - private int heightFB; - private int sizeFramebuffer; - private int[] arrayFramebuffer; - private ImageData dataFramebuffer; - private Image imageFramebuffer; - - private volatile boolean stopRequest; - private Runnable runnable; - private int intervalWait; - - /** - * Constructor - */ - public BufferPainter(PaletteData paletteDisplay, int widthFB, int heightFB) { - this.display = Display.getDefault(); - this.widthFB = widthFB; - this.heightFB = heightFB; - this.sizeFramebuffer = widthFB * heightFB; - this.arrayFramebuffer = new int[sizeFramebuffer]; - - this.dataFramebuffer = - new ImageData(widthFB, heightFB, DISPLAY_COLOR_DEPTH, paletteDisplay); - this.imageFramebuffer = - new Image(Display.getDefault(), dataFramebuffer); - - setName("BufferPainter"); - setDaemon(true); - setWaitIntervalTime(0); - - this.runnable = new Runnable() { - @Override - public void run() { - if (displayCanvas.isDisposed() == false) { - displayCanvas.redraw(); - } - } - }; - } - - public synchronized void setWaitIntervalTime(int ms) { - intervalWait = ms; - } - - public synchronized int getWaitIntervalTime() { - return intervalWait; - } - - @Override - public void run() { - stopRequest = false; - - while (!stopRequest) { - synchronized(this) { - try { - this.wait(intervalWait); /* ms */ - } catch (InterruptedException e) { - e.printStackTrace(); - break; - } - } - - if (stopRequest == true) { - break; - } - - if (display.isDisposed() == false) { - /* canvas update */ - display.asyncExec(runnable); - } - } - - logger.info("PollFBThread is stopped"); - - int result = shmdt(); - logger.info("shmdt native function returned " + result); - } - - public void getPixelsFromSharedMemory() { - //int result = - getPixels(arrayFramebuffer); - //logger.info("getPixels native function returned " + result); - - communicator.sendToQEMU( - SendCommand.RESPONSE_DRAW_FRAME, null, true); - - dataFramebuffer.setPixels(0, 0, - sizeFramebuffer, arrayFramebuffer, 0); - - if (display.isDisposed() == false) { - display.asyncExec(new Runnable() { - @Override - public void run() { - imageFramebuffer.dispose(); - imageFramebuffer = new Image(display, dataFramebuffer); - } - }); - } - } - - public void stopRequest() { - stopRequest = true; - - synchronized(bufferPainter) { - bufferPainter.notify(); - } - } - } - - /** - * Constructor - */ - public EmulatorShmSkin(EmulatorConfig config, - SkinInformation skinInfo, boolean isOnTop) { - super(config, skinInfo, SWT.NONE, isOnTop); - - /* ARGB */ - this.palette = new PaletteData(0x00FF0000, 0x0000FF00, 0x000000FF); - } - - @Override - protected void skinFinalize() { - bufferPainter.stopRequest(); - - /* remove multi-touch points */ - if (fingers != null) { - fingers.cleanupMultiTouchState(); - } - - super.skinFinalize(); - } - - @Override - public StartData initSkin() { - initLayout(); - - /* multi-touch toggle key */ - if (SwtUtil.isMacPlatform() == true) { - multiTouchKey = SWT.COMMAND; - } else { - multiTouchKey = SWT.CTRL; - } - multiTouchKeySub1 = SWT.SHIFT; - multiTouchKeySub2 = SWT.ALT; - - fingers = new EmulatorFingers(this, palette, - config.getArgInt(ArgsConstants.INPUT_TOUCH_MAXPOINT)); - - initDisplay(); - - /* generate a start data */ - int width = getEmulatorSkinState().getCurrentResolutionWidth(); - int height = getEmulatorSkinState().getCurrentResolutionHeight(); - int scale = getEmulatorSkinState().getCurrentScale(); - short rotation = getEmulatorSkinState().getCurrentRotationId(); - - boolean isBlankGuide = true; - OptionType option = config.getDbiContents().getOption(); - if (option != null) { - isBlankGuide = (option.getBlankGuide() == null) ? - true : option.getBlankGuide().isVisible(); - } - - StartData startData = new StartData(0, - width, height, scale, rotation, isBlankGuide); - logger.info("" + startData); - - return startData; - } - - private void initDisplay() { - /* initialize shared memory */ - /* base + 1 = sdb port */ - /* base + 2 = shared memory key */ - int shmkey = config.getArgInt(ArgsConstants.VM_BASE_PORT) + 2; - logger.info("shmkey = " + shmkey); - - int result = shmget(shmkey, - currentState.getCurrentResolutionWidth() * - currentState.getCurrentResolutionHeight() * 4); - logger.info("shmget native function returned " + result); - - if (result == 1) { - logger.severe("Failed to get identifier of the shared memory segment."); - SkinUtil.openMessage(shell, null, - "Cannot launch this VM.\n" + - "Failed to get identifier of the shared memory segment.", - SWT.ICON_ERROR, config); - - EmulatorSkinMain.terminateImmediately(-1); - } else if (result == 2) { - logger.severe("Failed to attach the shared memory segment."); - SkinUtil.openMessage(shell, null, - "Cannot launch this VM.\n" + - "Failed to attach the shared memory segment.", - SWT.ICON_ERROR, config); - - EmulatorSkinMain.terminateImmediately(-1); - } - - /* display updater thread */ - bufferPainter = new BufferPainter(palette, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight()); - - displayCanvas.addPaintListener(new PaintListener() { - public void paintControl(PaintEvent e) { - /* e.gc.setAdvanced(true); - if (!e.gc.getAdvanced()) { - logger.info("Advanced graphics not supported"); - } */ - - final int screen_width = displayCanvas.getSize().x; - final int screen_height = displayCanvas.getSize().y; - - /* blank guide */ - if (imageCover != null) { - logger.info("draw cover image"); - - drawImage(e.gc, imageCover, screen_width, screen_height); - - imageCover = null; - return; - } - - if (isOnInterpolation == false) { - /* Mac - NSImageInterpolationNone */ - /* Ubuntu - CAIRO_FILTER_NEAREST */ - e.gc.setInterpolation(SWT.NONE); - } else { - /* Mac - NSImageInterpolationHigh */ - /* Ubuntu - CAIRO_FILTER_BEST */ - e.gc.setInterpolation(SWT.HIGH); - } - - switch(currentState.getCurrentRotationId()) { - case SkinRotations.LANDSCAPE_ID: - /* landscape */ - e.gc.setTransform(displayTransform); - e.gc.drawImage(bufferPainter.imageFramebuffer, - 0, 0, bufferPainter.widthFB, bufferPainter.heightFB, - 0, 0, screen_height, screen_width); - e.gc.setTransform(null); /* set to the identity transform */ - break; - case SkinRotations.REVERSE_PORTRAIT_ID: - /* reverse-portrait */ - e.gc.setTransform(displayTransform); - e.gc.drawImage(bufferPainter.imageFramebuffer, - 0, 0, bufferPainter.widthFB, bufferPainter.heightFB, - 0, 0, screen_width, screen_height); - e.gc.setTransform(null); - break; - case SkinRotations.REVERSE_LANDSCAPE_ID: - /* reverse-landscape */ - e.gc.setTransform(displayTransform); - e.gc.drawImage(bufferPainter.imageFramebuffer, - 0, 0, bufferPainter.widthFB, bufferPainter.heightFB, - 0, 0, screen_height, screen_width); - e.gc.setTransform(null); - break; - default: - /* portrait */ - e.gc.drawImage(bufferPainter.imageFramebuffer, - 0, 0, bufferPainter.widthFB, bufferPainter.heightFB, - 0, 0, screen_width, screen_height); - break; - } - - if (fingers != null && fingers.getMultiTouchEnable() != 0) { - /* draw points for multi-touch */ - fingers.drawFingerPoints(e.gc); - } - } - }); - - bufferPainter.start(); - } - - @Override - public void updateDisplay() { - bufferPainter.getPixelsFromSharedMemory(); - - synchronized(bufferPainter) { - bufferPainter.notify(); - } - } - - @Override - public void setSuitableTransform() { - super.setSuitableTransform(); - - if (fingers != null) { - fingers.rearrangeFingerPoints( - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - } - } - - @Override - public void setCoverImage(final Image image) { - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - imageCover = image; - - displayCanvas.redraw(); - } - }); - } - - private void drawImage(GC gc, final Image imageSrc, int widthDst, int heightDst) { - int widthSrc = imageSrc.getImageData().width; - int heightSrc = imageSrc.getImageData().height; - int margin_w = widthDst - widthSrc; - int margin_h = heightDst - heightSrc; - int margin = Math.min(margin_w, margin_h); - - int widthScaledImage = widthSrc; - int heightScaledImage = heightSrc; - if (margin < 0) { - widthScaledImage += margin; - heightScaledImage += margin; - } - - gc.drawImage(imageSrc, 0, 0, - widthSrc, heightSrc, - (widthDst - widthScaledImage) / 2, - (heightDst - heightScaledImage) / 2, - widthScaledImage, heightScaledImage); - } - - @Override - public void displayOn() { - super.displayOn(); - } - - @Override - public void displayOff() { - super.displayOff(); - - /*if (pollThread.isAlive()) { - pollThread.setWaitIntervalTime(0); - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - lcdCanvas.redraw(); - } - }); - }*/ - } - - /* mouse event */ - @Override - protected void mouseMoveDelivery(MouseEvent e, int eventType) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - - /* filtering for multi-touch */ - if (fingers.getMultiTouchEnable() == 1) { - /* Ctrl or Shift */ - fingers.maruFingerProcessing1(eventType, - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } else if (fingers.getMultiTouchEnable() == 2) { - /* Ctrl + Shift */ - fingers.maruFingerProcessing2(eventType, - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } else if (fingers.getMultiTouchEnable() == 3) { - /* Ctrl + Alt */ - fingers.maruFingerProcessing3(eventType, - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), eventType, - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - @Override - protected void mouseUpDelivery(MouseEvent e) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseUp in display" + - " x:" + geometry[0] + " y:" + geometry[1]); - - pressingX = pressingY = -1; - pressingOriginX = pressingOriginY = -1; - - /* filtering for multi-touch */ - if (fingers.getMultiTouchEnable() == 1) { - fingers.maruFingerProcessing1(MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } else if (fingers.getMultiTouchEnable() == 2) { - fingers.maruFingerProcessing2(MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } else if (fingers.getMultiTouchEnable() == 3) { - fingers.maruFingerProcessing3(MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - @Override - protected void mouseDownDelivery(MouseEvent e) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseDown in display" + - " x:" + geometry[0] + " y:" + geometry[1]); - - pressingX = geometry[0]; - pressingY = geometry[1]; - pressingOriginX = e.x; - pressingOriginY = e.y; - - /* filtering for multi-touch */ - if (fingers.getMultiTouchEnable() == 1) { - fingers.maruFingerProcessing1(MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } else if (fingers.getMultiTouchEnable() == 2) { - fingers.maruFingerProcessing2(MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } else if (fingers.getMultiTouchEnable() == 3) { - fingers.maruFingerProcessing3(MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1]); - - displayCanvas.redraw(); - return; - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - - /* keyboard event */ - @Override - protected void keyReleasedDelivery(int keyCode, - int stateMask, int keyLocation, boolean remove) { - if (fingers.getMaxTouchPoint() > 1) { - /* multi-touch checking */ - final int tempStateMask = stateMask & ~SWT.BUTTON1; - - if (keyCode == multiTouchKey || keyCode == multiTouchKeySub1) { - if (tempStateMask == (multiTouchKeySub1 | multiTouchKey)) { - fingers.setMultiTouchEnable(1); - logger.info("enable multi-touch mode 2->1"); - } else { - fingers.clearFingerSlot(false); - logger.info("disable multi-touch"); - } - - displayCanvas.redraw(); - } else if (keyCode == multiTouchKeySub2) { - if (tempStateMask == (multiTouchKey | multiTouchKeySub2)) { - fingers.setMultiTouchEnable(1); - logger.info("enable multi-touch mode 3->1"); - } else { - fingers.clearFingerSlot(false); - logger.info("disable multi-touch"); - } - - displayCanvas.redraw(); - } - } - - super.keyReleasedDelivery(keyCode, stateMask, keyLocation, remove); - } - - @Override - protected void keyPressedDelivery(int keyCode, - int stateMask, int keyLocation, boolean add) { - if (fingers.getMaxTouchPoint() > 1) { - /* multi-touch checking */ - final int tempStateMask = stateMask & ~SWT.BUTTON1; - - if ((keyCode == multiTouchKey && tempStateMask == multiTouchKeySub2) || - (keyCode == multiTouchKeySub2 && tempStateMask == multiTouchKey)) - { - /* multi-touch mode 3 supports up to 2 fingers */ - int i = fingers.getFingerCnt(); - for ( ; i > 2; i--) { - fingers.removeFingerPointFromSlot(i - 1); - } - displayCanvas.redraw(); - - fingers.setMultiTouchEnable(3); - - logger.info("enable multi-touch mode 3"); - } - else if ((keyCode == multiTouchKey && tempStateMask == multiTouchKeySub1) || - (keyCode == multiTouchKeySub1 && tempStateMask == multiTouchKey)) - { - fingers.setMultiTouchEnable(2); - - logger.info("enable multi-touch mode 2"); - } else if (keyCode == multiTouchKeySub1 || keyCode == multiTouchKey) { - fingers.setMultiTouchEnable(1); - - /* Before the Emulator starts multi-touch processing, - * add a first finger if user just switches on to the multi-touch mode - * while display dragging. */ - if (fingers.getFingerCnt() == 0 && pressingX != -1 && pressingY != -1 && - pressingOriginX != -1 && pressingOriginY != -1) { - if (fingers.addFingerPoint( - pressingOriginX, pressingOriginY, - pressingX, pressingY) != -1) { - displayCanvas.redraw(); - } - - pressingX = pressingY = -1; - pressingOriginX = pressingOriginY = -1; - } - - logger.info("enable multi-touch mode 1"); - } else { - if (fingers.getMultiTouchEnable() != 0) { - fingers.clearFingerSlot(false); - logger.info("disable multi-touch"); - - displayCanvas.redraw(); - } - } - } - - super.keyPressedDelivery(keyCode, stateMask, keyLocation, add); - } - - @Override - protected void openScreenShotWindow() { - if (screenShotDialog != null) { - logger.info("screenshot window was already opened"); - return; - } - - screenShotDialog = new ShmScreenShotWindow(this, config, - palette, imageRegistry.getIcon(IconName.SCREENSHOT)); - - try { - screenShotDialog.open(); - } catch (ScreenShotException ex) { - screenShotDialog = null; - logger.log(Level.SEVERE, ex.getMessage(), ex); - - SkinUtil.openMessage(shell, null, - "Fail to create a screen shot.", SWT.ICON_ERROR, config); - - } catch (Exception ex) { - screenShotDialog = null; - logger.log(Level.SEVERE, ex.getMessage(), ex); - - SkinUtil.openMessage(shell, null, "ScreenShot is not ready.\n" + - "Please wait until the emulator is completely boot up.", - SWT.ICON_WARNING, config); - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShutdownhook.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShutdownhook.java deleted file mode 100644 index fd5814d331..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShutdownhook.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Shutdown Hook - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin; - -import java.util.logging.Logger; - -import org.tizen.emulator.skin.comm.ICommunicator; -import org.tizen.emulator.skin.log.SkinLogger; - -/** - * - * - */ -public class EmulatorShutdownhook extends Thread { - private Logger logger = - SkinLogger.getSkinLogger(EmulatorShutdownhook.class).getLogger(); - - private ICommunicator communicator; - - public EmulatorShutdownhook(ICommunicator communicator) { - this.communicator = communicator; - } - - @Override - public void run() { - logger.info("EmulatorShutdownhook run by a signal."); - communicator.terminate(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java deleted file mode 100644 index 9bfa957ab1..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ /dev/null @@ -1,2081 +0,0 @@ -/** - * Emulator Skin Process - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin; - -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map.Entry; -import java.util.Random; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.MenuDetectEvent; -import org.eclipse.swt.events.MenuDetectListener; -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.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.ShellEvent; -import org.eclipse.swt.events.ShellListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.graphics.Transform; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseButtonType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator.DataTranfer; -import org.tizen.emulator.skin.comm.sock.data.BooleanData; -import org.tizen.emulator.skin.comm.sock.data.DisplayStateData; -import org.tizen.emulator.skin.comm.sock.data.KeyEventData; -import org.tizen.emulator.skin.comm.sock.data.MouseEventData; -import org.tizen.emulator.skin.comm.sock.data.StartData; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants; -import org.tizen.emulator.skin.custom.CustomProgressBar; -import org.tizen.emulator.skin.custom.SkinWindow; -import org.tizen.emulator.skin.dbi.HoverType; -import org.tizen.emulator.skin.dbi.RgbType; -import org.tizen.emulator.skin.dbi.RotationType; -import org.tizen.emulator.skin.dialog.AboutDialog; -import org.tizen.emulator.skin.dialog.DetailInfoDialog; -import org.tizen.emulator.skin.dialog.RamdumpDialog; -import org.tizen.emulator.skin.image.ImageRegistry; -import org.tizen.emulator.skin.info.EmulatorSkinState; -import org.tizen.emulator.skin.info.SkinInformation; -import org.tizen.emulator.skin.layout.GeneralPurposeSkinComposer; -import org.tizen.emulator.skin.layout.ISkinComposer; -import org.tizen.emulator.skin.layout.ProfileRotarySkinComposer; -import org.tizen.emulator.skin.layout.ProfileSpecificSkinComposer; -import org.tizen.emulator.skin.layout.rotation.Rotation; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.menu.KeyWindowKeeper; -import org.tizen.emulator.skin.menu.PopupMenu; -import org.tizen.emulator.skin.screenshot.ScreenShotDialog; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.StringUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -/** - * - * - */ -public class EmulatorSkin { - public enum SkinBasicColor { - BLUE(0, 174, 239), - YELLOW(246, 226, 0), - LIME(0, 246, 12), - VIOLET(168, 43, 255), - ORANGE(246, 110, 0), - MAGENTA(245, 48, 233), - PURPLE(94, 73, 255), - GREEN(179, 246, 0), - RED(245, 48, 48), - CYON(29, 223, 221); - - private int channelRed; - private int channelGreen; - private int channelBlue; - - SkinBasicColor(int r, int g, int b) { - channelRed = r; - channelGreen = g; - channelBlue = b; - } - - public RGB color() { - return new RGB(channelRed, channelGreen, channelBlue); - } - } - - private static Logger logger = - SkinLogger.getSkinLogger(EmulatorSkin.class).getLogger(); - - public EmulatorConfig config; - protected Shell shell; - protected ImageRegistry imageRegistry; - protected DisplayCanvas displayCanvas; - private int displayCanvasStyle; - public Transform displayTransform; - public SkinInformation skinInfo; - protected ISkinComposer skinComposer; - - protected EmulatorSkinState currentState; - - protected boolean isDisplayDragging; - protected Point shellGrabPosition; - protected boolean isShutdownRequested; - public boolean isOnTop; - public boolean isOnInterpolation; - public boolean isKeyWindow; - public boolean isOnKbd; - private PopupMenu popupMenu; - private Timer closeTimer; - - public Color colorVM; - private KeyWindowKeeper keyWindowKeeper; - public CustomProgressBar bootingProgress; - public ScreenShotDialog screenShotDialog; - - public SocketCommunicator communicator; - private AtomicBoolean demanderFlag = new AtomicBoolean(false); - private ShellListener shellListener; - private MenuDetectListener shellMenuDetectListener; - - protected boolean isDisplayOn; - private int prev_x; - private int prev_y; - private MouseMoveListener canvasMouseMoveListener; - private MouseListener canvasMouseListener; - private MouseWheelListener canvasMouseWheelListener; - private KeyListener canvasKeyListener; - private MenuDetectListener canvasMenuDetectListener; - private FocusListener canvasFocusListener; - private LinkedList<KeyEventData> pressedKeyEventList; - - /** - * @brief constructor - * @param config : configuration of emulator skin - * @param isOnTop : always on top flag - */ - protected EmulatorSkin(EmulatorConfig config, SkinInformation skinInfo, - int displayCanvasStyle, boolean isOnTop) { - this.config = config; - this.skinInfo = skinInfo; - - this.screenShotDialog = null; - this.pressedKeyEventList = new LinkedList<KeyEventData>(); - - this.isOnTop = isOnTop; - this.isOnInterpolation = true; - this.isOnKbd = false; - this.isKeyWindow = false; - this.closeTimer = new Timer(); - - int style = SWT.NO_TRIM | SWT.DOUBLE_BUFFERED; - this.shell = new Shell(Display.getDefault(), style); - if (isOnTop == true) { - if (SkinUtil.setTopMost(shell, true) == false) { - logger.info("failed to set top most"); - this.isOnTop = false; - } - } - - this.displayCanvasStyle = displayCanvasStyle; - - /* prepare for VM state management */ - this.shellGrabPosition = new Point(-1, -1); - this.currentState = new EmulatorSkinState(); - - setColorVM(); /* generate a identity color */ - - this.keyWindowKeeper = new KeyWindowKeeper(this); - - if (SwtUtil.isMacPlatform() == true) { - shell.getDisplay().addListener(SWT.Close, new Listener() { - @Override - public void handleEvent(Event e) { - if (pressedKeyEventList.size() == 1) { - KeyEventData data = pressedKeyEventList.get(0); - if (data.keycode == SWT.COMMAND && data.stateMask == 0) { - logger.info("COMMAND terminated!"); - EmulatorSkinMain.terminateImmediately(-1); - } - } - } - }); - } - } - - public void setCommunicator(SocketCommunicator communicator) { - this.communicator = communicator; - } - - private void setColorVM() { - int portNumber = config.getArgInt(ArgsConstants.VM_BASE_PORT); - - if (portNumber >= 26200 || portNumber <= 0) { - Random rand = new Random(); - - int red = rand.nextInt(255); - int green = rand.nextInt(255); - int blue = rand.nextInt(255); - this.colorVM = new Color(shell.getDisplay(), new RGB(red, green, blue)); - } else { - int vmIndex = (portNumber % 100) / 10; - - SkinBasicColor colors[] = SkinBasicColor.values(); - this.colorVM = new Color(shell.getDisplay(), - colors[vmIndex].color()); - } - } - - public StartData initSkin() { - /* abstract */ - - return null; - } - - protected long initLayout() { - logger.info("initialize the skin layout"); - - imageRegistry = ImageRegistry.getInstance(); - - /* set emulator states */ - currentState.setCurrentResolutionWidth(config.getValidResolutionWidth()); - currentState.setCurrentResolutionHeight(config.getValidResolutionHeight()); - - currentState.setCurrentScale(config.getValidScale()); - currentState.setCurrentRotationId(); - - /* create and attach a popup menu */ - popupMenu = new PopupMenu(config, this); - - /* build a skin layout */ - if (skinInfo.isGeneralPurposeSkin() == false) { - if (StringUtil.nvl(config.getDbiContents().getLayer()) - .compareToIgnoreCase("rotary") == 0) { - logger.info("profile rotary skin"); - - skinComposer = new ProfileRotarySkinComposer(config, this); - } else { - skinComposer = new ProfileSpecificSkinComposer(config, this); - } - } else { /* general purpose skin */ - skinComposer = new GeneralPurposeSkinComposer(config, this); - } - - displayCanvas = skinComposer.compose(displayCanvasStyle); - - /* */ - //TODO: move - if (config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true) { - prev_x = displayCanvas.getSize().x / 2; - prev_y = displayCanvas.getSize().y / 2; - logger.info("prev_x : " + prev_x + " prev_y : " + prev_y); - isDisplayOn = false; - } - - /* load a hover color */ - currentState.setHoverColor(loadHoverColor()); - - /* added event handlers */ - addMainWindowListeners(); - addCanvasListeners(); - - displayCanvas.setFocus(); - - return 0; - } - - private Color loadHoverColor() { - HoverType hover = config.getDbiContents().getHover(); - - if (null != hover) { - RgbType hoverRgb = hover.getColor(); - if (null != hoverRgb) { - Long r = hoverRgb.getR(); - Long g = hoverRgb.getG(); - Long b = hoverRgb.getB(); - - if (null != r && null != g && null != b) { - Color hoverColor = new Color(shell.getDisplay(), new RGB( - r.intValue(), g.intValue(), b.intValue())); - - return hoverColor; - } - } - } - - /* white */ - return (new Color(shell.getDisplay(), new RGB(255, 255, 255))); - } - - /* getters */ - public Shell getShell() { - return shell; - } - - public DisplayCanvas getDisplayCanvas() { - return displayCanvas; - } - - public EmulatorSkinState getEmulatorSkinState() { - return currentState; - } - - public ImageRegistry getImageRegistry() { - return imageRegistry; - } - - public Color getColorVM() { - return colorVM; - } - - public PopupMenu getPopupMenu() { - return popupMenu; - } - - public KeyWindowKeeper getKeyWindowKeeper() { - return keyWindowKeeper; - } - - public void open() { - if (null == this.communicator) { - logger.severe("communicator is null."); - return; - } - - Display display = this.shell.getDisplay(); - - this.shell.open(); - - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) { - display.sleep(); - } - } - } - - protected void skinFinalize() { - logger.info("skinFinalize"); - - skinComposer.composerFinalize(); - } - - /* window grabbing */ - public void grabShell(int x, int y) { - shellGrabPosition.x = x; - shellGrabPosition.y = y; - - if (SwtUtil.isWindowsPlatform() == true) { - final BooleanData dataGrabbing = new BooleanData( - true, SendCommand.SEND_SKIN_GRABBED.toString()); - communicator.sendToQEMU(SendCommand.SEND_SKIN_GRABBED, dataGrabbing, false); - } - } - - public void ungrabShell() { - shellGrabPosition.x = -1; - shellGrabPosition.y = -1; - - if (SwtUtil.isWindowsPlatform() == true) { - final BooleanData dataGrabbing = new BooleanData( - false, SendCommand.SEND_SKIN_GRABBED.toString()); - communicator.sendToQEMU(SendCommand.SEND_SKIN_GRABBED, dataGrabbing, false); - } - } - - public boolean isShellGrabbing() { - return shellGrabPosition.x >= 0 && shellGrabPosition.y >= 0; - } - - public Point getGrabPosition() { - if (isShellGrabbing() == false) { - return null; - } - - return shellGrabPosition; - } - - private void addMainWindowListeners() { - shellListener = new ShellListener() { - @Override - public void shellClosed(ShellEvent event) { - logger.info("Main Window is closed"); - - if (isShutdownRequested) { - closeTimer.cancel(); - removeShellListeners(); - removeCanvasListeners(); - - /* close the screen shot window */ - if (null != screenShotDialog) { - Shell scShell = screenShotDialog.getShell(); - if (!scShell.isDisposed()) { - scShell.close(); - } - screenShotDialog = null; - } - - /* save config only for emulator close */ - config.setSkinProperty( - SkinPropertiesConstants.WINDOW_X, - shell.getLocation().x); - config.setSkinProperty( - SkinPropertiesConstants.WINDOW_Y, - shell.getLocation().y); - config.setSkinProperty( - SkinPropertiesConstants.WINDOW_SCALE, - currentState.getCurrentScale()); - config.setSkinProperty( - SkinPropertiesConstants.WINDOW_ROTATION, - currentState.getCurrentRotationId()); - config.setSkinProperty( - SkinPropertiesConstants.WINDOW_ONTOP, - Boolean.toString(isOnTop)); - config.setSkinProperty( - SkinPropertiesConstants.WINDOW_INTERPOLATION, - Boolean.toString(isOnInterpolation)); - - int dockValue = 0; - SkinWindow keyWindow = getKeyWindowKeeper().getKeyWindow(); - if (keyWindow != null - && keyWindow.getShell().isVisible() == true) { - dockValue = getKeyWindowKeeper().getDockPosition(); - } - config.setSkinProperty( - SkinPropertiesConstants.KEYWINDOW_POSITION, - dockValue); - - config.saveSkinProperties(); - - /* close the Key Window */ - if (getKeyWindowKeeper() != null) { - getKeyWindowKeeper().dispose(); - } - - /* dispose the images */ - if (currentState.getCurrentImage() != null) { - currentState.getCurrentImage().dispose(); - currentState.setCurrentImage(null); - } - if (currentState.getCurrentKeyPressedImage() != null) { - currentState.getCurrentKeyPressedImage().dispose(); - currentState.setCurrentKeyPressedImage(null); - } - - /* dispose the color */ - if (colorVM != null) { - colorVM.dispose(); - } - - if (currentState.getHoverColor() != null) { - currentState.getHoverColor().dispose(); - } - - skinFinalize(); - } else { - /* Skin have to be alive until receiving shutdown request from qemu */ - event.doit = false; - - if (pressedKeyEventList.isEmpty() == true - && demanderFlag.compareAndSet(false, true)) { - if (null != communicator) { - communicator.sendToQEMU( - SendCommand.SEND_CLOSE_REQ, null, false); - } - - /* block for a while */ - try { - /* - * In Close emulation, 1000ms parameter was used for - * sleep function. So, we need a bigger value than - * that. - */ - closeTimer.schedule(new TimerTask() { - @Override - public void run() { - demanderFlag.set(false); - } - }, 1500); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - } else { - logger.info("skip close request"); - } - } - } - - @Override - public void shellActivated(ShellEvent event) { - logger.info("activate"); - - if (isKeyWindow == true - && getKeyWindowKeeper().getKeyWindow() != null) { - if (isOnTop == false) { - getKeyWindowKeeper().getKeyWindow().getShell() - .moveAbove(shell); - - if (getKeyWindowKeeper().getDockPosition() != SWT.NONE) { - shell.moveAbove(getKeyWindowKeeper().getKeyWindow() - .getShell()); - } - } else { - if (getKeyWindowKeeper().getDockPosition() == SWT.NONE) { - getKeyWindowKeeper().getKeyWindow().getShell() - .moveAbove(shell); - } - } - } - } - - @Override - public void shellDeactivated(ShellEvent event) { - // logger.info("deactivate"); - - /* do nothing */ - } - - @Override - public void shellIconified(ShellEvent event) { - logger.info("iconified"); - - /* synchronization of minimization */ - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (isKeyWindow == true - && getKeyWindowKeeper().getKeyWindow() != null) { - Shell keyWindowShell = getKeyWindowKeeper() - .getKeyWindow().getShell(); - - if (keyWindowShell.getMinimized() == false) { - keyWindowShell.setVisible(false); - /* - * the tool style window is exposed when even it - * was minimized - */ - keyWindowShell.setMinimized(true); - } - } - } - }); - } - - @Override - public void shellDeiconified(ShellEvent event) { - logger.info("deiconified"); - - if (isKeyWindow == true - && getKeyWindowKeeper().getKeyWindow() != null) { - Shell keyWindowShell = getKeyWindowKeeper().getKeyWindow() - .getShell(); - - if (keyWindowShell.getMinimized() == true) { - keyWindowShell.setMinimized(false); - keyWindowShell.setVisible(true); - } - } - - DisplayStateData stateData = new DisplayStateData( - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE, - stateData, false); - } - }; - - shell.addShellListener(shellListener); - - /* menu */ - shellMenuDetectListener = new MenuDetectListener() { - @Override - public void menuDetected(MenuDetectEvent e) { - if (isDisplayDragging == true || isShellGrabbing() == true - || isShutdownRequested == true) { - logger.info("menu is blocked"); - - e.doit = false; - return; - } - - Menu menu = popupMenu.getMenuRoot(); - if (menu != null) { - keyForceRelease(false); - - shell.setMenu(menu); - menu.setVisible(true); - - e.doit = false; - } else { - shell.setMenu(null); - } - } - }; - - shell.addMenuDetectListener(shellMenuDetectListener); - - if (SwtUtil.isWindowsPlatform() == false) { - /* keep window region while OS theme changing */ - shell.getDisplay().addListener(SWT.Settings, new Listener() { - @Override - public void handleEvent(Event e) { - logger.info("operating system property has been changed"); - - rearrangeSkin(); - } - }); - } - } - - private void removeShellListeners() { - if (null != shellListener) { - shell.removeShellListener(shellListener); - } - - if (null != shellMenuDetectListener) { - shell.removeMenuDetectListener(shellMenuDetectListener); - } - } - - private MouseMoveListener makeDisplayTouchMoveListener() { - MouseMoveListener listener = new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (true == isDisplayDragging) { - int eventType = MouseEventType.DRAG.value(); - Point canvasSize = displayCanvas.getSize(); - - if (e.x < 0) { - e.x = 0; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } else if (e.x >= canvasSize.x) { - e.x = canvasSize.x - 1; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } - - if (e.y < 0) { - e.y = 0; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } else if (e.y >= canvasSize.y) { - e.y = canvasSize.y - 1; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } - - /* filtering for display mask */ - Region displayRegion = displayCanvas.getRegion(); - if (displayRegion != null && - displayRegion.contains(e.x, e.y) == false) { - logger.info("out of range touch event : " + e.x + ", " + e.y); - - int angle = SkinUtil.getAngleFromVector(displayCanvas, e.x, e.y); - if (angle < 0) { - angle += 360; - } - - final int displayCenterX = displayCanvas.getSize().x / 2; - final int displayCenterY = displayCanvas.getSize().y / 2; - - if (angle >= 45 && angle < 135) { /* down side */ - do { - e.y--; - } while (displayRegion.contains(e.x, e.y) == false && - displayCenterY < e.y); - } else if (angle >= 135 && angle < 225) { /* left side */ - do { - e.x++; - } while (displayRegion.contains(e.x, e.y) == false && - displayCenterX > e.x); - } else if (angle >= 225 && angle < 315) { /* up side */ - do { - e.y++; - } while (displayRegion.contains(e.x, e.y) == false && - displayCenterY > e.y); - } else { /* right side */ - do { - e.x--; - } while (displayRegion.contains(e.x, e.y) == false && - displayCenterX < e.x); - } - - logger.info("auto release : touch=" + - e.x + ", " + e.y + " (" + angle + ")"); - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } - - mouseMoveDelivery(e, eventType); - } - } - }; - - return listener; - } - - private void getRelativePoint(MouseEvent e) { - int diff_x = e.x - prev_x; - int diff_y = e.y - prev_y; - int final_x = e.x; - int final_y = e.y; - Point canvasSize = displayCanvas.getSize(); - - /* caculate maximum relative point */ - if (final_x >= canvasSize.x) { - e.x = canvasSize.x - prev_x - 1; - prev_x = canvasSize.x - 1; - } else if (final_x <= 0) { - e.x = -prev_x; - prev_x = 0; - } else { - prev_x = e.x; - e.x = diff_x; - } - - if (final_y >= canvasSize.y) { - e.y = canvasSize.y - prev_y - 1; - prev_y = canvasSize.y - 1; - } else if (final_y <= 0) { - e.y = -prev_y; - prev_y = 0; - } else { - prev_y = e.y; - e.y = diff_y; - } - } - - private MouseMoveListener makeDisplayMouseMoveListener() { - MouseMoveListener listener = new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (isDisplayOn) { - int eventType = MouseEventType.MOVE.value(); - - if (true == isDisplayDragging) { - Point canvasSize = displayCanvas.getSize(); - eventType = MouseEventType.DRAG.value(); - if (e.x < 0) { - e.x = 0; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } else if (e.x >= canvasSize.x) { - e.x = canvasSize.x - 1; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } - - if (e.y < 0) { - e.y = 0; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } else if (e.y >= canvasSize.y) { - e.y = canvasSize.y - 1; - eventType = MouseEventType.RELEASE.value(); - isDisplayDragging = false; - } - } - - getRelativePoint(e); - - if (e.x != 0 || e.y != 0) { - mouseMoveDelivery(e, eventType); - } - } - } - }; - - return listener; - } - - private MouseListener makeDisplayTouchClickListener() { - MouseListener listener = new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - getKeyWindowKeeper().redock(false, false); - - if (1 == e.button) /* left button */ - { - if (true == isDisplayDragging) { - isDisplayDragging = false; - } - - mouseUpDelivery(e); - } else if (2 == e.button) /* wheel button */ - { - logger.info("wheelUp in display"); - } - } - - @Override - public void mouseDown(MouseEvent e) { - if (1 == e.button) /* left button */ - { - if (false == isDisplayDragging) { - isDisplayDragging = true; - } - - mouseDownDelivery(e); - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }; - - return listener; - } - - private MouseListener makeDisplayMouseClickListener() { - MouseListener listener = new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - if (isDisplayOn) { - logger.info("mouse up : " + e); - if (1 == e.button) { /* left button */ - if (true == isDisplayDragging) { - isDisplayDragging = false; - } - - getRelativePoint(e); - mouseUpDelivery(e); - } else if (2 == e.button) { /* wheel button */ - logger.info("wheelUp in display"); - } - } - } - - @Override - public void mouseDown(MouseEvent e) { - if (isDisplayOn) { - logger.info("mouse down : " + e); - if (1 == e.button) { /* left button */ - if (false == isDisplayDragging) { - isDisplayDragging = true; - } - - getRelativePoint(e); - mouseDownDelivery(e); - } - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - logger.info("mouse double click : " + e); - // TODO: - } - }; - - return listener; - } - - private MouseWheelListener makeDisplayMouseWheelListener() { - MouseWheelListener listener = new MouseWheelListener() { - @Override - public void mouseScrolled(MouseEvent e) { - getRelativePoint(e); - - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseWheel in display" + " x:" + geometry[0] - + " y:" + geometry[1] + " value:" + e.count); - - int eventType; - if (e.count < 0) { - eventType = MouseEventType.WHEELDOWN.value(); - } else { - eventType = MouseEventType.WHEELUP.value(); - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.WHEEL.value(), eventType, e.x, e.y, - geometry[0], geometry[1], e.count); - - communicator.sendToQEMU(SendCommand.SEND_MOUSE_EVENT, - mouseEventData, false); - } - }; - - return listener; - } - - private void addCanvasListeners() { - /* menu */ - canvasMenuDetectListener = new MenuDetectListener() { - @Override - public void menuDetected(MenuDetectEvent e) { - if (isDisplayDragging == true || isShellGrabbing() == true - || isShutdownRequested == true) { - logger.info("menu is blocked"); - - e.doit = false; - return; - } - - Menu menu = popupMenu.getMenuRoot(); - if (menu != null) { - keyForceRelease(false); - - displayCanvas.setMenu(menu); - menu.setVisible(true); - - e.doit = false; - } else { - displayCanvas.setMenu(null); - } - } - }; - - /* remove 'input method' menu item (avoid bug) */ - displayCanvas.addMenuDetectListener(canvasMenuDetectListener); - - /* focus */ - canvasFocusListener = new FocusListener() { - @Override - public void focusGained(FocusEvent event) { - // logger.info("gain focus"); - - /* do nothing */ - } - - @Override - public void focusLost(FocusEvent event) { - logger.info("lost focus"); - keyForceRelease(false); - } - }; - - displayCanvas.addFocusListener(canvasFocusListener); - - /* host mouse event */ - if (config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true) { - /* mapping to virtual mouse */ - canvasMouseMoveListener = makeDisplayMouseMoveListener(); - canvasMouseListener = makeDisplayMouseClickListener(); - - canvasMouseWheelListener = makeDisplayMouseWheelListener(); - displayCanvas.addMouseWheelListener(canvasMouseWheelListener); - } else { - /* mapping to virtual touch screen */ - canvasMouseMoveListener = makeDisplayTouchMoveListener(); - canvasMouseListener = makeDisplayTouchClickListener(); - } - - displayCanvas.addMouseMoveListener(canvasMouseMoveListener); - displayCanvas.addMouseListener(canvasMouseListener); - - /* host keyboard event */ - canvasKeyListener = new KeyListener() { - private KeyEvent previous; - private boolean disappearEvent = false; - private int disappearKeycode = 0; - private int disappearStateMask = 0; - private int disappearKeyLocation = 0; - - @Override - public void keyReleased(KeyEvent e) { - if (logger.isLoggable(Level.INFO)) { - String character = - (e.character == '\0') ? "\\0" : - (e.character == '\n') ? "\\n" : - (e.character == '\r') ? "\\r" : - ("" + e.character); - - logger.info("'" + character + "':" - + e.keyCode + ":" - + e.stateMask + ":" - + e.keyLocation); - } else if (logger.isLoggable(Level.FINE)) { - logger.fine(e.toString()); - } - - int keyCode = e.keyCode; - int stateMask = e.stateMask; - - if (SwtUtil.isWindowsPlatform() == true) { - if (disappearEvent == true) { - /* generate a disappeared key event in Windows */ - disappearEvent = false; - - if (isMetaKey(keyCode) && e.character != '\0') { - logger.info("send disappear release : keycode=" - + disappearKeycode + ", stateMask=" - + disappearStateMask + ", keyLocation=" - + disappearKeyLocation); - - KeyEventData keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), - disappearKeycode, disappearStateMask, - disappearKeyLocation); - communicator.sendToQEMU(SendCommand.SEND_KEYBOARD_KEY_EVENT, - keyEventData, false); - - removePressedKeyFromList(keyEventData); - - disappearKeycode = 0; - disappearStateMask = 0; - disappearKeyLocation = 0; - } - } - - if (previous != null) { - KeyEventData keyEventData = null; - - /* separate a merged release event */ - if (previous.keyCode == SWT.CR && - (keyCode & SWT.KEYCODE_BIT) != 0 && e.character == SWT.CR) { - logger.info("send upon release : keycode=" + (int)SWT.CR); - - keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), - SWT.CR, 0, 0); - } else if (previous.keyCode == SWT.SPACE && - (keyCode & SWT.KEYCODE_BIT) != 0 && - (e.character == SWT.SPACE)) { - logger.info("send upon release : keycode=" + (int)SWT.SPACE); - - keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), - SWT.SPACE, 0, 0); - } else if (previous.keyCode == SWT.TAB && - (keyCode & SWT.KEYCODE_BIT) != 0 && - (e.character == SWT.TAB)) { - logger.info("send upon release : keycode=" + (int)SWT.TAB); - - keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), - SWT.TAB, 0, 0); - } else if (previous.keyCode == SWT.KEYPAD_CR && - (keyCode & SWT.KEYCODE_BIT) != 0 && - (e.character == SWT.CR) && - (keyCode != SWT.KEYPAD_CR)) { - logger.info("send upon release : keycode=" + (int)SWT.KEYPAD_CR); - - keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), - SWT.KEYPAD_CR, 0, 2); - } - - if (keyEventData != null) { - communicator.sendToQEMU(SendCommand.SEND_KEYBOARD_KEY_EVENT, - keyEventData, false); - removePressedKeyFromList(keyEventData); - } - } - } /* end isWindowsPlatform */ - - previous = null; - - keyReleasedDelivery(keyCode, stateMask, e.keyLocation, true); - } - - @Override - public void keyPressed(KeyEvent e) { - int keyCode = e.keyCode; - int stateMask = e.stateMask; - - /* - * When the pressed key event is overwritten by next key event, - * the release event of previous key does not occur in Windows. - * So, we generate a release key event by ourselves that had - * been disappeared. - */ - if (SwtUtil.isWindowsPlatform() == true) { - if (null != previous) { - if (previous.keyCode != keyCode) { - - if (isMetaKey(previous.keyCode)) { - disappearEvent = true; - disappearKeycode = keyCode; - disappearStateMask = stateMask; - disappearKeyLocation = e.keyLocation; - } else { - /* three or more keys were pressed at the - * same time */ - if (disappearEvent == true) { - logger.info("replace the disappearEvent : " - + disappearKeycode + "->" + keyCode); - - disappearKeycode = keyCode; - disappearStateMask = stateMask; - disappearKeyLocation = e.keyLocation; - } - - int previousKeyCode = previous.keyCode; - int previousStateMask = previous.stateMask; - - if (logger.isLoggable(Level.INFO)) { - String character = - (previous.character == '\0') ? "\\0" : - (previous.character == '\n') ? "\\n" : - (previous.character == '\r') ? "\\r" : - ("" + previous.character); - - logger.info("send previous release : '" - + character + "':" - + previous.keyCode + ":" - + previous.stateMask + ":" - + previous.keyLocation); - } else if (logger.isLoggable(Level.FINE)) { - logger.fine("send previous release :" - + previous.toString()); - } - - KeyEventData keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), - previousKeyCode, previousStateMask, - previous.keyLocation); - communicator.sendToQEMU( - SendCommand.SEND_KEYBOARD_KEY_EVENT, - keyEventData, false); - - removePressedKeyFromList(keyEventData); - } - - } - } - } /* end isWindowsPlatform */ - - if (logger.isLoggable(Level.INFO)) { - String character = - (e.character == '\0') ? "\\0" : - (e.character == '\n') ? "\\n" : - (e.character == '\r') ? "\\r" : - ("" + e.character); - - logger.info("'" + character + "':" - + e.keyCode + ":" - + e.stateMask + ":" - + e.keyLocation); - } else if (logger.isLoggable(Level.FINE)) { - logger.fine(e.toString()); - } - - keyPressedDelivery(keyCode, stateMask, e.keyLocation, true); - - previous = e; - } - }; - - displayCanvas.addKeyListener(canvasKeyListener); - } - - /* for display */ - protected void mouseMoveDelivery(MouseEvent e, int eventType) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), eventType, - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU(SendCommand.SEND_MOUSE_EVENT, - mouseEventData, false); - } - - protected void mouseUpDelivery(MouseEvent e) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseUp in display" + - " x:" + geometry[0] + " y:" + geometry[1]); - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU(SendCommand.SEND_MOUSE_EVENT, - mouseEventData, false); - } - - protected void mouseDownDelivery(MouseEvent e) { - int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - logger.info("mouseDown in display" + - " x:" + geometry[0] + " y:" + geometry[1]); - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - e.x, e.y, geometry[0], geometry[1], 0); - - communicator.sendToQEMU(SendCommand.SEND_MOUSE_EVENT, - mouseEventData, false); - } - - protected void keyReleasedDelivery(int keyCode, - int stateMask, int keyLocation, boolean remove) { - KeyEventData keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), keyCode, stateMask, keyLocation); - communicator.sendToQEMU( - SendCommand.SEND_KEYBOARD_KEY_EVENT, keyEventData, false); - - if (remove == true) { - removePressedKeyFromList(keyEventData); - } - } - - protected void keyPressedDelivery(int keyCode, - int stateMask, int keyLocation, boolean add) { - KeyEventData keyEventData = new KeyEventData( - KeyEventType.PRESSED.value(), keyCode, stateMask, keyLocation); - communicator.sendToQEMU( - SendCommand.SEND_KEYBOARD_KEY_EVENT, keyEventData, false); - - if (add == true) { - addPressedKeyToList(keyEventData); - } - } - - private boolean isMetaKey(int keyCode) { - if (SWT.CTRL == keyCode || SWT.ALT == keyCode || SWT.SHIFT == keyCode - || SWT.COMMAND == keyCode) { - return true; - } - - return false; - } - - protected synchronized boolean addPressedKeyToList(KeyEventData pressData) { - for (KeyEventData data : pressedKeyEventList) { - if (data.keycode == pressData.keycode && - // data.stateMask == pressData.stateMask && - data.keyLocation == pressData.keyLocation) { - return false; - } - } - - pressedKeyEventList.add(pressData); - return true; - } - - protected synchronized boolean removePressedKeyFromList( - KeyEventData releaseData) { - - for (KeyEventData data : pressedKeyEventList) { - if (data.keycode == releaseData.keycode && - // data.stateMask == releaseData.stateMask && - data.keyLocation == releaseData.keyLocation) { - pressedKeyEventList.remove(data); - - return true; - } - } - - return false; - } - - private void removeCanvasListeners() { - if (null != canvasMouseMoveListener) { - displayCanvas.removeMouseMoveListener(canvasMouseMoveListener); - } - - if (null != canvasMouseListener) { - displayCanvas.removeMouseListener(canvasMouseListener); - } - - if (null != canvasKeyListener) { - displayCanvas.removeKeyListener(canvasKeyListener); - } - - if (null != canvasMenuDetectListener) { - displayCanvas.removeMenuDetectListener(canvasMenuDetectListener); - } - - if (null != canvasFocusListener) { - displayCanvas.removeFocusListener(canvasFocusListener); - } - - if (null != canvasMouseWheelListener) { - displayCanvas.removeMouseWheelListener(canvasMouseWheelListener); - } - } - - protected void rearrangeSkin() { - skinComposer.arrangeSkin( - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - } - - public void updateSkin() { - skinComposer.updateSkin(); - } - - public void updateDisplay() { - /* abstract */ - } - - public void setSuitableTransform() { - if (displayTransform != null) { - displayTransform.dispose(); - } - - displayTransform = new Transform(displayCanvas.getDisplay()); - - short rotationId = currentState.getCurrentRotationId(); - displayTransform.rotate(SkinRotations.getAngle(rotationId)); - - if (rotationId == SkinRotations.LANDSCAPE_ID) { - /* landscape */ - displayTransform.translate(displayCanvas.getSize().y * -1, 0); - } else if (rotationId == SkinRotations.REVERSE_PORTRAIT_ID) { - /* reverse-portrait */ - displayTransform.translate( - displayCanvas.getSize().x * -1, - displayCanvas.getSize().y * -1); - } else if (rotationId == SkinRotations.REVERSE_LANDSCAPE_ID) { - /* reverse-landscape */ - displayTransform.translate(0, displayCanvas.getSize().x * -1); - } - } - - public void setCoverImage(Image image) { - /* abstract */ - } - - protected void openScreenShotWindow() { - /* abstract */ - } - - public void updateProgressBar(final int idxLayer, final int progress) { - getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (bootingProgress != null) { - bootingProgress.setSelection(idxLayer, progress); - } - } - }); - } - - public void updateDisplayPower(final boolean on) { - getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (on == true) { - displayOn(); - } else { - displayOff(); - } - } - }); - } - - public void updateHostKbdMenu(final boolean on) { - isOnKbd = on; - - getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - MenuItem item = getPopupMenu().hostKbdOnItem; - if (item != null) { - item.setSelection(isOnKbd); - } - - item = getPopupMenu().hostKbdOffItem; - if (item != null) { - item.setSelection(!isOnKbd); - } - } - }); - } - - protected void displayOn() { - logger.info("display on"); - - if (config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true) { - isDisplayOn = true; - } - } - - protected void displayOff() { - logger.info("display off"); - - if (config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true) { - isDisplayOn = false; - } - - if (isDisplayDragging == true) { - logger.info("auto release : mouseEvent"); - MouseEventData mouseEventData = new MouseEventData( - 0, MouseEventType.RELEASE.value(), - 0, 0, 0, 0, 0); - - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } - } - - /* for popup menu */ - public SelectionAdapter createDetailInfoMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (logger.isLoggable(Level.FINE)) { - logger.fine("Open detail info"); - } - - DetailInfoDialog detailInfoDialog = new DetailInfoDialog( - shell, communicator, config, skinInfo); - detailInfoDialog.open(); - } - }; - - return listener; - } - - public SelectionAdapter createTopMostMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - isOnTop = popupMenu.onTopItem.getSelection(); - - logger.info("Select top most : " + isOnTop); - - if (SkinUtil.setTopMost(shell, isOnTop) == false) { - logger.info("failed to top most"); - - popupMenu.onTopItem.setSelection(isOnTop = false); - } else { - if (getKeyWindowKeeper().getKeyWindow() != null) { - SkinUtil.setTopMost(getKeyWindowKeeper().getKeyWindow() - .getShell(), isOnTop); - } - } - } - }; - - return listener; - } - - public Menu createRotateMenu() { - Menu menu = new Menu(shell, SWT.DROP_DOWN); - - final List<MenuItem> rotationList = new ArrayList<MenuItem>(); - - Iterator<Entry<Short, Rotation>> iterator = - SkinRotations.getRotationIterator(); - - while (iterator.hasNext()) { - Entry<Short, Rotation> entry = iterator.next(); - Short rotationId = entry.getKey(); - RotationType section = entry.getValue(); - - final MenuItem menuItem = new MenuItem(menu, SWT.RADIO); - menuItem.setText(section.getName().value()); - menuItem.setData(rotationId); - - if (currentState.getCurrentRotationId() == rotationId) { - menuItem.setSelection(true); - } - - rotationList.add(menuItem); - } - - /* temp : swap rotation menu names */ - if (currentState.getCurrentResolutionWidth() > - currentState.getCurrentResolutionHeight()) { - for (MenuItem m : rotationList) { - short rotationId = (Short) m.getData(); - - if (rotationId == SkinRotations.PORTRAIT_ID) { - String landscape = SkinRotations.getRotation( - SkinRotations.LANDSCAPE_ID).getName().value(); - m.setText(landscape); - } else if (rotationId == SkinRotations.LANDSCAPE_ID) { - String portrait = SkinRotations.getRotation( - SkinRotations.PORTRAIT_ID).getName().value(); - m.setText(portrait); - } else if (rotationId == SkinRotations.REVERSE_PORTRAIT_ID) { - String landscapeReverse = SkinRotations.getRotation( - SkinRotations.REVERSE_LANDSCAPE_ID).getName().value(); - m.setText(landscapeReverse); - } else if (rotationId == SkinRotations.REVERSE_LANDSCAPE_ID) { - String portraitReverse = SkinRotations.getRotation( - SkinRotations.REVERSE_PORTRAIT_ID).getName().value(); - m.setText(portraitReverse); - } - } - } - - SelectionAdapter selectionAdapter = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Rotate menu is selected"); - - MenuItem item = (MenuItem) e.getSource(); - - boolean selection = item.getSelection(); - if (!selection) { - return; - } - - final short rotationId = ((Short) item.getData()); - - shell.getDisplay().syncExec(new Runnable() { - @Override - public void run() { - skinComposer.arrangeSkin( - currentState.getCurrentScale(), rotationId); - - /* 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)); - } - }); - - DisplayStateData stateData = new DisplayStateData( - currentState.getCurrentScale(), rotationId); - communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE, - stateData, false); - - updateDisplay(); - } - }; - - for (MenuItem menuItem : rotationList) { - menuItem.addSelectionListener(selectionAdapter); - } - - return menu; - } - - public SelectionAdapter createScaleMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Scale menu is selected"); - - MenuItem item = (MenuItem) e.getSource(); - - boolean selection = item.getSelection(); - if (!selection) { - return; - } - - final int scale = (Integer)item.getData(); /* percentage */ - - shell.getDisplay().syncExec(new Runnable() { - @Override - public void run() { - skinComposer.arrangeSkin(scale, - currentState.getCurrentRotationId()); - - /* 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)); - } - }); - - DisplayStateData stateData = new DisplayStateData(scale, - currentState.getCurrentRotationId()); - communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE, - stateData, false); - - updateDisplay(); - } - }; - - return listener; - } - - public SelectionAdapter createInterpolationMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - MenuItem item = (MenuItem) e.getSource(); - if (item.getSelection()) { - boolean on = item.equals(popupMenu.interpolationHighItem); - isOnInterpolation = on; - - logger.info("Select scale interpolation : " + isOnInterpolation); - - communicator.sendToQEMU(SendCommand.SEND_INTERPOLATION_STATE, - new BooleanData(on, SendCommand.SEND_INTERPOLATION_STATE.toString()), - false); - } - } - }; - - return listener; - } - - public SelectionAdapter createKeyWindowMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Key Window menu is selected"); - - /* control the menu */ - if (getKeyWindowKeeper().isGeneralKeyWindow() == false) { - MenuItem layoutSelected = (MenuItem) e.widget; - - if (layoutSelected.getSelection() == true) { - for (MenuItem layout : layoutSelected.getParent().getItems()) { - if (layout != layoutSelected) { - /* uncheck other menu items */ - layout.setSelection(false); - } else { - int layoutIndex = getKeyWindowKeeper().getLayoutIndex(); - if (getKeyWindowKeeper().determineLayout() != layoutIndex) { - /* switch */ - getKeyWindowKeeper().closeKeyWindow(); - layoutSelected.setSelection(true); - } - } - } - } - } - - /* control the window */ - if (getKeyWindowKeeper().isSelectKeyWindowMenu() == true) { /* checked */ - if (getKeyWindowKeeper().getKeyWindow() == null) { - if (getKeyWindowKeeper().getRecentlyDocked() != SWT.NONE) { - getKeyWindowKeeper().openKeyWindow( - getKeyWindowKeeper().getRecentlyDocked(), false); - - getKeyWindowKeeper().setRecentlyDocked(SWT.NONE); - } else { - /* opening for first time */ - getKeyWindowKeeper().openKeyWindow( - KeyWindowKeeper.DEFAULT_DOCK_POSITION, false); - } - } else { - getKeyWindowKeeper().openKeyWindow( - getKeyWindowKeeper().getDockPosition(), false); - } - } else { /* unchecked */ - if (getKeyWindowKeeper().getDockPosition() != SWT.NONE) { - /* close the Key Window if it is docked to Main Window */ - getKeyWindowKeeper().setRecentlyDocked( - getKeyWindowKeeper().getDockPosition()); - - getKeyWindowKeeper().closeKeyWindow(); - } else { - /* hide a Key Window */ - getKeyWindowKeeper().hideKeyWindow(); - } - } - } - }; - - return listener; - }; - - public SelectionAdapter createRamdumpMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Ram dump menu is selected"); - - communicator.setRamdumpFlag(true); - communicator.sendToQEMU(SendCommand.SEND_RAM_DUMP, null, false); - - RamdumpDialog ramdumpDialog; - try { - ramdumpDialog = new RamdumpDialog(shell, communicator, - config); - ramdumpDialog.open(); - } catch (IOException ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - } - } - }; - - return listener; - } - - public SelectionAdapter createScreenshotMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("ScreenShot Menu is selected"); - - openScreenShotWindow(); - } - }; - - return listener; - } - - public SelectionAdapter createHostKbdMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - // TODO: - /* if (!communicator.isSensorDaemonStarted()) { - SkinUtil.openMessage(shell, null, - "Host Keyboard is not ready.\n" - + "Please wait until the emulator is completely boot up.", - SWT.ICON_WARNING, config); - popupMenu.hostKbdOnItem.setSelection(isOnKbd); - popupMenu.hostKbdOffItem.setSelection(!isOnKbd); - - return; - } */ - - MenuItem item = (MenuItem) e.getSource(); - if (item.getSelection()) { - boolean on = item.equals(popupMenu.hostKbdOnItem); - isOnKbd = on; - - logger.info("Select host keyboard : " + isOnKbd); - - communicator.sendToQEMU(SendCommand.SEND_HOST_KBD_STATE, - new BooleanData(on, SendCommand.SEND_HOST_KBD_STATE.toString()), false); - } - } - }; - - return listener; - } - - public SelectionAdapter createAboutMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Open the about dialog"); - - AboutDialog dialog = new AboutDialog(shell, config, imageRegistry); - dialog.open(); - } - }; - - return listener; - } - - public SelectionAdapter createForceCloseMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Force close menu is selected"); - - int answer = SkinUtil.openMessage(shell, null, - "If you force stop an emulator, it may cause some problems.\n" - + "Are you sure you want to continue?", - SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL, config); - - if (answer == SWT.OK) { - logger.info("force close!!!"); - - if (communicator != null) { - communicator.terminate(); - } - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - EmulatorSkinMain.terminateImmediately(-1); - } - }); - } - } - }; - - return listener; - } - - public SelectionAdapter createShellMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Shell menu is selected"); - String tapEnabled = config.getArg(ArgsConstants.USE_TAP); - int portSdb = config.getArgInt(ArgsConstants.VM_BASE_PORT) + 1; - String vmName; - if ("true".equals(tapEnabled)) { - logger.info("tap enabled"); - String infoData = null; - - DataTranfer dataTranfer = communicator.sendDataToQEMU( - SendCommand.SEND_GUEST_IP_REQ, null, true); - byte[] receivedData = communicator - .getReceivedData(dataTranfer); - - if (null != receivedData) { - try { - infoData = new String(receivedData, "UTF-8"); - } catch (UnsupportedEncodingException e1) { - logger.warning("unsupported encoding exception"); - infoData = null; - return; - } - } - - logger.info("Guest IP:" + infoData); - vmName = infoData; - } else { - vmName = "emulator-" + portSdb; - } - - if (communicator.isSdbDaemonStarted() == false) { - logger.warning("SDB is not ready."); - - SkinUtil.openMessage(shell, null, - "SDB is not ready.\n" - + "Please wait until the emulator is completely boot up.", - SWT.ICON_WARNING, config); - return; - } - - String sdbPath = SkinUtil.getSdbPath(); - - File sdbFile = new File(sdbPath); - if (sdbFile.exists() == false) { - logger.info("SDB file does not exist : " + sdbFile.getAbsolutePath()); - - try { - SkinUtil.openMessage(shell, null, - "SDB file does not exist in the following path.\n" - + sdbFile.getCanonicalPath(), - SWT.ICON_ERROR, config); - } catch (IOException ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - } - - return; - } - - ProcessBuilder procSdb = new ProcessBuilder(); - - if (SwtUtil.isWindowsPlatform()) { - procSdb.command("cmd.exe", "/c", "start", sdbPath, "sdb", - "-s", vmName, "shell"); - } else if (SwtUtil.isMacPlatform()) { - procSdb.command("./sdbscript", sdbPath, vmName); - /* - * procSdb.command( "/usr/X11/bin/uxterm", "-T", "emulator-" - * + portSdb, "-e", sdbPath, "shell"); - */ - } else { /* Linux */ - String sdbCmd = sdbPath + " -s " + vmName + " shell"; - - /* Work Around : - * To close a factory gnome-terminal(first instance) after the SDB session - * period, suicide command should be reserved by host shell on Ubuntu. - */ - procSdb.command("/usr/bin/gnome-terminal", "--disable-factory", - "--title=" + SkinUtil.makeEmulatorName(config), "-x", - "bash", "-c", sdbCmd + "; kill -9 `ps -p $$ -o ppid=`"); - } - - logger.info(procSdb.command().toString()); - - try { - procSdb.start(); /* open the sdb shell */ - } catch (Exception ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - SkinUtil.openMessage(shell, null, - "Fail to open Shell : \n" + ee.getMessage(), - SWT.ICON_ERROR, config); - } - - communicator.sendToQEMU(SendCommand.SEND_OPEN_SHELL, null, false); - } - }; - - return listener; - } - - public SelectionAdapter createEcpMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Control Panel menu is selected"); - - String ecpPath = SkinUtil.getEcpPath(); - - File ecpFile = new File(ecpPath); - if (ecpFile.exists() == false) { - logger.info("Control Panel file does not exist : " - + ecpFile.getAbsolutePath()); - - try { - SkinUtil.openMessage(shell, null, - "Control Panel file does not exist in the following path.\n" - + ecpFile.getCanonicalPath(), - SWT.ICON_ERROR, config); - } catch (IOException ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - } - - return; - } - - String emulName = SkinUtil.getVmName(config); - int basePort = config.getArgInt(ArgsConstants.VM_BASE_PORT); - String proxyAddr = config.getArg(ArgsConstants.PROXY_ADDR); - String proxyPort = config.getArg(ArgsConstants.PROXY_PORT); - - ProcessBuilder procEcp = new ProcessBuilder(); - - // FIXME: appropriate running binary setting is necessary. - if (SwtUtil.isWindowsPlatform()) { - if (proxyAddr != null && proxyPort != null) { - procEcp.command("java.exe", "-Dhttp.proxyHost=" - + proxyAddr, "-Dhttp.proxyPort=" + proxyPort, - "-jar", ecpPath, "vmname=" + emulName, - "base.port=" + basePort); - } else { - procEcp.command("java.exe", "-jar", ecpPath, "vmname=" - + emulName, "base.port=" + basePort); - } - } else if (SwtUtil.isMacPlatform()) { - if (proxyAddr != null && proxyPort != null) { - procEcp.command("java", - "-Dhttp.proxyHost=" + proxyAddr, - "-Dhttp.proxyPort=" + proxyPort, "-jar", - "-XstartOnFirstThread", ecpPath, "vmname=" - + emulName, "base.port=" + basePort); - } else { - procEcp.command("java", "-jar", "-XstartOnFirstThread", - ecpPath, "vmname=" + emulName, "base.port=" - + basePort); - } - } else { /* Linux */ - if (proxyAddr != null && proxyPort != null) { - procEcp.command("java", - "-Dhttp.proxyHost=" + proxyAddr, - "-Dhttp.proxyPort=" + proxyPort, "-jar", - ecpPath, "vmname=" + emulName, "base.port=" - + basePort); - } else { - procEcp.command("java", "-jar", ecpPath, "vmname=" - + emulName, "base.port=" + basePort); - } - } - - logger.info(procEcp.command().toString()); - - try { - procEcp.start(); /* open ECP */ - } catch (Exception ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - SkinUtil.openMessage( - shell, - null, - "Fail to open control panel : \n" + ee.getMessage(), - SWT.ICON_ERROR, config); - } - } - }; - - return listener; - } - - public SelectionAdapter createCloseMenuListener() { - SelectionAdapter listener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Close menu is selected"); - - communicator.sendToQEMU(SendCommand.SEND_CLOSE_REQ, null, false); - } - }; - - return listener; - } - - public void shutdown() { - logger.info("shutdown the skin process"); - - isShutdownRequested = true; - - if (!shell.isDisposed()) { - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (!shell.isDisposed()) { - shell.close(); - } - } - }); - } - - } - - public void keyForceRelease(boolean isMetaFilter) { - if (isShutdownRequested == true) { - return; - } - - /* key event compensation */ - if (pressedKeyEventList.isEmpty() == false) { - for (KeyEventData data : pressedKeyEventList) { - if (isMetaFilter == true) { - if (isMetaKey(data.keycode) == true) { - /* keep multi-touching */ - continue; - } - } - - keyReleasedDelivery(data.keycode, - data.stateMask, data.keyLocation, false); - - logger.info("auto release : keycode=" + data.keycode - + ", stateMask=" + data.stateMask - + ", keyLocation=" + data.keyLocation); - } - } - - pressedKeyEventList.clear(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java deleted file mode 100644 index 2d8bb5391a..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java +++ /dev/null @@ -1,467 +0,0 @@ -/** - * Emulator Skin Main - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.Socket; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.data.StartData; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.config.EmulatorConfig.ConfigPropertiesConstants; -import org.tizen.emulator.skin.config.EmulatorConfig.SkinInfoConstants; -import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants; -import org.tizen.emulator.skin.dbi.EmulatorUI; -import org.tizen.emulator.skin.dbi.RotationType; -import org.tizen.emulator.skin.dbi.RotationsType; -import org.tizen.emulator.skin.exception.JaxbException; -import org.tizen.emulator.skin.image.ImageRegistry; -import org.tizen.emulator.skin.info.SkinInformation; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.log.SkinLogger.SkinLogLevel; -import org.tizen.emulator.skin.util.CocoaUtil; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.JaxbUtil; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.StringUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -/** - * - * - */ -public class EmulatorSkinMain { - public static final String SKINS_FOLDER = "skins"; - public static final String DEFAULT_SKIN_FOLDER = "mobile-general-3btn"; - - public static final String SKIN_INFO_FILE_NAME = "info.ini"; - public static final String SKIN_PROPERTIES_FILE_NAME = ".skin.properties"; - public static final String CONFIG_PROPERTIES_FILE_NAME = ".skinconfig.properties"; - public static final String DBI_FILE_NAME = "default.dbi"; - - private static Logger logger; - - /** - * @param args - */ - public static void main(String[] args) { - /* make vm name and remove unused menu for macos-x */ - if (SwtUtil.isMacPlatform()) { - System.setProperty("apple.laf.useScreenMenuBar", "true"); - System.setProperty("com.apple.mrj.application.apple.menu.about.name", - "Emulator"); - Display display = Display.getDefault(); - display.syncExec(new Runnable() { - public void run() { - new CocoaUtil().removeTopMenuItems(); - } - }); - } - - String simpleMsg = getSimpleMsg(args); - if (simpleMsg != null) { - /* just show one message box. that's all. */ - Shell temp = new Shell(Display.getDefault()); - MessageBox messageBox = new MessageBox(temp, SWT.ICON_ERROR); - messageBox.setText("Emulator"); - messageBox.setMessage(simpleMsg); - messageBox.open(); - temp.dispose(); - - return; - } - - SocketCommunicator communicator = null; - - try { - /* get vm path from startup argument */ - String vmPath = getVmPath(args); - if (StringUtil.isEmpty(vmPath)) { - throw new IllegalArgumentException( - ArgsConstants.VM_PATH + " in arguments is null."); - } - - /* initialize logging system */ - SkinLogger.init(SkinLogLevel.DEBUG, vmPath); - - logger = SkinLogger.getSkinLogger(EmulatorSkinMain.class).getLogger(); - logger.info("!!! Start Emualtor Skin !!!"); - - logger.info("java.version : " + System.getProperty("java.version")); - logger.info("java vendor : " + System.getProperty("java.vendor")); - logger.info("vm version : " + System.getProperty("java.vm.version")); - logger.info("vm vendor : " + System.getProperty("java.vm.vendor")); - logger.info("vm name : " + System.getProperty("java.vm.name")); - logger.info("os name : " + System.getProperty("os.name")); - logger.info("os arch : " + System.getProperty("os.arch")); - logger.info("os version : " + System.getProperty("os.version")); - logger.info("swt platform : " + SWT.getPlatform()); - logger.info("swt version : " + SWT.getVersion()); - - logger.info("working directory : " + System.getProperty("user.dir")); - - /* startup arguments parsing */ - Map<String, String> argsMap = parseArgs(args); - EmulatorConfig.validateArgs(argsMap); - - /* get skin path from startup argument */ - String argSkinPath = (String) argsMap.get(ArgsConstants.SKIN_PATH); - String skinPath = ".." + File.separator + - SKINS_FOLDER + File.separator + DEFAULT_SKIN_FOLDER; - - if (argSkinPath == null || new File(argSkinPath).isDirectory() == false) { - /* When emulator receive a invalid skin path, - emulator uses default skin path instead of it */ - logger.info("Emulator uses default skin path (" + skinPath + - ") instead of invalid skin path (" + argSkinPath + ")."); - } else { - skinPath = argSkinPath; - } - - /* set skin information */ - String skinInfoFilePath = - skinPath + File.separator + SKIN_INFO_FILE_NAME; - Properties skinInfoProperties = - SkinUtil.loadProperties(skinInfoFilePath, false); - if (null == skinInfoProperties) { - logger.severe("Fail to load skin information file."); - - Shell temp = new Shell(Display.getDefault()); - MessageBox messageBox = new MessageBox(temp, SWT.ICON_ERROR); - messageBox.setText("Emulator"); - messageBox.setMessage("Fail to load \"" + SKIN_INFO_FILE_NAME + "\" file\n" + - "Check if the file is corrupted or missing from the following path.\n" + - skinPath); - messageBox.open(); - temp.dispose(); - - terminateImmediately(-1); - } - - String skinInfoResolutionW = - skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_WIDTH); - String skinInfoResolutionH = - skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_HEIGHT); - - logger.info("skin ini : " + SkinInfoConstants.SKIN_NAME + "=" + - skinInfoProperties.getProperty(SkinInfoConstants.SKIN_NAME)); - logger.info("skin ini : " + SkinInfoConstants.RESOLUTION_WIDTH + - "=" + skinInfoResolutionW); - logger.info("skin ini : " + SkinInfoConstants.RESOLUTION_HEIGHT + - "=" + skinInfoResolutionH); - logger.info("skin ini : " + SkinInfoConstants.MANAGER_PRIORITY + "=" + - skinInfoProperties.getProperty(SkinInfoConstants.MANAGER_PRIORITY)); - - /* set emulator window skin property */ - String skinPropFilePath = - vmPath + File.separator + SKIN_PROPERTIES_FILE_NAME; - Properties skinProperties = - SkinUtil.loadProperties(skinPropFilePath, true); - if (null == skinProperties) { - logger.severe("Fail to load skin properties file."); - } - - /* set emulator window config property */ - String configPropFilePath = - vmPath + File.separator + CONFIG_PROPERTIES_FILE_NAME; - Properties configProperties = - SkinUtil.loadProperties(configPropFilePath, false); - EmulatorConfig.validateSkinConfigProperties(configProperties); - - /* able to use log file after loading properties */ - initLog(argsMap, configProperties); - - /* validation check */ - EmulatorConfig.validateSkinProperties(skinProperties); - - /* determine the layout */ - boolean isGeneralSkin = false; - if (skinInfoResolutionW.equalsIgnoreCase("all") || - skinInfoResolutionH.equalsIgnoreCase("all")) { - isGeneralSkin = true; - } - SkinInformation skinInfo = new SkinInformation( - skinInfoProperties.getProperty(SkinInfoConstants.SKIN_NAME), - skinPath, isGeneralSkin); - - /* load dbi file */ - EmulatorUI dbiContents = loadXMLForSkin(skinPath); - if (null == dbiContents) { - logger.severe("Fail to load dbi file."); - - Shell temp = new Shell(Display.getDefault()); - MessageBox messageBox = new MessageBox(temp, SWT.ICON_ERROR); - messageBox.setText("Emulator"); - messageBox.setMessage("Fail to load \"" + DBI_FILE_NAME + "\" file\n" + - "Check if the file is corrupted or missing from the following path.\n" + - skinPath); - messageBox.open(); - temp.dispose(); - - terminateImmediately(-1); - } - logger.info("dbi version : " + dbiContents.getDbiVersion()); - - /* collect configurations */ - EmulatorConfig config = new EmulatorConfig(argsMap, - dbiContents, skinProperties, skinPropFilePath, configProperties); - - /* load image resource */ - ImageRegistry.getInstance().initialize(config, skinPath); - - /* load Always on Top value */ - boolean isOnTop = Boolean.parseBoolean(config.getSkinProperty( - SkinPropertiesConstants.WINDOW_ONTOP, - Boolean.FALSE.toString())); - - /* create a skin */ - EmulatorSkin skin = null; - if (config.getArgBoolean(ArgsConstants.DISPLAY_SHM) == true) { - logger.info("maru_shm"); /* shared framebuffer */ - - skin = new EmulatorShmSkin(config, skinInfo, isOnTop); - } else { /* linux & windows */ - logger.info("maru_sdl"); /* WINDOWID_hack */ - - skin = new EmulatorSdlSkin(config, skinInfo, isOnTop); - } - - /* load Interpolation value */ - skin.isOnInterpolation = Boolean.parseBoolean(config.getSkinProperty( - SkinPropertiesConstants.WINDOW_INTERPOLATION, - Boolean.TRUE.toString())); - - /* create a qemu communicator */ - int uid = config.getArgInt(ArgsConstants.UID); - communicator = new SocketCommunicator(config, uid, skin); - skin.setCommunicator(communicator); - - /* initialize a skin layout */ - StartData startData = skin.initSkin(); - communicator.setInitialData(startData); - - Socket commSocket = communicator.getSocket(); - - if (null != commSocket) { - Runtime.getRuntime().addShutdownHook( - new EmulatorShutdownhook(communicator)); - - Thread communicatorThread = - new Thread(communicator, "communicator"); - communicatorThread.start(); - - /* Moves the receiver to the top of the drawing order for - the display on which it was created, marks it visible, - sets the focus and asks the window manager to make the - shell active */ - skin.open(); - - } else { - logger.severe("CommSocket is null."); - } - - } catch (Throwable e) { - if (null != logger) { - logger.log(Level.SEVERE, e.getMessage(), e); - logger.warning("Shutdown skin process !!!"); - } else { - e.printStackTrace(); - System.out.println("Shutdown skin process !!!"); - } - - Shell temp = new Shell(Display.getDefault()); - MessageBox messageBox = new MessageBox(temp, SWT.ICON_ERROR); - messageBox.setText("Emulator"); - messageBox.setMessage(e.getMessage()); - messageBox.open(); - temp.dispose(); - - if (null != communicator) { - communicator.terminate(); - } else { - terminateImmediately(-1); - } - } finally { - ImageRegistry.getInstance().dispose(); - Display.getDefault().close(); - SkinLogger.end(); - } - } - - private static void initLog( - Map<String, String> argsMap, Properties properties) { - String argLogLevel = argsMap.get(ArgsConstants.LOG_LEVEL); - String configPropertyLogLevel = null; - - if (null != properties) { - configPropertyLogLevel = - (String) properties.get(ConfigPropertiesConstants.LOG_LEVEL); - } - - /* default log level is debug. */ - - String logLevel = ""; - - if (!StringUtil.isEmpty(argLogLevel)) { - logLevel = argLogLevel; - } else if (!StringUtil.isEmpty(configPropertyLogLevel)) { - logLevel = configPropertyLogLevel; - } else { - logLevel = EmulatorConfig.DEFAULT_LOG_LEVEL.value(); - } - - SkinLogLevel skinLogLevel = EmulatorConfig.DEFAULT_LOG_LEVEL; - - SkinLogLevel[] values = SkinLogLevel.values(); - - for (SkinLogLevel level : values) { - if (level.value().equalsIgnoreCase(logLevel)) { - skinLogLevel = level; - break; - } - } - - SkinLogger.setLevel(skinLogLevel.level()); - } - - private static String getSimpleMsg(String[] args) { - for (String arg : args) { - if (arg.startsWith(ArgsConstants.SIMPLE_MESSAGE)) { - String[] split = arg.split("=", 2); - if (split.length == 2) { - return split[1]; - } - } - } - - return null; - } - - private static String getVmPath(String[] args) { - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - String[] split = arg.split("="); - - if (1 < split.length) { - if (ArgsConstants.VM_PATH.equals( - split[0].trim())) { - return split[1].trim(); - } - } - } - - return null; - } - - private static Map<String, String> parseArgs(String[] args) { - Map<String, String> map = new HashMap<String, String>(); - - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - logger.info("arg[" + i + "] " + arg); - - String[] split = arg.split("="); - if (1 < split.length) { - String argKey = split[0].trim(); - String argValue = split[1].trim(); - - map.put(argKey, argValue); - } else { - logger.info("sinlge argv:" + arg); - } - } - - logger.info("================= argsMap ====================="); - logger.info(map.toString()); - logger.info("==============================================="); - - return map; - } - - private static EmulatorUI loadXMLForSkin(String skinPath) { - String dbiPath = skinPath + File.separator + DBI_FILE_NAME; - logger.info("load dbi file from " + dbiPath); - - FileInputStream fis = null; - EmulatorUI emulatorUI = null; - - try { - fis = new FileInputStream(dbiPath); - logger.info("============ dbi contents ============"); - byte[] bytes = IOUtil.getBytes(fis); - logger.info(new String(bytes, "UTF-8")); - logger.info("======================================="); - - emulatorUI = JaxbUtil.unmarshal(bytes, EmulatorUI.class); - - /* register rotation info */ - RotationsType rotations = emulatorUI.getRotations(); - if (rotations != null) { - List<RotationType> rotationList = rotations.getRotation(); - - for (RotationType rotation : rotationList) { - SkinRotations.put(rotation); - } - } else { - logger.severe("Fail to loading rotations element from XML"); - } - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (JaxbException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } finally { - IOUtil.close(fis); - } - - return emulatorUI; - } - - public static void terminateImmediately(int exit) { - if (logger != null) { - logger.info("shutdown immediately! exit value : " + exit); - } - - System.exit(exit); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java deleted file mode 100644 index 130558b480..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Communication Interface Between Qemu And Skin - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm; - -import org.tizen.emulator.skin.comm.sock.data.ISendData; - -/** - * - * - */ -public interface ICommunicator extends Runnable { - /* This values must match the QEMU definitions */ - public final static short RECV_HEART_BEAT = 1; - public final static short RECV_SCREENSHOT_DATA = 2; - public final static short RECV_DETAIL_INFO_DATA = 3; - public final static short RECV_RAMDUMP_COMPLETED = 4; - public final static short RECV_BOOTING_PROGRESS = 5; - public final static short RECV_DISPLAY_POWER = 6; - public final static short RECV_HOST_KBD_STATE = 8; - public final static short RECV_MULTI_TOUCH_STATE = 9; - public final static short RECV_GUEST_IP = 10; - - public final static short RECV_SDBD_STARTED = 801; - public final static short RECV_DRAW_FRAME = 900; - public final static short RECV_DRAW_BLANK_GUIDE = 901; - public final static short RECV_EMUL_RESET = 998; - public final static short RECV_EMUL_SHUTDOWN = 999; - - public enum MouseButtonType { - LEFT( (short)1 ), - WHEEL( (short)2 ), - RIGHT( (short)3 ); - - private short value; - MouseButtonType( short value ) { - this.value = value; - } - - public short value() { - return this.value; - } - - public static MouseButtonType getValue( String val ) { - MouseButtonType[] values = MouseButtonType.values(); - for (int i = 0; i < values.length; i++) { - if( values[i].value == Integer.parseInt( val ) ) { - return values[i]; - } - } - throw new IllegalArgumentException( val ); - } - - public static MouseButtonType getValue( short val ) { - MouseButtonType[] values = MouseButtonType.values(); - for (int i = 0; i < values.length; i++) { - if( values[i].value == val ) { - return values[i]; - } - } - throw new IllegalArgumentException( Integer.toString(val) ); - } - - } - - public enum MouseEventType { - PRESS( (short)1 ), - RELEASE( (short)2 ), - DRAG( (short)3 ), - WHEELUP( (short)4 ), - WHEELDOWN( (short)5 ), - MOVE( (short)6 ); - - private short value; - MouseEventType( short value ) { - this.value = value; - } - - public short value() { - return this.value; - } - - public static MouseEventType getValue( String val ) { - MouseEventType[] values = MouseEventType.values(); - for (int i = 0; i < values.length; i++) { - if( values[i].value == Integer.parseInt( val ) ) { - return values[i]; - } - } - throw new IllegalArgumentException( val ); - } - - public static MouseEventType getValue( short val ) { - MouseEventType[] values = MouseEventType.values(); - for (int i = 0; i < values.length; i++) { - if( values[i].value == val ) { - return values[i]; - } - } - throw new IllegalArgumentException( Integer.toString(val) ); - } - - } - - public enum KeyEventType { - PRESSED( (short)1 ), - RELEASED( (short)2 ); - - private short value; - KeyEventType( short value ) { - this.value = value; - } - - public short value() { - return this.value; - } - - public static KeyEventType getValue( String val ) { - KeyEventType[] values = KeyEventType.values(); - for (int i = 0; i < values.length; i++) { - if( values[i].value == Integer.parseInt( val ) ) { - return values[i]; - } - } - throw new IllegalArgumentException( val ); - } - - public static KeyEventType getValue( short val ) { - KeyEventType[] values = KeyEventType.values(); - for (int i = 0; i < values.length; i++) { - if( values[i].value == val ) { - return values[i]; - } - } - throw new IllegalArgumentException( Integer.toString(val) ); - } - - } - - public enum SendCommand { - /* This values must match the QEMU definitions */ - - SEND_SKIN_OPENED((short) 1), - SEND_SKIN_GRABBED((short) 2), - - SEND_MOUSE_EVENT((short) 10), - SEND_KEYBOARD_KEY_EVENT((short) 11), - SEND_HW_KEY_EVENT((short) 12), - SEND_DISPLAY_STATE((short) 13), - SEND_OPEN_SHELL((short) 14), - SEND_HOST_KBD_STATE((short) 15), - SEND_SCREENSHOT_REQ((short) 16), - SEND_DETAIL_INFO_REQ((short) 17), - SEND_RAM_DUMP((short) 18), - SEND_GUEST_DUMP((short) 19), - SEND_INTERPOLATION_STATE((short) 21), - SEND_ROTARY_EVENT((short) 30), - SEND_GUEST_IP_REQ((short) 40), - - RESPONSE_HEART_BEAT((short) 900), - RESPONSE_DRAW_FRAME((short) 901), - SEND_CLOSE_REQ((short) 998), - RESPONSE_SHUTDOWN((short) 999); - - private short value; - - SendCommand(short value) { - this.value = value; - } - - public short value() { - return this.value; - } - - public static SendCommand getValue(String val) { - SendCommand[] values = SendCommand.values(); - for (int i = 0; i < values.length; i++) { - if (values[i].value == Short.parseShort(val)) { - return values[i]; - } - } - throw new IllegalArgumentException(val); - } - - public static SendCommand getValue(short val) { - SendCommand[] values = SendCommand.values(); - for (int i = 0; i < values.length; i++) { - if (values[i].value == val) { - return values[i]; - } - } - throw new IllegalArgumentException(Integer.toString(val)); - } - } - - public void sendToQEMU(SendCommand command, ISendData data, boolean urgent); - - public void terminate(); -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java deleted file mode 100755 index c48c0bb710..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java +++ /dev/null @@ -1,776 +0,0 @@ -/** - * Communicate With Qemu - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock; - -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.Socket; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.EmulatorSkinMain; -import org.tizen.emulator.skin.comm.ICommunicator; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.data.BooleanData; -import org.tizen.emulator.skin.comm.sock.data.ISendData; -import org.tizen.emulator.skin.comm.sock.data.StartData; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.image.ImageRegistry.ResourceImageName; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -/** - * - * - */ -public class SocketCommunicator implements ICommunicator { - private static class PacketHeader { - int reqId; /* id */ - short cmd; /* command */ - int length; /* data length */ - } - - public static class DataTranfer { - private boolean isTransferState; - private byte[] receivedData; - - private long sleep; - private long maxWaitTime; - private Timer timer; - - private DataTranfer() { - /* do nothing */ - } - - private void setData(byte[] data) { - this.receivedData = data; - isTransferState = false; - } - - } - - public static final int HEART_BEAT_INTERVAL = 1; /* seconds */ - public static final int HEART_BEAT_EXPIRE = 15; - - public final static int LONG_WAIT_INTERVAL = 3; /* ms */ - public final static int LONG_WAIT_LIMIT = 3000; /* ms */ - public final static int SHORT_WAIT_INTERVAL = 1; - public final static int SHORT_WAIT_LIMIT = 2000; - - public final static int MAX_SEND_QUEUE_SIZE = 100000; - - private static int reqId; - - private Logger logger = - SkinLogger.getSkinLogger(SocketCommunicator.class).getLogger(); - - private EmulatorConfig config; - private int uId; - private StartData startData; - private EmulatorSkin skin; - - private Socket socket; - private DataInputStream sockInputStream; - private DataOutputStream sockOutputStream; - - private AtomicInteger heartbeatCount; - private boolean isTerminated; - private boolean isSdbDaemonStarted; - private boolean isRamdump; - private TimerTask heartbeatExecutor; - private Timer heartbeatTimer; - - private DataTranfer screenShotDataTransfer; - private DataTranfer detailInfoTransfer; - private DataTranfer miscDataTransfer; - private DataTranfer guestIpTransfer; - - private Thread sendThread; - private LinkedList<SkinSendData> sendQueue; - - private ByteArrayOutputStream bao; - private DataOutputStream dataOutputStream; - - /** - * Constructor - */ - public SocketCommunicator(EmulatorConfig config, int uId, EmulatorSkin skin) { - this.config = config; - this.uId = uId; - this.skin = skin; - - this.screenShotDataTransfer = new DataTranfer(); - this.screenShotDataTransfer.sleep = LONG_WAIT_INTERVAL; - this.screenShotDataTransfer.maxWaitTime = LONG_WAIT_LIMIT; - - this.detailInfoTransfer = new DataTranfer(); - this.detailInfoTransfer.sleep = SHORT_WAIT_INTERVAL; - this.detailInfoTransfer.maxWaitTime = SHORT_WAIT_LIMIT; - - this.miscDataTransfer = new DataTranfer(); - this.miscDataTransfer.sleep = SHORT_WAIT_INTERVAL; - this.miscDataTransfer.maxWaitTime = SHORT_WAIT_LIMIT; - this.guestIpTransfer = new DataTranfer(); - this.guestIpTransfer.sleep = SHORT_WAIT_INTERVAL; - this.guestIpTransfer.maxWaitTime = SHORT_WAIT_LIMIT; - - this.heartbeatCount = new AtomicInteger(0); - //this.heartbeatExecutor = Executors.newSingleThreadScheduledExecutor(); - this.heartbeatTimer = new Timer(); - - try { - int port = config.getArgInt(ArgsConstants.VM_SKIN_PORT); - socket = new Socket("127.0.0.1", port); - logger.info("socket.isConnected() : " + socket.isConnected()); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - StringBuilder message = new StringBuilder("Error message: " - + e.getMessage()); - if (SwtUtil.isMacPlatform()) { - message.append(System.getProperty("line.separator")).append( - "Make sure that SOCKS proxy setting is correct."); - } - SkinUtil.openMessage( - skin.getShell(), - null, - "Emulator UI fails to connect." - + System.getProperty("line.separator") - + message.toString(), SWT.ICON_ERROR, config); - EmulatorSkinMain.terminateImmediately(-1); - } - - this.bao = new ByteArrayOutputStream(); - this.dataOutputStream = new DataOutputStream(bao); - } - - public void setInitialData(StartData data) { - this.startData = data; - } - - private void sendInitialData() { - logger.info("send startData"); - sendToQEMU(SendCommand.SEND_SKIN_OPENED, startData, false); - - skin.getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - /* send a state for display interpolation */ - BooleanData dataInterpolation = new BooleanData( - skin.isOnInterpolation, - SendCommand.SEND_INTERPOLATION_STATE.toString()); - sendToQEMU(SendCommand.SEND_INTERPOLATION_STATE, dataInterpolation, false); - } - }); - } - - @Override - public void run() { - sendQueue = new LinkedList<SkinSendData>(); - - sendThread = new Thread("sendThread") { - List<SkinSendData> list = new ArrayList<SkinSendData>(); - SkinSendData sendData = null; - - @Override - public void run() { - while (true) { - synchronized (sendQueue) { - if (sendQueue.isEmpty()) { - try { - sendQueue.wait(); - } catch (InterruptedException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - } - - while (true) { - sendData = sendQueue.poll(); - if (null != sendData) { - list.add(sendData); - } else { - break; - } - } - } - - if (isTerminated) { - list.clear(); - break; - } - - for (SkinSendData data : list) { - sendToQEMUInternal(data); - } - - list.clear(); - } - } - }; - - try { - sockInputStream = new DataInputStream(socket.getInputStream()); - sockOutputStream = new DataOutputStream(socket.getOutputStream()); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - terminate(); - return; - } - - sendThread.setDaemon(true); - sendThread.start(); - - /* notify to Qemu */ - sendInitialData(); - - boolean ignoreHeartbeat = - config.getArgBoolean(ArgsConstants.HEART_BEAT_IGNORE); - - if (ignoreHeartbeat) { - logger.info("Ignore Skin heartbeat."); - } else { - heartbeatExecutor = new TimerTask() { - @Override - public void run() { - increaseHeartbeatCount(); - - if (isHeartbeatExpired()) { - logger.info("heartbeat was expired!"); - terminate(); - } - } - }; - - heartbeatTimer.schedule(heartbeatExecutor, 1, HEART_BEAT_INTERVAL * 1000); - } - - PacketHeader header = new PacketHeader(); - - while (true) { - if (isTerminated) { - break; - } - - try { - header.reqId = sockInputStream.readInt(); - header.cmd = sockInputStream.readShort(); - header.length = sockInputStream.readInt(); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("[Socket] read - reqId:" + header.reqId + - ", command:" + header.cmd + ", dataLength:" + header.length); - } - - switch (header.cmd) { - case RECV_HEART_BEAT: { - resetHeartbeatCount(); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("received HEART_BEAT from QEMU"); - } - - sendToQEMU(SendCommand.RESPONSE_HEART_BEAT, null, true); - break; - } - case RECV_SCREENSHOT_DATA: { - logger.info("received SCREENSHOT_DATA from QEMU"); - receiveData(sockInputStream, screenShotDataTransfer, header.length); - - break; - } - case RECV_DETAIL_INFO_DATA: { - logger.info("received DETAIL_INFO_DATA from QEMU"); - receiveData(sockInputStream, detailInfoTransfer, header.length); - - break; - } - case RECV_GUEST_IP: { - logger.info("received GUEST_IP from QEMU"); - receiveData(sockInputStream, guestIpTransfer, header.length); - - break; - } - case RECV_RAMDUMP_COMPLETED: { - logger.info("received RAMDUMP_COMPLETED from QEMU"); - setRamdumpFlag(false); - break; - } - case RECV_BOOTING_PROGRESS: { - //logger.info("received BOOTING_PROGRESS from QEMU"); - - resetDataTransfer(miscDataTransfer); - receiveData(sockInputStream, miscDataTransfer, header.length); - - byte[] receivedData = getReceivedData(miscDataTransfer); - if (null != receivedData) { - String strLayer = new String(receivedData, 0, 1, "UTF-8"); - String strValue = new String(receivedData, 1, header.length - 2, "UTF-8"); - - int layer = 0; - int value = 0; - try { - layer = Integer.parseInt(strLayer); - value = Integer.parseInt(strValue); - } catch (NumberFormatException e) { - e.printStackTrace(); - } - - /* draw progress bar */ - skin.updateProgressBar(layer, value); - } - - break; - } - case RECV_DISPLAY_POWER: { - //logger.info("received DISPLAY_POWER from QEMU"); - - resetDataTransfer(miscDataTransfer); - receiveData(sockInputStream, miscDataTransfer, header.length); - - byte[] receivedData = getReceivedData(miscDataTransfer); - if (null != receivedData) { - String strValue = new String(receivedData, 0, header.length - 1, "UTF-8"); - - int value = 1; - try { - value = Integer.parseInt(strValue); - } catch (NumberFormatException e) { - e.printStackTrace(); - } - - if (value == 0) { - skin.updateDisplayPower(false); - } else { - skin.updateDisplayPower(true); - } - } - - break; - } - case RECV_HOST_KBD_STATE: { - logger.info("received HOST_KBD_STATE from QEMU"); - - resetDataTransfer(miscDataTransfer); - receiveData(sockInputStream, miscDataTransfer, header.length); - - byte[] receivedData = getReceivedData(miscDataTransfer); - if (null != receivedData) { - String strValue = new String(receivedData, 0, header.length - 1, "UTF-8"); - - int value = 1; - try { - value = Integer.parseInt(strValue); - } catch (NumberFormatException e) { - e.printStackTrace(); - } - - if (value == 0) { - skin.updateHostKbdMenu(false); - } else { - skin.updateHostKbdMenu(true); - } - } - - break; - } - case RECV_MULTI_TOUCH_STATE: { - logger.info("received MULTI_TOUCH_STATE from QEMU"); - - resetDataTransfer(miscDataTransfer); - receiveData(sockInputStream, miscDataTransfer, header.length); - - byte[] receivedData = getReceivedData(miscDataTransfer); - if (null != receivedData) { - String strValue = new String(receivedData, 0, header.length - 1, "UTF-8"); - - int value = 1; - try { - value = Integer.parseInt(strValue); - } catch (NumberFormatException e) { - e.printStackTrace(); - } - - if (value == 0) { - //TODO: - } else { - //TODO: - } - } - - break; - } - case RECV_SDBD_STARTED: { - logger.info("received SDBD_STARTED from QEMU"); - - synchronized (this) { - isSdbDaemonStarted = true; - } - break; - } - case RECV_DRAW_FRAME: { - //logger.info("received DRAW_FRAME from QEMU."); - - skin.updateDisplay(); - - break; - } - case RECV_DRAW_BLANK_GUIDE: { - logger.info("received DRAW_BLANK_GUIDE from QEMU."); - - Image imageGuide = skin.getImageRegistry().getResourceImage( - ResourceImageName.RESOURCE_BLANK_GUIDE); - if (imageGuide != null) { - skin.setCoverImage(imageGuide); - } - - break; - } - case RECV_EMUL_RESET: { - logger.info("received EMUL_RESET from QEMU"); - - synchronized (this) { - isSdbDaemonStarted = false; - } - - // TODO: - - break; - } - case RECV_EMUL_SHUTDOWN: { - logger.info("received EMUL_SHUTDOWN from QEMU"); - - sendToQEMU(SendCommand.RESPONSE_SHUTDOWN, null, false); - terminate(); - - break; - } - default: { - logger.severe("Unknown command from QEMU. command : " + header.cmd); - break; - } - } - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - break; - } - - } - - logger.info("communicatorThread is stopped"); - } - - private void receiveData(DataInputStream is, - DataTranfer dataTransfer, int length) throws IOException { - synchronized (dataTransfer) { - if (null != dataTransfer.timer) { - dataTransfer.timer.cancel(); - } - - byte[] data = readData(is, length); - - if (null != data) { - logger.info("finished receiving data from QEMU."); - } else { - logger.severe("Fail to receiving data from QEMU."); - } - - dataTransfer.isTransferState = false; - dataTransfer.timer = null; - - dataTransfer.setData(data); - dataTransfer.notifyAll(); - } - } - - private byte[] readData( - DataInputStream is, int length) throws IOException { - if (0 >= length) { - return null; - } - - byte[] data = new byte[length]; - is.readFully(data, 0, length); - - logger.info("finished reading stream. read : " + length); - - return data; - } - - private DataTranfer resetDataTransfer(final DataTranfer dataTransfer) { - synchronized(dataTransfer) { - if (dataTransfer.isTransferState) { - logger.severe("Already transter state for getting data."); - return null; - } - - dataTransfer.isTransferState = true; - - Timer timer = new Timer(); - dataTransfer.timer = timer; - - TimerTask timerTask = new TimerTask() { - @Override - public void run() { - synchronized(dataTransfer) { - dataTransfer.isTransferState = false; - dataTransfer.timer = null; - dataTransfer.receivedData = null; - } - } - }; - timer.schedule(timerTask, dataTransfer.maxWaitTime + 1000); - - return dataTransfer; - } - } - - public synchronized DataTranfer sendDataToQEMU( - SendCommand command, ISendData data, boolean useDataTransfer) { - DataTranfer dataTranfer = null; - - if (useDataTransfer) { - if (SendCommand.SEND_SCREENSHOT_REQ.equals(command)) { - dataTranfer = resetDataTransfer(screenShotDataTransfer); - } else if (SendCommand.SEND_DETAIL_INFO_REQ.equals(command)) { - dataTranfer = resetDataTransfer(detailInfoTransfer); - } else if (SendCommand.SEND_GUEST_IP_REQ.equals(command)) { - dataTranfer = resetDataTransfer(guestIpTransfer); - } - } - - sendToQEMU(command, data, false); - - return dataTranfer; - } - - @Override - public void sendToQEMU(SendCommand command, ISendData data, boolean urgent) { - synchronized(sendQueue) { - if (MAX_SEND_QUEUE_SIZE < sendQueue.size()) { - logger.warning( - "Send queue size exceeded max value, do not push data into send queue."); - } else { - if (urgent == true) { - sendQueue.addFirst(new SkinSendData(command, data)); - } else { - sendQueue.add(new SkinSendData(command, data)); - } - - sendQueue.notifyAll(); - } - } - } - - private void sendToQEMUInternal(SkinSendData sendData) { - if (null == sendData) { - return; - } - - SendCommand command = sendData.getCommand(); - ISendData data = sendData.getSendData(); - - reqId = (Integer.MAX_VALUE == reqId) ? 0 : ++reqId; - - try { - dataOutputStream.writeInt(uId); - dataOutputStream.writeInt(reqId); - dataOutputStream.writeShort(command.value()); - - short length = 0; - if (null == data) { - length = 0; - dataOutputStream.writeShort(length); - } else { - byte[] byteData = data.serialize(); - length = (short) byteData.length; - - dataOutputStream.writeShort(length); - dataOutputStream.write(byteData); - } - - dataOutputStream.flush(); - - sockOutputStream.write(bao.toByteArray()); - sockOutputStream.flush(); - - bao.reset(); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("[Socket] write - uid:" + uId + - ", reqId:" + reqId + ", command:" + command.value() - + " - " + command.toString() + ", length:" + length); - } - - if (0 < length) { - if (logger.isLoggable(Level.FINE)) { - logger.fine("[Socket] data - " + data.toString()); - } - } - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - } - - public byte[] getReceivedData(DataTranfer dataTranfer) { - if (null == dataTranfer) { - return null; - } - - synchronized (dataTranfer) { - int count = 0; - byte[] receivedData = null; - long sleep = dataTranfer.sleep; - long maxWaitTime = dataTranfer.maxWaitTime; - int limitCount = (int) (maxWaitTime / sleep); - - while (dataTranfer.isTransferState) { - if (limitCount < count) { - logger.severe("time out for receiving data from skin server."); - - dataTranfer.receivedData = null; - break; - } - - try { - dataTranfer.wait(sleep); - } catch (InterruptedException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - - count++; - logger.info("wait data... count : " + count); - } - - receivedData = dataTranfer.receivedData; - dataTranfer.receivedData = null; - - return receivedData; - } - } - - public Socket getSocket() { - return socket; - } - - public synchronized boolean isSdbDaemonStarted() { - return isSdbDaemonStarted; - } - - public synchronized void setRamdumpFlag(boolean flag) { - isRamdump = flag; - } - - public synchronized boolean getRamdumpFlag() { - return isRamdump; - } - - private void increaseHeartbeatCount() { - int count = heartbeatCount.incrementAndGet(); - - if (count > 1) { - logger.info("HB count : " + count); - } - } - - private boolean isHeartbeatExpired() { - return HEART_BEAT_EXPIRE < heartbeatCount.get(); - } - - private void resetHeartbeatCount() { - heartbeatCount.set(0); - - if (logger.isLoggable(Level.FINE)) { - logger.info("HB count reset"); - } - } - - @Override - public void terminate() { - if (isTerminated == true) { - logger.info("has been terminated"); - return; - } - - logger.info("terminated"); - - isTerminated = true; - - synchronized (sendQueue) { - sendQueue.notifyAll(); - } - - if (null != heartbeatTimer) { - heartbeatTimer.cancel(); - heartbeatTimer = null; - } - - IOUtil.closeSocket(socket); - IOUtil.close(sockInputStream); - IOUtil.close(sockOutputStream); - - IOUtil.close(bao); - IOUtil.close(dataOutputStream); - - synchronized (this) { - skin.shutdown(); - } - } -} - -class SkinSendData { - private SendCommand command; - private ISendData data; - - public SkinSendData(SendCommand command, ISendData data) { - this.command = command; - this.data = data; - } - - public SendCommand getCommand() { - return command; - } - - public ISendData getSendData() { - return data; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/AbstractSendData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/AbstractSendData.java deleted file mode 100644 index 4388165dd8..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/AbstractSendData.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Abstract Data - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - * - * - */ -public abstract class AbstractSendData implements ISendData { - private DataOutputStream dos; - private ByteArrayOutputStream bao; - - public AbstractSendData() { - bao = new ByteArrayOutputStream(); - dos = new DataOutputStream(bao); - } - - protected abstract void write() throws IOException ; - - @Override - public byte[] serialize() throws IOException { - write(); - return bao.toByteArray(); - } - - protected void writeShort(int val) throws IOException { - dos.writeShort(val); - } - - protected void writeInt(int val) throws IOException { - dos.writeInt(val); - } - - protected void writeLong(long val) throws IOException { - dos.writeLong(val); - } - - protected void writeBoolean(boolean val) throws IOException { - dos.writeBoolean(val); - } - - protected void writeChar(char val) throws IOException { - dos.writeChar(val); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/BooleanData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/BooleanData.java deleted file mode 100644 index bb2773ae5f..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/BooleanData.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Boolean Data - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public class BooleanData extends AbstractSendData { - private boolean booleanValue; - private String dataName; - - public BooleanData(boolean booleanValue) { - this.booleanValue = booleanValue; - } - - public BooleanData(boolean booleanValue, String dataName) { - this.booleanValue = booleanValue; - this.dataName = dataName; - } - - /* (non-Javadoc) - * @see org.tizen.emulator.skin.comm.sock.data.AbstractSendData#write() - */ - @Override - protected void write() throws IOException { - writeBoolean(booleanValue); - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("BooleanData [booleanValue="); - builder.append(booleanValue); - builder.append(", dataName="); - builder.append(dataName); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/DisplayStateData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/DisplayStateData.java deleted file mode 100644 index 447e2afa13..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/DisplayStateData.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Display State Data - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public class DisplayStateData extends AbstractSendData { - int scale; - short rotation; - - public DisplayStateData(int scale, short rotation) { - this.scale = scale; - this.rotation = rotation; - } - - @Override - protected void write() throws IOException { - writeInt(scale); - writeShort(rotation); - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("DisplayStateData [scale="); - builder.append(scale); - builder.append(", rotation="); - builder.append(rotation); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/ISendData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/ISendData.java deleted file mode 100644 index 7a2739fab5..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/ISendData.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public interface ISendData { - - public byte[] serialize() throws IOException; - -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/KeyEventData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/KeyEventData.java deleted file mode 100644 index e3b284cb2b..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/KeyEventData.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Key Event Data - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public class KeyEventData extends AbstractSendData { - public int eventType; - public int keycode; - public int stateMask; - public int keyLocation; - - public KeyEventData(int eventType, int keyCode, int stateMask, int keyLocation) { - this.eventType = eventType; - this.keycode = keyCode; - this.stateMask = stateMask; - this.keyLocation = keyLocation; - } - - @Override - protected void write() throws IOException { - writeInt(eventType); - writeInt(keycode); - writeInt(stateMask); - writeInt(keyLocation); - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("KeyEventData [eventType="); - builder.append(eventType); - builder.append(", keycode="); - builder.append(keycode); - builder.append(", stateMask="); - builder.append(stateMask); - builder.append(", keyLocation="); - builder.append(keyLocation); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java deleted file mode 100644 index 055bdd750b..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/MouseEventData.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Mouse Event Data - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public class MouseEventData extends AbstractSendData { - int mouseButton; - int eventType; - int hostX; - int hostY; - int guestX; - int guestY; - int z; - - public MouseEventData(int mouseButton, int eventType, - int hostX, int hostY, int guestX, int guestY, int z) { - this.mouseButton = mouseButton; - this.eventType = eventType; - this.hostX = hostX; - this.hostY = hostY; - this.guestX = guestX; - this.guestY = guestY; - this.z = z; - } - - @Override - protected void write() throws IOException { - writeInt(mouseButton); - writeInt(eventType); - writeInt(hostX); - writeInt(hostY); - writeInt(guestX); - writeInt(guestY); - writeInt(z); - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("MouseEventData [mouseButton="); - builder.append(mouseButton); - builder.append(", eventType="); - builder.append(eventType); - builder.append(", hostX="); - builder.append(hostX); - builder.append(", hostY="); - builder.append(hostY); - builder.append(", guestX="); - builder.append(guestX); - builder.append(", guestY="); - builder.append(guestY); - builder.append(", id="); - builder.append(z); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/RotaryEventData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/RotaryEventData.java deleted file mode 100644 index a1780c439a..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/RotaryEventData.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Rotary Event Data - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public class RotaryEventData extends AbstractSendData { - int eventType; - int delta; - - public RotaryEventData(int eventType, int delta) { - this.eventType = eventType; - this.delta = delta; - } - - @Override - protected void write() throws IOException { - writeInt(eventType); - writeInt(delta); - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("RotaryEventData [eventType="); - builder.append(eventType); - builder.append(", delta="); - builder.append(delta); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/StartData.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/StartData.java deleted file mode 100644 index 918da209ae..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/StartData.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Initial Data From Skin - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.comm.sock.data; - -import java.io.IOException; - -/** - * - * - */ -public class StartData extends AbstractSendData { - private long displayHandleId; - private int displayWidth; - private int displayHeight; - private int scale; - private short rotation; - private boolean isBlankGuide; - - public StartData(long displayHandleId, - int displayWidth, int displayHeight, int scale, short rotation, - boolean isBlankGuide) { - this.displayHandleId = displayHandleId; - this.displayWidth = displayWidth; - this.displayHeight = displayHeight; - this.scale = scale; - this.rotation = rotation; - this.isBlankGuide = isBlankGuide; - } - - @Override - protected void write() throws IOException { - writeLong(displayHandleId); - writeInt(displayWidth); - writeInt(displayHeight); - writeInt(scale); - writeShort(rotation); - - if (isBlankGuide == true) { - writeShort(1); - } else { - writeShort(0); - } - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("StartData [displayHandleId="); - builder.append(displayHandleId); - builder.append(", display size " + displayWidth + "x" + displayHeight); - builder.append(", scale="); - builder.append(scale); - builder.append(", rotation="); - builder.append(rotation); - builder.append(", blank guide="); - builder.append(isBlankGuide); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java deleted file mode 100644 index cb906d24a6..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java +++ /dev/null @@ -1,609 +0,0 @@ -/** - * Emulator Configuration Information - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.config; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Map; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.dbi.EmulatorUI; -import org.tizen.emulator.skin.exception.ConfigException; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.log.SkinLogger.SkinLogLevel; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.StringUtil; - - -/** - * - * - */ -public class EmulatorConfig { - public static final String INVALID_OPTION_MESSAGE = - "An invalid option have caused the error.\n"; - - public static final int DEFAULT_WINDOW_SCALE = 50; - public static final int MIN_SCALE_FACTOR = 25; - public static final int MAX_SCALE_FACTOR = 200; - public static final int DEFAULT_WINDOW_X = 50; - public static final int DEFAULT_WINDOW_Y = 50; - public static final SkinLogLevel DEFAULT_LOG_LEVEL = SkinLogLevel.DEBUG; - - private static Logger logger = - SkinLogger.getSkinLogger(EmulatorConfig.class).getLogger(); - - public interface ArgsConstants { - public static final String SIMPLE_MESSAGE = "simple.msg"; - public static final String UID = "uid"; - public static final String RESOLUTION = "resolution"; - public static final String RESOLUTION_WIDTH = "width"; - public static final String RESOLUTION_HEIGHT = "height"; - public static final String HEART_BEAT_IGNORE = "hb.ignore"; - public static final String LOG_LEVEL = "log.level"; - public static final String VM_PATH = "vm.path"; - public static final String VM_SKIN_PORT = "vm.skinport"; - public static final String VM_BASE_PORT = "vm.baseport"; - public static final String SKIN_PATH = "skin.path"; - public static final String DISPLAY_SHM = "display.shm"; - public static final String INPUT_MOUSE = "input.mouse"; - public static final String INPUT_TOUCHSCREEN = "input.touch"; - public static final String INPUT_TOUCH_MAXPOINT = "input.touch.maxpoint"; - public static final String PROXY_ADDR = "proxy.addr"; - public static final String PROXY_PORT = "proxy.port"; - public static final String USE_TAP = "use.tap"; - } - - public interface SkinPropertiesConstants { - public static final String WINDOW_X = "window.x"; - 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_INTERPOLATION = "window.interpolation"; - public static final String KEYWINDOW_POSITION = "window.keywindow.position"; - } - - public interface ConfigPropertiesConstants { - public static final String HEART_BEAT_IGNORE = "hb.ignore"; - public static final String LOG_LEVEL = "log.level"; - } - - public interface SkinInfoConstants { - public static final String SDK_VERSION_NAME = "sdk.version-name"; /* from version file */ - public static final String SKIN_NAME = "skin.name"; - public static final String RESOLUTION_WIDTH = "resolution.width"; - public static final String RESOLUTION_HEIGHT = "resolution.height"; - public static final String MANAGER_PRIORITY = "manager.priority"; - } - - private Map<String, String> args; - private EmulatorUI dbiContents; - private Properties skinProperties; - private Properties configProperties; - private String skinPropertiesFilePath; - - /** - * Constructor - */ - public EmulatorConfig(Map<String, String> args, - EmulatorUI dbiContents, Properties skinProperties, - String skinPropertiesFilePath, Properties configProperties) { - this.args = args; - this.dbiContents = dbiContents; - this.skinProperties = skinProperties; - this.skinPropertiesFilePath = skinPropertiesFilePath; - this.configProperties = configProperties; - - if (null == configProperties) { - this.configProperties = new Properties(); - } - - /* read SDK version */ - String strVersion = loadSDKVersion(); - logger.info("SDK version : " + strVersion); - - setSkinProperty( - EmulatorConfig.SkinInfoConstants.SDK_VERSION_NAME, strVersion); - } - - private String loadSDKVersion() { - String strVersion = "Undefined"; - - String filePath = SkinUtil.getSdkVersionFilePath(); - Properties properties = SkinUtil.loadProperties(filePath, false); - - if (properties != null) { - strVersion = (String) properties.get("TIZEN_SDK_VERSION"); - if (StringUtil.isEmpty(strVersion) == true) { - strVersion = "Undefined"; - } - } else { - logger.warning("cannot read version from " + filePath); - } - - /* File file = new File(filePath); - - if (file.exists() == false || file.isFile() == false) { - logger.warning("cannot read version from " + filePath); - } else { - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader( - new FileInputStream(file), "UTF8")); - } catch (FileNotFoundException e) { - logger.warning(e.getMessage()); - } catch (UnsupportedEncodingException e) { - logger.warning(e.getMessage()); - } - - if (reader != null) { - try { - strVersion = reader.readLine(); - } catch (IOException e) { - logger.warning(e.getMessage()); - } - - try { - reader.close(); - } catch (IOException e) { - logger.warning(e.getMessage()); - } - } - } */ - - return strVersion; - } - - public static void validateArgs(Map<String, String> args) throws ConfigException { - if (null == args) { - String msg = INVALID_OPTION_MESSAGE; - throw new ConfigException(msg); - } - - String value = null; - - if ((value = args.get(ArgsConstants.UID)) != null) { - try { - Integer.parseInt(value); - } catch (NumberFormatException e) { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.UID + - "\' argument is not numeric.\n: " + value; - throw new ConfigException(msg); - } - } - - if ((value = args.get(ArgsConstants.VM_SKIN_PORT)) != null) { - try { - Integer.parseInt(value); - } catch (NumberFormatException e) { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.VM_SKIN_PORT + - "\' argument is not numeric.\n: " + value; - throw new ConfigException(msg); - } - } else { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.VM_SKIN_PORT + "\' is required argument."; - throw new ConfigException(msg); - } - - // If "resolution" is exists, override "width" and "height". - if ((value = args.get(ArgsConstants.RESOLUTION)) != null) { - String[] splitted = value.split("x"); - if(splitted.length == 2) { - args.put(ArgsConstants.RESOLUTION_WIDTH, splitted[0]); - args.put(ArgsConstants.RESOLUTION_HEIGHT, splitted[1]); - } - else { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.RESOLUTION + - "\' argument is invalid.\n: " + value; - throw new ConfigException(msg); - } - } - - if ((value = args.get(ArgsConstants.RESOLUTION_WIDTH)) != null) { - try { - Integer.parseInt(value); - } catch (NumberFormatException e) { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.RESOLUTION_WIDTH + - "\' argument is not numeric.\n: " + value; - throw new ConfigException(msg); - } - } else { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.RESOLUTION_WIDTH + "\' is required argument."; - throw new ConfigException(msg); - } - - if ((value = args.get(ArgsConstants.RESOLUTION_HEIGHT)) != null) { - try { - Integer.parseInt(value); - } catch (NumberFormatException e) { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.RESOLUTION_HEIGHT + - "\' argument is not numeric.\n: " + value; - throw new ConfigException(msg); - } - } else { - String msg = INVALID_OPTION_MESSAGE + "The \'" + - ArgsConstants.RESOLUTION_HEIGHT + "\' is required argument."; - throw new ConfigException(msg); - } - } - - public static void validateSkinProperties( - Properties skinProperties) throws ConfigException { - if (null == skinProperties || 0 == skinProperties.size()) { - return; - } - - if (skinProperties.containsKey( - SkinPropertiesConstants.WINDOW_X) == true) { - String window_x = skinProperties.getProperty(SkinPropertiesConstants.WINDOW_X); - - try { - Integer.parseInt(window_x); - } catch (NumberFormatException e) { - String msg = SkinPropertiesConstants.WINDOW_X + - " in .skin.properties is not numeric : " + window_x; - logger.warning(msg); - - skinProperties.remove(SkinPropertiesConstants.WINDOW_X); - } - } - - if (skinProperties.containsKey( - SkinPropertiesConstants.WINDOW_Y) == true) { - String window_y = skinProperties.getProperty(SkinPropertiesConstants.WINDOW_Y); - - try { - Integer.parseInt(window_y); - } catch (NumberFormatException e) { - String msg = SkinPropertiesConstants.WINDOW_Y + - " in .skin.properties is not numeric. : " + window_y; - logger.warning(msg); - - skinProperties.remove(SkinPropertiesConstants.WINDOW_Y); - } - } - - if (skinProperties.containsKey( - SkinPropertiesConstants.WINDOW_ROTATION) == true) { - String rotation = skinProperties.getProperty(SkinPropertiesConstants.WINDOW_ROTATION); - - try { - Integer.parseInt(rotation); - } catch (NumberFormatException e) { - String msg = SkinPropertiesConstants.WINDOW_ROTATION + - " in .skin.properties is not numeric. : " + rotation; - logger.warning(msg); - - skinProperties.remove(SkinPropertiesConstants.WINDOW_ROTATION); - } - } - - if (skinProperties.containsKey( - SkinPropertiesConstants.WINDOW_SCALE) == true) { - String scale = skinProperties.getProperty(SkinPropertiesConstants.WINDOW_SCALE); - - try { - Integer.parseInt(scale); - } catch (NumberFormatException e) { - String msg = SkinPropertiesConstants.WINDOW_SCALE + - " in .skin.properties is not numeric. : " + scale; - logger.warning(msg); - - skinProperties.remove(SkinPropertiesConstants.WINDOW_SCALE); - } - } - - if (skinProperties.containsKey( - SkinPropertiesConstants.KEYWINDOW_POSITION) == true) { - String position = skinProperties.getProperty(SkinPropertiesConstants.KEYWINDOW_POSITION); - - try { - Integer.parseInt(position); - } catch (NumberFormatException e) { - String msg = SkinPropertiesConstants.KEYWINDOW_POSITION + - " in .skin.properties is not numeric. : " + position; - logger.warning(msg); - - skinProperties.remove(SkinPropertiesConstants.KEYWINDOW_POSITION); - } - } - } - - public static void validateSkinConfigProperties( - Properties skinConfigProperties) throws ConfigException { - if (null == skinConfigProperties || 0 == skinConfigProperties.size()) { - return; - } - - // TODO: HEART_BEAT_IGNORE, LOG_LEVEL - } - - public void saveSkinProperties() { - File file = new File(skinPropertiesFilePath); - - if (!file.exists()) { - try { - if (!file.createNewFile()) { - return; - } - } catch (IOException e) { - logger.log(Level.SEVERE, "Fail to create skin properties file.", e); - return; - } - } - - FileOutputStream fos = null; - - try { - fos = new FileOutputStream(file); - - skinProperties.store(fos, "Automatically generated by emulator skin."); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } finally { - IOUtil.close(fos); - } - } - - public EmulatorUI getDbiContents() { - return dbiContents; - } - - /* arguments */ - public String getArg(String argKey) { /* string */ - return args.get(argKey); - } - - public String getArg(String argKey, String defaultValue) { - String arg = args.get(argKey); - if (StringUtil.isEmpty(arg)) { - return defaultValue; - } else { - return arg; - } - } - - public int getArgInt(String argKey) { /* integer */ - String arg = args.get(argKey); - if (StringUtil.isEmpty(arg)) { - return 0; - } - return Integer.parseInt(arg); - } - - public int getArgInt(String argKey, int defaultValue) { - String arg = args.get(argKey); - if (StringUtil.isEmpty(arg)) { - return defaultValue; - } - return Integer.parseInt(arg); - } - - public boolean getArgBoolean(String argKey) { /* boolean */ - String arg = args.get(argKey); - return Boolean.parseBoolean(arg); - } - - public boolean getArgBoolean(String argKey, boolean defaultValue) { - String arg = args.get(argKey); - if (StringUtil.isEmpty(arg)) { - return defaultValue; - } - return Boolean.parseBoolean(arg); - } - - public int getValidResolutionWidth() { - final int storedValue = getArgInt(ArgsConstants.RESOLUTION_WIDTH, 1); - - if (storedValue > 0) { - return storedValue; - } else { - return 1; - } - } - - public int getValidResolutionHeight() { - final int storedValue = getArgInt(ArgsConstants.RESOLUTION_HEIGHT, 1); - - if (storedValue > 0) { - return storedValue; - } else { - return 1; - } - } - - /* java properties */ - private void setProperty(Properties properties, String key, String value) { - properties.put(key, value); - } - - private void setProperty(Properties properties, String key, int value) { - properties.put(key, Integer.toString(value)); - } - - private String getProperty(Properties properties, String key) { - return properties.getProperty(key); - } - - private String getProperty(Properties properties, String key, - String defaultValue) { - String property = properties.getProperty(key); - if (StringUtil.isEmpty(property)) { - return defaultValue; - } - return property; - } - - private int getPropertyInt(Properties properties, String key) { - return Integer.parseInt(properties.getProperty(key)); - } - - private int getPropertyInt(Properties properties, String key, - int defaultValue) { - String property = properties.getProperty(key); - if (StringUtil.isEmpty(property)) { - return defaultValue; - } - return Integer.parseInt(property); - } - - private short getPropertyShort(Properties properties, String key) { - return Short.parseShort(properties.getProperty(key)); - } - - private short getPropertyShort(Properties properties, String key, - short defaultValue) { - String property = properties.getProperty(key); - if (StringUtil.isEmpty(property)) { - return defaultValue; - } - return Short.parseShort(property); - } - - /* skin properties */ - public String getSkinProperty(String key) { - return getProperty(skinProperties, key); - } - - public String getSkinProperty(String key, String defaultValue) { - return getProperty(skinProperties, key, defaultValue); - } - - public int getSkinPropertyInt(String key) { - return getPropertyInt(skinProperties, key); - } - - public int getSkinPropertyInt(String key, int defaultValue) { - return getPropertyInt(skinProperties, key, defaultValue); - } - - public short getSkinPropertyShort(String key) { - return getPropertyShort(skinProperties, key); - } - - public short getSkinPropertyShort(String key, short defaultValue) { - return getPropertyShort(skinProperties, key, defaultValue); - } - - public void setSkinProperty(String key, String value) { - setProperty(skinProperties, key, value); - } - - public void setSkinProperty(String key, int value) { - setProperty(skinProperties, key, value); - } - - public int getValidWindowX() { - int vmIndex = getArgInt(ArgsConstants.VM_BASE_PORT) % 100; - final int storedValue = getSkinPropertyInt(SkinPropertiesConstants.WINDOW_X, - EmulatorConfig.DEFAULT_WINDOW_X + vmIndex); - - Rectangle monitorBound = Display.getDefault().getBounds(); - logger.info("current display size : " + monitorBound); - - /* location correction */ - int xx = 0; - if (storedValue < monitorBound.x) { - xx = monitorBound.x; - logger.info("WINDOW_X = " + storedValue + " -> " + xx); - } else if (storedValue > monitorBound.x + monitorBound.width - 30) { - xx = monitorBound.x + monitorBound.width - 100; - logger.info("WINDOW_X = " + storedValue + " -> " + xx); - } else { - xx = storedValue; - logger.info("WINDOW_X = " + xx); - } - - return xx; - } - - public int getValidWindowY() { - int vmIndex = getArgInt(ArgsConstants.VM_BASE_PORT) % 100; - final int storedValue = getSkinPropertyInt(SkinPropertiesConstants.WINDOW_Y, - EmulatorConfig.DEFAULT_WINDOW_Y + vmIndex); - - Rectangle monitorBound = Display.getDefault().getBounds(); - logger.info("current display size : " + monitorBound); - - /* location correction */ - int yy = 0; - if (storedValue < monitorBound.y) { - yy = monitorBound.y; - logger.info("WINDOW_Y = " + storedValue + " -> " + yy); - } else if (storedValue > monitorBound.y + monitorBound.height - 30) { - yy = monitorBound.y + monitorBound.height - 100; - logger.info("WINDOW_Y = " + storedValue + " -> " + yy); - } else { - yy = storedValue; - logger.info("WINDOW_Y = " + yy); - } - - return yy; - } - - public int getValidScale() { - final int storedScale = getSkinPropertyInt( - SkinPropertiesConstants.WINDOW_SCALE, DEFAULT_WINDOW_SCALE); - - if (storedScale >= MIN_SCALE_FACTOR && - storedScale <= MAX_SCALE_FACTOR) { /* percentage */ - return storedScale; - } else { - return DEFAULT_WINDOW_SCALE; - } - } - - /* config properties */ - public String getConfigProperty(String key) { - return getProperty(configProperties, key); - } - - public String getConfigProperty(String key, String defaultValue) { - return getProperty(configProperties, key, defaultValue); - } - - public int getConfigPropertyInt(String key, int defaultValue) { - return getPropertyInt(configProperties, key, defaultValue); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/ColorTag.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/ColorTag.java deleted file mode 100644 index 68927d5e4f..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/ColorTag.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Pair Tag - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Shell; - -public class ColorTag extends Canvas { - private static final int COLORTAG_WIDTH = 8; - private static final int COLORTAG_HEIGHT = 8; - - public ColorTag(final Shell parent, int style, final Color colorOval) { - super(parent, style); - - setSize(COLORTAG_WIDTH, COLORTAG_HEIGHT); - setBackground(parent.getBackground()); - - addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - e.gc.setBackground(colorOval); - e.gc.setAntialias(SWT.ON); - e.gc.fillOval( - 0, 0, COLORTAG_WIDTH, COLORTAG_HEIGHT); - } - }); - } - - public int getWidth() { - return getSize().x; - } - - public int getHeight() { - return getSize().y; - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomButton.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomButton.java deleted file mode 100644 index 716abfab19..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomButton.java +++ /dev/null @@ -1,247 +0,0 @@ -/** - * Image Button - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.MouseTrackAdapter; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; - -public class CustomButton extends Canvas { - /* state */ - private int mouse = 0; - private boolean hit = false; - - /* image - 0 : normal, 1 : hover, 2 : pushed */ - private Image imageButton[]; - - private int width; - private int height; - private String text; - private int textPositionX; - private int textPositionY; - private static Color white; - private static Color gray; - - public CustomButton(Composite parent, int style, - Image imageNormal, Image imageHover, Image imagePushed) { - super(parent, style); - - this.imageButton = new Image[3]; - imageButton[0] = imageNormal; - imageButton[1] = imageHover; - imageButton[2] = imagePushed; - - this.width = imageNormal.getImageData().width; - this.height = imageNormal.getImageData().height; - - this.text = null; - textPositionX = width / 2; - textPositionY = height / 2; - white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); - gray = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY); - - this.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - switch (mouse) { - case 0: /* default state */ - if (imageButton[0] != null) { - e.gc.drawImage(imageButton[0], 0, 0); - } - - if (text != null) { - e.gc.setForeground(white); - e.gc.drawText(text, - textPositionX, textPositionY, true); - } - - break; - case 1: /* mouse over */ - if (imageButton[1] != null) { - e.gc.drawImage(imageButton[1], 0, 0); - } - - if (text != null) { - e.gc.setForeground(white); - e.gc.drawText(text, - textPositionX, textPositionY, true); - } - - break; - case 2: /* mouse down */ - if (imageButton[2] != null) { - e.gc.drawImage(imageButton[2], 0, 0); - } - - if (text != null) { - e.gc.setForeground(gray); - e.gc.drawText(text, - textPositionX, textPositionY, true); - } - - break; - default: - break; - } - } - }); - - this.addMouseMoveListener(new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (!hit) { - return; - } - - mouse = 2; - - if (e.x < 0 || e.y < 0 || - e.x > getBounds().width || e.y > getBounds().height) { - /* dragging out */ - mouse = 0; - } - - redraw(); - } - }); - - this.addMouseTrackListener(new MouseTrackAdapter() { - @Override - public void mouseEnter(MouseEvent e) { - mouse = 1; - - redraw(); - } - - @Override - public void mouseExit(MouseEvent e) { - mouse = 0; - - redraw(); - } - }); - - this.addMouseListener(new MouseAdapter() { - @Override - public void mouseDown(MouseEvent e) { - hit = true; - mouse = 2; - - redraw(); - } - - @Override - public void mouseUp(MouseEvent e) { - hit = false; - mouse = 1; - - if (e.x < 0 || e.y < 0 || - e.x > getBounds().width || e.y > getBounds().height) { - mouse = 0; - } - - redraw(); - - if (mouse == 1) { - notifyListeners(SWT.Selection, new Event()); - } - } - }); - - this.addKeyListener(new KeyAdapter() { - @Override - public void keyPressed(KeyEvent e) { - if (e.keyCode == '\r' || e.character == ' ') { - Event event = new Event(); - notifyListeners(SWT.Selection, event); - } - } - }); - } - - public void setText(String textValue) { - /* checking whether the text value is appropriate */ - if (textValue == null || textValue.isEmpty()) { - return; - } - - GC gc = new GC(this); - Point textSize = gc.textExtent(textValue); - Point originalSize = textSize; - - while (textSize.x >= (width - 10)) { - textValue = textValue.substring(0, textValue.length() - 1); - textSize = gc.textExtent(textValue); - } - - if (originalSize.x != textSize.x) { - textValue = textValue.substring(0, textValue.length() - 1); - textValue += ".."; - textSize = gc.textExtent(textValue); - } - - gc.dispose(); - - /* set text */ - text = textValue; - - textPositionX -= textSize.x / 2; - if (textPositionX < 0) { - textPositionX = 0; - } - - textPositionY -= textSize.y / 2; - if (textPositionY < 0) { - textPositionY = 0; - } - } - - public String getText() { - return text; - } - - public Point getImageSize() { - return new Point(imageButton[0].getImageData().width, - imageButton[0].getImageData().height); - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomProgressBar.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomProgressBar.java deleted file mode 100644 index 5601ed43bd..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomProgressBar.java +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Custom Progress Bar - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import java.util.logging.Logger; - -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Composite; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.log.SkinLogger; - -public class CustomProgressBar extends Canvas { - public static final RGB PROGRESS_COLOR_0 = new RGB(0, 174, 239); - public static final RGB PROGRESS_COLOR_1 = new RGB(179, 246, 0); - - private Logger logger = - SkinLogger.getSkinLogger(CustomProgressBar.class).getLogger(); - - private EmulatorSkin skin; - private Composite parent; - private boolean isDual; - private int[] selection; - private Color[] colorProgress; - - /** - * Constructor - */ - public CustomProgressBar(EmulatorSkin skin, int style, boolean isDual) { - super(skin.getShell(), style); - - this.skin = skin; - this.parent = skin.getShell(); - this.isDual = isDual; - this.selection = new int[2]; - this.selection[0] = this.selection[1] = 0; - - this.colorProgress = new Color[2]; - this.colorProgress[0] = new Color(parent.getDisplay(), PROGRESS_COLOR_0); - if (isDual == true) { - logger.info("dual progress bar is created"); - this.colorProgress[1] = new Color(parent.getDisplay(), PROGRESS_COLOR_1); - } else { - logger.info("single progress bar is created"); - } - - addProgressBarListener(); - - /* default is hidden */ - parent.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (isDisposed() == false) { - setVisible(false); - } - } - }); - } - - protected void addProgressBarListener() { - addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - if (isDual == true) { - /* draw layer1 */ - e.gc.setBackground(colorProgress[1]); - Rectangle bounds = getBounds(); - int width = (bounds.width * selection[1]) / 100; - e.gc.fillRectangle(0, 0, - Math.min(bounds.width, width), bounds.height); - } - - /* draw layer0 */ - e.gc.setBackground(colorProgress[0]); - Rectangle bounds = getBounds(); - int width = (bounds.width * selection[0]) / 100; - e.gc.fillRectangle(0, 0, - Math.min(bounds.width, width), bounds.height); - - if (selection[0] == 101 && - (isDual == false || selection[1] == 101)) { - logger.info("progress : complete!"); - - parent.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - dispose(); - } - }); - } - } - }); - - addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - logger.info("progress bar is disposed"); - - colorProgress[0].dispose(); - if (isDual == true) { - colorProgress[1].dispose(); - } - - skin.bootingProgress = null; - } - }); - } - - public void setSelection(int idxLayer, int value) { - if (isDisposed() == true) { - return; - } - - if (isVisible() == false) { - parent.getDisplay().syncExec(new Runnable() { - @Override - public void run() { - if (isDisposed() == false) { - setVisible(true); - } - } - }); - } - - if (idxLayer < 0 || isDual == false) { - idxLayer = 0; - } else if (idxLayer > 1) { - idxLayer = 1; - } - - if (value < 0) { - value = 0; - } else if (value > 100) { - value = 100; - } - - selection[idxLayer] = value; - logger.info("layer" + idxLayer + " progress : " + selection[idxLayer]); - - final int index = idxLayer; - parent.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - redraw(); - - if (selection[index] == 100) { - selection[index] = 101; - } - } - }); - } - - public int getSelection(int idxLayer) { - return selection[idxLayer]; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java deleted file mode 100644 index dcbd94288c..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Custom Scroll Bar - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import java.util.Timer; -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.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_INCREMENT_AMOUNT = 10; - static final int SCROLL_PAGE_INCREMENT_AMOUNT = 144; - - private Logger logger = SkinLogger.getSkinLogger( - CustomScrollBar.class).getLogger(); - - private Composite parent; - private Composite composite; - CustomScrolledComposite compositeScroll; - - private int heightScrollBar; - private int amountIncrement; - private int amountPageIncrement; - - private Image[] imagesArrowUp; - private Image[] imagesArrowDown; - private Image imageThumb; - private Image imageShaft; - - private CustomButton buttonArrowUp; - private CustomButton buttonArrowDown; - private Canvas canvasShaft; - private CustomScrollBarThumbData dataThumb; - private CustomScrollBarShaftData dataShaft; - - private int valueSelection; - private Timer timerScroller; - - 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) { - this.parent = parent; - this.composite = new Composite(parent, SWT.NONE); - this.compositeScroll = ((CustomScrolledComposite) parent.getParent()); - - RowLayout rowLayout = new RowLayout(SWT.VERTICAL); - rowLayout.marginLeft = rowLayout.marginRight = 0; - rowLayout.marginTop = rowLayout.marginBottom = 0; - rowLayout.marginWidth = rowLayout.marginHeight = 0; - rowLayout.spacing = 0; - - composite.setLayout(rowLayout); - - this.heightScrollBar = heightScrollBar; - this.amountIncrement = SCROLL_INCREMENT_AMOUNT; - this.amountPageIncrement = SCROLL_PAGE_INCREMENT_AMOUNT; - - this.imagesArrowUp = imagesArrowUp; - this.imagesArrowDown = imagesArrowDown; - this.imageThumb = imageThumb; - this.imageShaft = imageShaft; - - this.dataThumb = new CustomScrollBarThumbData(); - this.dataShaft = new CustomScrollBarShaftData(); - - this.timerScroller = null; - createContents(); - - addScrollBarListener(); - } - - protected void createContents() { - /* arrow up */ - buttonArrowUp = new CustomButton(composite, SWT.NONE, - imagesArrowUp[0], imagesArrowUp[1], imagesArrowUp[2]); - - int width = buttonArrowUp.getImageSize().x; - int height = buttonArrowUp.getImageSize().y; - - buttonArrowUp.setBackground(parent.getBackground()); - buttonArrowUp.setLayoutData(new RowData(width, height)); - - /* shaft */ - canvasShaft = new Canvas(composite, SWT.NONE); - canvasShaft.setBackground(parent.getBackground()); - - dataShaft.widthShaft = width; - dataShaft.heightShaft = heightScrollBar - (height * 2); - canvasShaft.setLayoutData(new RowData( - dataShaft.widthShaft, dataShaft.heightShaft)); - - canvasShaft.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - if (imageShaft != null) { - e.gc.drawImage(imageShaft, 0, 0, - imageShaft.getImageData().width, - imageShaft.getImageData().height, - 0, 0, dataShaft.widthShaft, dataShaft.heightShaft); - - /* draw a thumb */ - int heightScrollGap = compositeScroll.getMinHeight() - heightScrollBar; - - int tempHeightThumb = (compositeScroll.getMinHeight() - heightScrollGap) * - dataShaft.heightShaft / compositeScroll.getMinHeight(); - dataThumb.boundsThumb.height = Math.max(1, 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); - } - } - }); - - /* arrow down */ - buttonArrowDown = new CustomButton(composite, SWT.NONE, - imagesArrowDown[0], imagesArrowDown[1], imagesArrowDown[2]); - - buttonArrowDown.setBackground(parent.getBackground()); - buttonArrowDown.setLayoutData(new RowData(width, height)); - } - - 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) { - scrollUp(amountIncrement); - } - - @Override - public void mouseUp(MouseEvent e) { - if (timerScroller != null) { - timerScroller.cancel(); - timerScroller = null; - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }); - - buttonArrowUp.addDragDetectListener(new DragDetectListener() { - @Override - public void dragDetected(DragDetectEvent e) { - logger.info("ArrowUp dragDetected : " + e.button); - - if (timerScroller != null) { - timerScroller.cancel(); - } - - timerScroller = new Timer(); - timerScroller.schedule(new ScrollerTask(false), - 1, ScrollerTask.SCROLLER_PERIOD_TIME); - } - }); - - buttonArrowDown.addMouseListener(new MouseListener() { - @Override - public void mouseDown(MouseEvent e) { - scrollDown(amountIncrement); - } - - @Override - public void mouseUp(MouseEvent e) { - if (timerScroller != null) { - timerScroller.cancel(); - timerScroller = null; - } - } - - @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.cancel(); - } - - timerScroller = new Timer(); - timerScroller.schedule(new ScrollerTask(true), - 1, ScrollerTask.SCROLLER_PERIOD_TIME); - } - }); - - compositeScroll.addMouseWheelListener(new MouseWheelListener() { - @Override - 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; - - int yDraggedScale = yDragged * - (compositeScroll.getMinHeight() - heightScrollBar) / - (dataShaft.heightShaft - dataThumb.boundsThumb.height); - - setSelection(dataThumb.yGrabSelection + yDraggedScale); - updateScrollbar(); - } - } - }); - - canvasShaft.addMouseListener(new MouseListener() { - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - - @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() { - return valueSelection; - } - - public void setSelection(int selection) { - valueSelection = selection; - - if (valueSelection < 0) { - valueSelection = 0; - } else { - int maxScroll = compositeScroll.getMinHeight() - heightScrollBar; - valueSelection = Math.min(selection, maxScroll); - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrolledComposite.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrolledComposite.java deleted file mode 100644 index e4ecec73dd..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrolledComposite.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * Custom Scrolled Composite - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Listener; -import org.tizen.emulator.skin.log.SkinLogger; - -public class CustomScrolledComposite extends Composite { - - private Logger logger = - SkinLogger.getSkinLogger(CustomScrolledComposite.class).getLogger(); - - Control content; - Listener contentListener; - Listener filter; - Point sizeContent; - - Composite compositeRight; - CustomScrollBar vBar; - - private Image[] imagesArrowUp; - private Image[] imagesArrowDown; - private Image imageThumb; - private Image imageShaft; - - public int minHeight = 0; - public int minWidth = 0; - public boolean expandHorizontal = false; - public boolean expandVertical = false; - - /** - * Constructor - */ - public CustomScrolledComposite(Composite parent, int style, - Image[] imagesArrowUp, Image[] imagesArrowDown, - Image imageThumb, Image imageShaft) { - super(parent, style); - super.setLayout(new ScrolledCompositeLayout()); - - compositeRight = new Composite(this, SWT.NONE); - compositeRight.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_YELLOW)); - - GridLayout compositeGridLayout = new GridLayout(1, false); - compositeGridLayout.marginLeft = compositeGridLayout.marginRight = 0; - compositeGridLayout.marginTop = compositeGridLayout.marginBottom = 0; - compositeGridLayout.marginWidth = compositeGridLayout.marginHeight = 0; - compositeGridLayout.horizontalSpacing = compositeGridLayout.verticalSpacing = 0; - compositeRight.setLayout(compositeGridLayout); - - this.imagesArrowUp = imagesArrowUp; - this.imagesArrowDown = imagesArrowDown; - this.imageThumb = imageThumb; - this.imageShaft = imageShaft; - } - - public CustomScrollBar getScrollBar() { - return vBar; - } - - public void setContent(Control content, Point sizeContent) { - checkWidget(); - if (this.content != null && !this.content.isDisposed()) { - this.content.removeListener(SWT.Resize, contentListener); - this.content.setBounds(new Rectangle(-200, -200, 0, 0)); - } - - this.content = content; - this.sizeContent = sizeContent; - - if (this.content != null) { - if (vBar == null) { - compositeRight.setBackground(this.content.getBackground()); - vBar = new CustomScrollBar(compositeRight, SWT.NONE, sizeContent.y, - imagesArrowUp, imagesArrowDown, imageThumb, imageShaft); - } - - content.setLocation(0, 0); - - layout(false); - - } - } - - public void setExpandHorizontal(boolean expand) { - checkWidget(); - if (expand == expandHorizontal) return; - expandHorizontal = expand; - layout(false); - } - - public void setExpandVertical(boolean expand) { - checkWidget(); - if (expand == expandVertical) return; - expandVertical = expand; - layout(false); - } - - public void setMinSize(Point size) { - if (size == null) { - setMinSize(0, 0); - } else { - setMinSize(size.x, size.y); - } - } - - public void setMinSize(int width, int height) { - checkWidget(); - if (width == minWidth && height == minHeight) { - return; - } - - minWidth = Math.max(0, width); - minHeight = Math.max(0, height); - - logger.info("composite minWidth : " + minWidth + - ", minHeight : " + minHeight); - - layout(false); - } - - public int getMinWidth() { - checkWidget(); - return minWidth; - } - - public int getMinHeight() { - checkWidget(); - return minHeight; - } - - public void vScroll() { - if (content == null) { - return; - } - - Point location = content.getLocation(); - int vSelection = vBar.getSelection(); - - content.setLocation(location.x, -vSelection); - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrolledCompositeLayout.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrolledCompositeLayout.java deleted file mode 100644 index a1f64b79ba..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrolledCompositeLayout.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Custom Scrolled Composite Layout - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Layout; -import org.tizen.emulator.skin.log.SkinLogger; - -class ScrolledCompositeLayout extends Layout { - static final int DEFAULT_WIDTH = 64; - static final int DEFAULT_HEIGHT = 64; - - private Logger logger = SkinLogger.getSkinLogger( - ScrolledCompositeLayout.class).getLogger(); - - private boolean inLayout = false; - - protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { - CustomScrolledComposite sc = (CustomScrolledComposite)composite; - Point size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT); - - if (sc.content != null) { - Point preferredSize = sc.content.computeSize(wHint, hHint, flushCache); - size.x = preferredSize.x; - size.y = preferredSize.y; - } - size.x = Math.max(size.x, sc.minWidth); - size.y = Math.max(size.y, sc.minHeight); - - if (wHint != SWT.DEFAULT) size.x = wHint; - if (hHint != SWT.DEFAULT) size.y = hHint; - - return size; - } - - protected boolean flushCache(Control control) { - return true; - } - - protected void layout(Composite composite, boolean flushCache) { - if (inLayout) { - return; - } - - logger.info("layouting"); - - CustomScrolledComposite sc = (CustomScrolledComposite)composite; - if (sc.content == null) { - return; - } - - inLayout = true; - Rectangle contentRect = sc.content.getBounds(); - - Rectangle hostRect = sc.getClientArea(); - if (sc.expandHorizontal) { - contentRect.width = Math.max(sc.minWidth, hostRect.width); - } - if (sc.expandVertical) { - contentRect.height = Math.max(sc.minHeight, hostRect.height); - } - - sc.content.setBounds(contentRect); - - Point size = sc.compositeRight.computeSize(SWT.DEFAULT, SWT.DEFAULT); - sc.compositeRight.setBounds( - contentRect.width - size.x, 0, size.x, contentRect.height); - - inLayout = false; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java deleted file mode 100644 index b74c5dea4c..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * child window of skin - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.custom; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.log.SkinLogger; - -public class SkinWindow { - protected Logger logger = SkinLogger.getSkinLogger( - SkinWindow.class).getLogger(); - - protected Shell shell; - protected Shell parent; - private int dockPosition; - - public SkinWindow(Shell parent, int dockPosition) { - this.parent = parent; - this.dockPosition = dockPosition; - } - - public Shell getShell() { - return shell; - } - - public void open(int dockValue) { - if (shell.isDisposed()) { - return; - } - - dock(dockValue, true, true); - - shell.open(); - } - - public void dock(int dockValue, - boolean correction, boolean enableLogger) { - if (shell.isDisposed() == true) { - return; - } - - int x = 0; - int y = 0; - - Rectangle monitorBounds = Display.getDefault().getBounds(); - Rectangle parentBounds = parent.getBounds(); - Rectangle childBounds = shell.getBounds(); - - if (enableLogger == true) { - logger.info("host monitor display bounds : " + monitorBounds); - logger.info("current parent shell bounds : " + parentBounds); - logger.info("current child shell bounds : " + childBounds); - } - - dockPosition = dockValue; - - if (dockPosition == SWT.NONE){ - logger.info("undock"); - /* do nothing */ - - return; - } else if (dockPosition == (SWT.RIGHT | SWT.TOP)) { - x = parentBounds.x + parentBounds.width; - y = parentBounds.y; - - /* correction of location */ - /*if ((x + childBounds.width) > - (monitorBounds.x + monitorBounds.width)) { - x = parentBounds.x - childBounds.width; - }*/ - } else if (dockPosition == (SWT.RIGHT | SWT.BOTTOM)) { - x = parentBounds.x + parentBounds.width; - y = parentBounds.y + parentBounds.height - childBounds.height; - - /* correction of location */ - /*int shift = (monitorBounds.x + monitorBounds.width) - - (x + childBounds.width); - if (shift < 0) { - x += shift; - parent.setLocation(parentBounds.x + shift, parentBounds.y); - }*/ - } - 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); - } - - /* 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); - } - - public void redock(boolean correction, boolean enableLogger) { - dock(getDockPosition(), correction, enableLogger); - } - - public int getDockPosition() { - return dockPosition; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java deleted file mode 100644 index edcae8bfed..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java +++ /dev/null @@ -1,303 +0,0 @@ -/** - * About Dialog - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.dialog; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Link; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.image.ImageRegistry; -import org.tizen.emulator.skin.image.ImageRegistry.ResourceImageName; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.StringUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class AboutDialog extends SkinDialog { - public static final String ABOUT_DIALOG_TITLE = "About Emulator"; - public static final String SDK_NAME = "Tizen SDK"; - public static final String ABOUT_PROP_FILENAME = "about.properties"; - - public static final String PROP_KEY_VERSION = "version"; - public static final String PROP_KEY_BUILD_TIME = "build_time"; - public static final String PROP_KEY_GIT_VERSION = "build_git_commit"; - - public static final String URL_TIZEN_ORG = "https://developer.tizen.org"; - - private Logger logger = - SkinLogger.getSkinLogger(AboutDialog.class).getLogger(); - - private Image aboutImage; - private EmulatorConfig config; - private ImageRegistry imageRegistry; - - /** - * Constructor - */ - public AboutDialog(Shell parent, - EmulatorConfig config, ImageRegistry imageRegistry) { - super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL, ABOUT_DIALOG_TITLE); - - this.config = config; - this.imageRegistry = imageRegistry; - } - - private GridLayout getNopaddedGridLayout( - int numColumns, boolean makeColumnEqualWidth) { - GridLayout layout = new GridLayout(numColumns, makeColumnEqualWidth); - layout.marginLeft = layout.marginRight = 0; - layout.marginTop = layout.marginBottom = 0; - layout.marginWidth = layout.marginHeight = 0; - layout.horizontalSpacing = layout.verticalSpacing = 0; - - return layout; - } - - @Override - protected void createComposite() { - Composite parent = new Composite(shell, SWT.NONE); - parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - GridLayout gridLayout = getNopaddedGridLayout(1, true); - parent.setLayout(gridLayout); - - Composite area = createArea(parent); - if (null == area) { - return; - } - - /* bottom side */ - buttonComposite = new Composite(parent, SWT.NONE); - buttonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, true, true)); - buttonComposite.setLayout(new GridLayout(1, false)); - - createButtons(buttonComposite); - } - - @Override - protected Composite createArea(Composite parent) { - Composite composite = displayInfo(parent); - return composite; - } - - private Composite displayInfo(Composite parent) { - Composite compositeBase = new Composite(parent, SWT.BORDER); - compositeBase.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - compositeBase.setLayout(getNopaddedGridLayout(2, false)); - Color white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); - compositeBase.setBackground(white); - - /* left side */ - Composite compositeLeft = new Composite(compositeBase, SWT.NONE); - compositeLeft.setLayout(getNopaddedGridLayout(1, false)); - - Label imageLabel = new Label(compositeLeft, SWT.NONE); - aboutImage = imageRegistry.getResourceImage(ResourceImageName.RESOURCE_ABOUT); - imageLabel.setImage(aboutImage); - - /* right side */ - Composite compositeRight = new Composite(compositeBase, SWT.NONE); - compositeRight.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); - GridLayout layout = getNopaddedGridLayout(1, true); - layout.marginLeft = layout.marginRight = 6; - compositeRight.setLayout(layout); - compositeRight.setBackground(white); - - /* SDK name */ - Label titleLabel = new Label(compositeRight, SWT.NONE); - /*GridData gridData = new GridData(); - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.CENTER; - titleLabel.setLayoutData(gridData);*/ - titleLabel.setText("\n" + SDK_NAME + "\n"); - /*Font systemFont = shell.getDisplay().getSystemFont(); - FontData[] fontData = systemFont.getFontData(); - fontData[0].setStyle(SWT.BOLD); - fontData[0].setHeight(16); - Font font = new Font(shell.getDisplay(), fontData[0]); - titleLabel.setFont(font); - font.dispose();*/ - titleLabel.setBackground(white); - - if (SwtUtil.isWindowsPlatform()) { - Label space = new Label(compositeRight, SWT.NONE); - space.setText("\n"); - } - - Properties properties = getProperties(); - - /* SDK version */ - Text versionText = new Text(compositeRight, SWT.NONE); - String version = config.getSkinProperty( - EmulatorConfig.SkinInfoConstants.SDK_VERSION_NAME); - - versionText.setText("Version : " + version); - versionText.setEditable(false); - versionText.setBackground(white); - - /* build id */ - Text buildText = new Text(compositeRight, SWT.NONE); - String time = getValue(properties, PROP_KEY_BUILD_TIME); - if (time.isEmpty()) { - time = "Not identified"; - } - buildText.setText("Build id : " + time); - buildText.setEditable(false); - buildText.setBackground(white); - - /*Text gitText = new Text(compositeRight, SWT.NONE); - String gitVersion = getValue(properties, PROP_KEY_GIT_VERSION); - gitText.setText("Git version" + " : " + gitVersion); - gitText.setEditable(false); - gitText.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));*/ - - /* link to URL */ - Link visit = new Link(compositeRight, SWT.NONE); - visit.setText("\n\n Visit <a>" + URL_TIZEN_ORG + "</a>"); - visit.setBackground(white); - visit.addSelectionListener(new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent arg0) { - /* do nothing */ - } - - @Override - public void widgetSelected(SelectionEvent arg0) { - try { - Program.launch(URL_TIZEN_ORG); - } catch (Throwable e) { - e.printStackTrace(); - return; - } - } - - }); - - return compositeBase; - } - - private String getValue(Properties properties, String key) { - if (null != properties) { - - String property = properties.getProperty(key); - - if (!StringUtil.isEmpty(property)) { - if (!property.contains(key)) { - return property; - } else { - // ex) '${build_git_commit}' is default - // expression in build.xml - return "Not identified"; - } - - } else { - return "Not identified"; - } - - } else { - return "Not identified"; - } - } - - @Override - protected void createButtons(Composite parent) { - super.createButtons(parent); - - Composite composite = new Composite(parent, SWT.NONE); - FillLayout fillLayout = new FillLayout(SWT.HORIZONTAL); - composite.setLayout(fillLayout); - - /* - Button licenseButton = createButton(composite, "License"); - - licenseButton.addSelectionListener(new SelectionAdapter() { - private boolean isOpen; - - @Override - public void widgetSelected(SelectionEvent e) { - if (!isOpen) { - isOpen = true; - LicenseDialog licenseDialog = new LicenseDialog(shell, "License"); - licenseDialog.open(); - isOpen = false; - } - } - }); - */ - - createOKButton(composite, true); - } - - private Properties getProperties() { - InputStream is = null; - Properties properties = null; - - try { - is = this.getClass().getClassLoader().getResourceAsStream(ABOUT_PROP_FILENAME); - if (null == is) { - logger.severe("about properties file is null."); - return null; - } - - properties = new Properties(); - properties.load(is); - - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return null; - } finally { - IOUtil.close(is); - } - - return properties; - } - - @Override - protected void close() { - logger.info("close the about dialog"); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java deleted file mode 100644 index 98a4ffad2e..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java +++ /dev/null @@ -1,457 +0,0 @@ -/** - * Detailed Information Of VM - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.dialog; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map.Entry; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator.DataTranfer; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.info.SkinInformation; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.StringUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -/** - * - * - */ -public class DetailInfoDialog extends SkinDialog { - private final static String DETAIL_INFO_DIALOG_TITLE = "Detail Info"; - - private final static String TABLE_COLUMN_NAME_0 = "Feature"; - private final static String TABLE_COLUMN_NAME_1 = "Value"; - - private final static String DATA_DELIMITER = "#"; - private final static String QEMU_PARAMETER_APPEND = "-append"; - private final static String QEMU_PARAMETER_KVM = "-enable-kvm"; - private final static String QEMU_PARAMETER_HAX = "-enable-hax"; - private final static String QEMU_PARAMETER_VIRTFS = "-virtfs"; - private final static String QEMU_PARAMETER_YAGL = "-enable-yagl"; - private final static String QEMU_PARAMETER_RAM = "-m"; - private final static String QEMU_PARAMETER_DRIVE = "-drive"; - - private final static String KEY_VM_NAME = "VM Name"; - private final static String KEY_SKIN_NAME = "Skin Name"; - private final static String KEY_CPU_ARCH = "CPU Arch"; - private final static String KEY_RAM_SIZE = "RAM Size"; - private final static String KEY_DISPLAY_RESOLUTION = "Display Resolution"; - private final static String KEY_DISPLAY_DENSITY = "Display Density"; - private final static String KEY_FILESHARING = "Directory Sharing"; - private final static String KEY_FILESHARED_PATH = "File Shared Path"; - private final static String KEY_CPU_VIRTUALIZATION = "CPU Virtualization"; - private final static String KEY_GPU_VIRTUALIZATION = "GPU Virtualization"; - private final static String KEY_IMAGE_PATH = "Image Path"; - private final static String KEY_LOG_PATH = "Log Path"; - - private final static String VALUE_NONE = "None"; - private final static String VALUE_SUPPORTED = "Supported"; - private final static String VALUE_NOTSUPPORTED = "Not Supported"; - private final static String VALUE_ENABLED = "Enabled"; - private final static String VALUE_DISABLED = "Disabled"; - - private Logger logger = - SkinLogger.getSkinLogger(DetailInfoDialog.class).getLogger(); - - private SocketCommunicator communicator; - private EmulatorConfig config; - private SkinInformation skinInfo; - private Table table; - private LinkedHashMap<String, String> refinedData; - - /** - * Constructor - */ - public DetailInfoDialog(Shell parent, SocketCommunicator communicator, - EmulatorConfig config, SkinInformation skinInfo) { - super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.MAX, - DETAIL_INFO_DIALOG_TITLE + " - " + SkinUtil.makeEmulatorName(config)); - - this.communicator = communicator; - this.config = config; - this.skinInfo = skinInfo; - } - - @Override - protected Composite createArea(Composite parent) { - String infoData = queryData(); - if (StringUtil.isEmpty(infoData)) { - return null; - } - - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new FillLayout()); - - table = new Table(composite, - SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableColumn[] column = new TableColumn[2]; - - column[0] = new TableColumn(table, SWT.LEFT); - column[0].setText(TABLE_COLUMN_NAME_0); - - column[1] = new TableColumn(table, SWT.LEFT); - column[1].setText(TABLE_COLUMN_NAME_1); - - int index = 0; - - refinedData = composeAndParseData(infoData); - Iterator<Entry<String, String>> iterator = - refinedData.entrySet().iterator(); - - while (iterator.hasNext()) { - Entry<String, String> entry = iterator.next(); - - TableItem tableItem = new TableItem(table, SWT.NONE, index); - tableItem.setText(new String[] { entry.getKey(), entry.getValue() }); - index++; - } - - column[0].pack(); - column[1].pack(); - table.pack(); - - /* browse the appropriate path when item is double clicked */ - table.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - /* do nothing */ - } - - @Override - public void widgetDefaultSelected(SelectionEvent event) { - if (table.getSelectionCount() > 1) { - return; - } - - TableItem tableItem = table.getItem(table.getSelectionIndex()); - String openPath = VALUE_NONE; - - if (tableItem.getText(0).compareTo(KEY_FILESHARED_PATH) == 0 - || tableItem.getText(0).compareTo(KEY_LOG_PATH) == 0 - || tableItem.getText(0).startsWith(KEY_IMAGE_PATH) == true) { - openPath = tableItem.getText(1); - } else { - return; - } - - if (openPath == null || openPath.compareTo(VALUE_NONE) == 0 || - openPath.compareTo("") == 0) { - return; - } - - try { - logger.info("open " + openPath); - openPath = StringUtil.getCanonicalPath(openPath); - } catch (IOException e) { - logger.warning("Invalid path"); - } - - Program.launch(openPath); - - /*ProcessBuilder procBrowser = new ProcessBuilder(); - - if (SwtUtil.isLinuxPlatform()) { - procBrowser.command("nautilus", "--browser", openPath); - } else if (SwtUtil.isWindowsPlatform()) { - procBrowser.command("explorer", "\"" + openPath + "\""); - } else if (SwtUtil.isMacPlatform()) { - logger.warning("not supported yet"); - } - - if (procBrowser.command().isEmpty() == false) { - try { - procBrowser.start(); - } catch (Exception e) { - logger.log( Level.SEVERE, e.getMessage(), e); - } - }*/ - - } - }); - - return composite; - } - - @Override - protected void setShellSize() { - /* if (SwtUtil.isLinuxPlatform()) { - shell.setSize((int) (402 * 1.618), 402); - } else { - shell.setSize((int) (372 * 1.618), 372); - } */ - - shell.pack(); - } - - private String queryData() { - String infoData = null; - - DataTranfer dataTranfer = - communicator.sendDataToQEMU(SendCommand.SEND_DETAIL_INFO_REQ, null, true); - byte[] receivedData = communicator.getReceivedData(dataTranfer); - - if (null != receivedData) { - try { - infoData = new String(receivedData, "UTF-8"); - } catch (UnsupportedEncodingException e) { - logger.warning("unsupported encoding exception"); - infoData = null; - } - } else { - logger.severe("Fail to get detail info"); - SkinUtil.openMessage(shell, null, - "Fail to get detail info", SWT.ICON_ERROR, config); - } - - return infoData; - } - - private LinkedHashMap<String, String> composeAndParseData(String infoData) { - logger.info("Received infoData : {" + infoData + "}"); - - String cpu = "x86"; - String ramSize = ""; - String dpi = ""; - List<String> imagePathList = new ArrayList<String>(); - String sharedPath = ""; - boolean isCpuVirtual = false; - boolean isGpuVirtual = false; - String cpuVirtualCompare = ""; - String logPath = ""; - boolean isHaxError = false; - - if (SwtUtil.isLinuxPlatform() == true) { - cpuVirtualCompare = QEMU_PARAMETER_KVM; - } else { - cpuVirtualCompare = QEMU_PARAMETER_HAX; - } - - String[] split = infoData.split(DATA_DELIMITER); - - for (int i = 0; i < split.length; i++) { - if (0 == i) { /* emulator binary name */ - String exec = split[i].trim().toLowerCase(); - logger.info("binary name:" + exec); - } else { /* qemu arguments */ - if (i + 1 <= split.length) { - String arg = split[i].trim(); - - if (QEMU_PARAMETER_RAM.equals(arg)) - { - ramSize = split[i + 1].trim(); - } - else if (QEMU_PARAMETER_DRIVE.equals(arg)) - { - /* arg : file=/path/emulimg.x86,... */ - arg = split[i + 1].trim(); - - if (arg.startsWith("file=")) { - String[] sp = arg.split(","); - String[] sp2 = sp[0].split("="); - String drivePath = sp2[sp2.length - 1]; - - imagePathList.add(drivePath); - } - } - else if (QEMU_PARAMETER_VIRTFS.equals(arg)) - { - /* arg : local,path=/path,... */ - arg = split[i + 1].trim(); - String[] sp = arg.split(","); - - if (1 < sp.length) { - int spIndex = sp[1].indexOf("="); - sharedPath = sp[1].substring(spIndex + 1, sp[1].length()); - } - } - else if (QEMU_PARAMETER_APPEND.equals(arg)) /* kernel parameters */ - { - arg = split[i + 1].trim(); - String[] splitSub = arg.split(" "); - - for (int j = 0; j < splitSub.length; j++) { - String parameterKernel = splitSub[j].trim(); - - if (parameterKernel.startsWith("dpi=")) { - String[] sp = parameterKernel.split("="); - if (1 < sp.length) { - dpi = Integer.toString( - Integer.parseInt(sp[1]) / 10); - } - } - } - } - else if (cpuVirtualCompare.equals(arg)) - { - isCpuVirtual = true; - } - else if (QEMU_PARAMETER_YAGL.equals(arg)) - { - isGpuVirtual = true; - } - else if (arg.startsWith("hax_error=")) - { - String[] sp = arg.split("="); - if (1 < sp.length) { - isHaxError = Boolean.parseBoolean(sp[1]); - } - } - else if (arg.startsWith("log_path=")) - { - String[] sp = arg.split("="); - if (1 < sp.length) { - logPath = sp[1]; - - try { - logPath = StringUtil.getCanonicalPath(logPath); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - - logger.info("log path = " + logPath); /* without filename */ - } - } - - } - } - } - - LinkedHashMap<String, String> result = - new LinkedHashMap<String, String>(); - - /* VM name */ - result.put(KEY_VM_NAME, SkinUtil.getVmName(config)); - - /* Skin name */ - result.put(KEY_SKIN_NAME, skinInfo.getSkinName()); - - /* CPU srchitecture */ - result.put(KEY_CPU_ARCH, cpu); - - /* RAM size */ - result.put(KEY_RAM_SIZE, ramSize); - - /* Target display resolution */ - int width = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH); - int height = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT); - result.put(KEY_DISPLAY_RESOLUTION, width + " x " + height); - - /* DPI (dots per inch) */ - result.put(KEY_DISPLAY_DENSITY, dpi); - - /* Whether host file sharing is supported */ - if (StringUtil.isEmpty(sharedPath)) { - result.put(KEY_FILESHARING, VALUE_NOTSUPPORTED); - result.put(KEY_FILESHARED_PATH, VALUE_NONE); - } else { - result.put(KEY_FILESHARING, VALUE_SUPPORTED); - result.put(KEY_FILESHARED_PATH, sharedPath); - } - - /* Whether hardware virtualization is supported */ - if (isCpuVirtual == true) { - if (isHaxError == true) { - result.put(KEY_CPU_VIRTUALIZATION, - "Disable(insufficient memory for driver)"); - } else { - result.put(KEY_CPU_VIRTUALIZATION, VALUE_ENABLED); - } - } else { - result.put(KEY_CPU_VIRTUALIZATION, VALUE_DISABLED); - } - - if (isGpuVirtual == true) { - result.put(KEY_GPU_VIRTUALIZATION, VALUE_ENABLED); - } else { - result.put(KEY_GPU_VIRTUALIZATION, VALUE_DISABLED); - } - - /* platform image path */ - int nPath = imagePathList.size(); - if (nPath == 0) { - result.put(KEY_IMAGE_PATH, VALUE_NONE); - } else if (nPath == 1) { - result.put(KEY_IMAGE_PATH, imagePathList.get(0)); - } else { - for (int i = 0; i < nPath; i ++) { - result.put(KEY_IMAGE_PATH + " " + (i + 1), imagePathList.get(i)); - } - } - - /* emulator log path */ - if (StringUtil.isEmpty(logPath)) { - result.put(KEY_LOG_PATH, VALUE_NONE); - } else { - result.put(KEY_LOG_PATH, logPath); - } - - return result; - } - - @Override - protected void createButtons(Composite parent) { - super.createButtons(parent); - - Composite composite = new Composite(parent, SWT.NONE); - FillLayout fillLayout = new FillLayout(SWT.HORIZONTAL); - composite.setLayout(fillLayout); - - createOKButton(composite, true); - }; - - @Override - protected void close() { - logger.info("close the detail info dialog"); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/LicenseDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/LicenseDialog.java deleted file mode 100644 index 9baa0511ce..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/LicenseDialog.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * License Dialog - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.dialog; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.StringUtil; - -/** - * - * - */ -public class LicenseDialog extends SkinDialog { - public static final String LICENSE_FILE_PATH = "../license/Open_Source_Announcement.txt"; - - private Logger logger = - SkinLogger.getSkinLogger(LicenseDialog.class).getLogger(); - - /** - * Constructor - */ - public LicenseDialog(Shell parent, String title) { - super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.MAX, title); - } - - @Override - protected Composite createArea(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout()); - - final Text text = new Text(composite, - SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI); - GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); - text.setLayoutData(gridData); - - text.setEditable(false); - text.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_WHITE)); - String license = StringUtil.nvl(getLicense()); - text.setText(license); - - return composite; - } - - @Override - protected void setShellSize() { - shell.setSize((int) (400 * 1.618/* golden ratio */), 400); - } - - @Override - protected void createButtons(Composite parent) { - super.createButtons(parent); - - Button okButton = createButton(parent, OK); - - GridData gd = new GridData(); - gd.grabExcessHorizontalSpace = true; - gd.horizontalAlignment = SWT.RIGHT; - okButton.setLayoutData(gd); - - okButton.setFocus(); - - okButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - shell.close(); - } - }); - } - - private String getLicense() { - FileInputStream fis = null; - String string = ""; - - try { - fis = new FileInputStream(LICENSE_FILE_PATH); - - try { - byte[] bytes = IOUtil.getBytes(fis); - string = new String(bytes, "UTF-8"); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - string = "File control error."; - } - } catch (FileNotFoundException e) { - string = "There is no license info."; - } finally { - IOUtil.close(fis); - } - - return string; - } - - @Override - protected void close() { - logger.info("close the license dialog"); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/RamdumpDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/RamdumpDialog.java deleted file mode 100644 index 78fcd96455..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/RamdumpDialog.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * Ramdump Dialog - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.dialog; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.SWTException; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.ImageLoader; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SkinUtil; - -public class RamdumpDialog extends SkinDialog { - public static final String RAMDUMP_DIALOG_TITLE = "Ram Dump"; - public static final String INDICATOR_IMAGE_PATH = "images/process.gif"; - - private Logger logger = - SkinLogger.getSkinLogger(RamdumpDialog.class).getLogger(); - - private SocketCommunicator communicator; - private Composite compositeBase; - private ImageData[] frames; - - /** - * Constructor - */ - public RamdumpDialog(Shell parent, - SocketCommunicator communicator, EmulatorConfig config) throws IOException { - super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL, - RAMDUMP_DIALOG_TITLE + " - " + SkinUtil.makeEmulatorName(config), false); - - this.communicator = communicator; - } - - @Override - protected Composite createArea(Composite parent) { - Composite composite; - - try { - composite = createContents(parent); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return null; - } - - shell.addListener(SWT.Close, new Listener() { - @Override - public void handleEvent(Event event) { - if (communicator.getRamdumpFlag() == true) { - /* do nothing */ - logger.info("do nothing"); - - event.doit = false; - } - } - }); - - return composite; - } - - private Composite createContents(Composite parent) throws IOException { - compositeBase = new Composite(parent, SWT.NONE); - compositeBase.setLayout(new GridLayout(2, false)); - - final Display display = Display.getDefault(); - - ClassLoader classLoader = this.getClass().getClassLoader(); - ImageLoader loader = new ImageLoader(); - - try { - frames = loader.load( - classLoader.getResourceAsStream(INDICATOR_IMAGE_PATH)); - } catch (Exception e) { - frames = null; - } - - final Label labelImage = new Label(compositeBase, SWT.NONE); - if (frames != null) { - labelImage.setImage(new Image(display, frames[0])); - } - - Label waitMsg = new Label(compositeBase, SWT.NONE); - waitMsg.setText(" Please wait..."); - - Thread animation = new Thread() { - int currentFrame = 0; - boolean isDisposed = false; - - @Override - public void run() { - while (!isDisposed) { - try { - if (frames != null) { - sleep(50); - } else { - sleep(500); - } - } catch (InterruptedException e) { - logger.warning("InterruptedException"); - } - - if (frames != null) { - currentFrame = (currentFrame + 1) % frames.length; - } - if (display.isDisposed()) { - return; - } - - if (frames != null) { - display.asyncExec(new Runnable() { - @Override - public void run() { - try { - Image newImage = - new Image(display, frames[currentFrame]); - labelImage.getImage().dispose(); - labelImage.setImage(newImage); - } catch (SWTException e) { - isDisposed = true; - } - } - }); /* end of asyncExec */ - } - - if (communicator.getRamdumpFlag() == false) { - isDisposed = true; - } - } - - display.syncExec(new Runnable() { - @Override - public void run() { - logger.info("ramdump complete"); - - if (shell.isDisposed() == true) { - return; - } - - if (labelImage.getImage() != null) { - labelImage.getImage().dispose(); - } - shell.setCursor(null); - shell.close(); - } - }); - } - }; - - shell.setCursor(display.getSystemCursor(SWT.CURSOR_WAIT)); - animation.start(); - - return compositeBase; - } - - @Override - protected void setShellSize() { - shell.setSize(280, 140); - - /* align */ - Rectangle boundsClient = shell.getClientArea(); - Rectangle boundsBase = compositeBase.getBounds(); - - compositeBase.setBounds( - (boundsClient.x + (boundsClient.width / 2)) - (boundsBase.width / 2), - (boundsClient.y + (boundsClient.height / 2)) - (boundsBase.height / 2), - boundsBase.width, boundsBase.height); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java deleted file mode 100644 index 9d5ab417ff..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * Skin Dialog - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.dialog; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Dialog; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.StringUtil; - -/** - * - * - */ -public abstract class SkinDialog extends Dialog { - public static final String OK = " " + "OK" + " "; - - private Logger logger = - SkinLogger.getSkinLogger(SkinDialog.class).getLogger(); - - protected Shell shell; - protected Composite buttonComposite; - private Shell parent; - private int style; - private String title; - private boolean hasButton; - - /** - * Constructor - */ - public SkinDialog(Shell parent, int style, String title) { - super(parent, style); - - this.parent = parent; - this.style = style; - this.title = title; - this.hasButton = true; - } - - public SkinDialog(Shell parent, int style, String title, boolean hasButton) { - super(parent, style); - - this.parent = parent; - this.style = style; - this.title = title; - this.hasButton = hasButton; - } - - protected void createComposite() { - Composite parent = new Composite(shell, SWT.NONE); - parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - GridLayout gridLayout = new GridLayout(1, true); - gridLayout.marginWidth = 20; - parent.setLayout(gridLayout); - - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - composite.setLayout(new FillLayout(SWT.VERTICAL)); - - Composite area = createArea(composite); - if (null == area) { - return; - } - - if (hasButton == true) { - /* bottom side */ - buttonComposite = new Composite(parent, SWT.NONE); - buttonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, true, true)); - buttonComposite.setLayout(new GridLayout(1, false)); - - createButtons(buttonComposite); - } - } - - public void open() { - shell = new Shell(parent, style); - shell.setText(title); - shell.setImage(parent.getImage()); - - shell.setLayout(new GridLayout(1, true)); - - createComposite(); - - shell.pack(); - - setShellSize(); - - if (parent != null) { - Point central = new Point( - this.parent.getLocation().x + (this.parent.getSize().x / 2), - this.parent.getLocation().y + (this.parent.getSize().y / 2)); - - int width = shell.getSize().x; - int height = shell.getSize().y; - int x = central.x - (width / 2); - int y = central.y - (height / 2); - - Rectangle monitorBounds = Display.getDefault().getBounds(); - - if (x < monitorBounds.x) { - x = monitorBounds.x; - } else if ((x + width) > (monitorBounds.x + monitorBounds.width)) { - x = (monitorBounds.x + monitorBounds.width) - width; - } - - if (y < monitorBounds.y) { - y = monitorBounds.y; - } else if ((y + height) > (monitorBounds.y + monitorBounds.height)) { - y = (monitorBounds.y + monitorBounds.height) - height; - } - - shell.setLocation(x, y); - } - - shell.open(); - - while (!shell.isDisposed()) { - if (!shell.getDisplay().readAndDispatch()) { - shell.getDisplay().sleep(); - } - } - - close(); - } - - protected void close() { - logger.info("closed"); - - /* do nothing */ - } - - protected void setShellSize() { - /* do nothing */ - } - - protected abstract Composite createArea(Composite parent); - - protected void createButtons(Composite parent) { - if (null == parent) { - throw new IllegalArgumentException("button composite is null"); - } - } - - protected Button createButton(Composite parent, String text) { - if (null == parent) { - throw new IllegalArgumentException("button composite is null"); - } - - Composite composite = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(1, true); - composite.setLayout(gridLayout); - - Button button = new Button(composite, SWT.PUSH); - GridData gd = new GridData(); - gd.grabExcessHorizontalSpace = true; - gd.horizontalAlignment = SWT.FILL; - - button.setLayoutData(gd); - button.setText(StringUtil.nvl(text)); - - return button; - } - - protected Button createOKButton(Composite parent, boolean setFocus) { - logger.info("create OK button"); - - Button okButton = createButton(parent, OK); - okButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - shell.close(); - } - }); - - if (setFocus) { - okButton.setFocus(); - } - - return okButton; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/ConfigException.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/ConfigException.java deleted file mode 100644 index d8055037b6..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/ConfigException.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.exception; - -/** - * - * - */ -public class ConfigException extends EmulatorException { - - private static final long serialVersionUID = -1363305002416148505L; - - public ConfigException() { - super(); - } - - public ConfigException( Throwable cause ) { - super( cause ); - } - - public ConfigException( String message ) { - super( message ); - } - - public ConfigException( String message, Throwable cause ) { - super( message, cause ); - } - -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/EmulatorException.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/EmulatorException.java deleted file mode 100644 index f0161b1aee..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/EmulatorException.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.exception; - -/** - * - * - */ -public class EmulatorException extends Exception { - - private static final long serialVersionUID = 7942446691090874775L; - - public EmulatorException() { - super(); - } - - public EmulatorException( Throwable cause ) { - super( cause ); - } - - public EmulatorException( String message ) { - super( message ); - } - - public EmulatorException( String message, Throwable cause ) { - super( message, cause ); - } - -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/JaxbException.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/JaxbException.java deleted file mode 100644 index e28a9cb2b0..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/JaxbException.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.exception; - -/** - * - * - */ -public class JaxbException extends EmulatorException { - - private static final long serialVersionUID = -8268951410660907299L; - - public JaxbException() { - super(); - } - - public JaxbException( Throwable cause ) { - super( cause ); - } - - public JaxbException( String message ) { - super( message ); - } - - public JaxbException( String message, Throwable cause ) { - super( message, cause ); - } - -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/ScreenShotException.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/ScreenShotException.java deleted file mode 100644 index 1e87fda783..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/exception/ScreenShotException.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.exception; - -/** - * - * - */ -public class ScreenShotException extends EmulatorException { - - private static final long serialVersionUID = 7527776121326217994L; - - public ScreenShotException() { - super(); - } - - public ScreenShotException( Throwable cause ) { - super( cause ); - } - - public ScreenShotException( String message ) { - super( message ); - } - - public ScreenShotException( String message, Throwable cause ) { - super( message, cause ); - } - -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/GeneralKeyWindowImageRegistry.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/GeneralKeyWindowImageRegistry.java deleted file mode 100644 index 5c5b4f26da..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/GeneralKeyWindowImageRegistry.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Image Resource Management For General Key Window - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.image; - -import java.io.InputStream; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; - -public class GeneralKeyWindowImageRegistry { - public static final String KEYWINDOW_FOLDER = "key-window"; - - private static Logger logger = SkinLogger.getSkinLogger( - GeneralKeyWindowImageRegistry.class).getLogger(); - - public enum GeneralKeyWindowImageName { - KEYWINDOW_PATCH_LT("LT.png"), - KEYWINDOW_PATCH_T("T.png"), - KEYWINDOW_PATCH_RT("RT.png"), - KEYWINDOW_PATCH_L("L.png"), - KEYWINDOW_PATCH_R("R.png"), - KEYWINDOW_PATCH_LB("LB.png"), - KEYWINDOW_PATCH_B("B.png"), - KEYWINDOW_PATCH_RB("RB.png"), - - KEYBUTTON_NORMAL("keybutton_nml.png"), - KEYBUTTON_HOVER("keybutton_hover.png"), - KEYBUTTON_PUSHED("keybutton_pushed.png"), - - SCROLL_UPBUTTON_NORMAL("scroll_button_up_nml.png"), - SCROLL_UPBUTTON_HOVER("scroll_button_up_hover.png"), - SCROLL_UPBUTTON_PUSHED("scroll_button_up_pushed.png"), - SCROLL_DOWNBUTTON_NORMAL("scroll_button_down_nml.png"), - SCROLL_DOWNBUTTON_HOVER("scroll_button_down_hover.png"), - SCROLL_DOWNBUTTON_PUSHED("scroll_button_down_pushed.png"), - SCROLL_THUMB("scroll_thumb.png"), - SCROLL_SHAFT("scroll_back.png"); - - private String name; - - private GeneralKeyWindowImageName(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - } - - private Display display; - private Map<String, Image> keyWindowImageMap; - - /** - * Constructor - */ - public GeneralKeyWindowImageRegistry(Display display) { - this.display = display; - this.keyWindowImageMap = new HashMap<String, Image>(); - } - - public Image getKeyWindowImage(GeneralKeyWindowImageName name) { - if (keyWindowImageMap.size() == 0) { - /* load all of the images at once */ - ClassLoader classLoader = this.getClass().getClassLoader(); - InputStream is = null; - String imageName, imagePath; - - GeneralKeyWindowImageName[] values = GeneralKeyWindowImageName.values(); - for (GeneralKeyWindowImageName value : values) { - imageName = value.getName(); - imagePath = ImageRegistry.IMAGES_FOLDER + "/" - + KEYWINDOW_FOLDER + "/" + imageName; - - try { - is = classLoader.getResourceAsStream(imagePath); - if (null != is) { - logger.fine("KeyWindow image is loaded : " + imagePath); - keyWindowImageMap.put(imageName, new Image(display, is)); - } else { - logger.severe("missing image : " + imagePath); - } - } finally { - IOUtil.close(is); - } - } - } - - return keyWindowImageMap.get(name.getName()); - } - - public void dispose() { - logger.info("dispose"); - - if (null != keyWindowImageMap) { - Image image = null; - - Collection<Image> images = keyWindowImageMap.values(); - Iterator<Image> imageIterator = images.iterator(); - - while (imageIterator.hasNext()) { - image = imageIterator.next(); - if (image != null) { - image.dispose(); - } - } - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/GeneralSkinImageRegistry.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/GeneralSkinImageRegistry.java deleted file mode 100644 index 5248adf79d..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/GeneralSkinImageRegistry.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Image Resource Management For General-Purpose Skin - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.image; - -import java.io.InputStream; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; - -public class GeneralSkinImageRegistry { - private static final String PATCH_IMAGES_PATH = "emul-window"; - - private static Logger logger = SkinLogger.getSkinLogger( - GeneralSkinImageRegistry.class).getLogger(); - - public enum GeneralSkinImageName { - SKIN_PATCH_LT("LT.png"), - SKIN_PATCH_T("T.png"), - SKIN_PATCH_RT("RT.png"), - SKIN_PATCH_L("L.png"), - SKIN_PATCH_R("R.png"), - SKIN_PATCH_LB("LB.png"), - SKIN_PATCH_B("B.png"), - SKIN_PATCH_RB("RB.png"), - - TOGGLE_BUTTON_NORMAL("arrow_nml.png"), - TOGGLE_BUTTON_HOVER("arrow_hover.png"), - TOGGLE_BUTTON_PUSHED("arrow_pushed.png"); - - private String name; - - private GeneralSkinImageName(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - } - - private Display display; - private Map<String, Image> skinImageMap; - - /** - * Constructor - */ - public GeneralSkinImageRegistry(Display display) { - this.display = display; - this.skinImageMap = new HashMap<String, Image>(); - } - - public Image getSkinImage(GeneralSkinImageName name) { - if (skinImageMap.size() == 0) { - /* load all of the images at once */ - ClassLoader classLoader = this.getClass().getClassLoader(); - InputStream is = null; - String imageName, imagePath; - - GeneralSkinImageName[] values = GeneralSkinImageName.values(); - for (GeneralSkinImageName value : values) { - imageName = value.getName(); - imagePath = ImageRegistry.IMAGES_FOLDER + "/" - + PATCH_IMAGES_PATH + "/" + imageName; - - try { - is = classLoader.getResourceAsStream(imagePath); - if (null != is) { - logger.fine("KeyWindow image is loaded : " + imagePath); - skinImageMap.put(imageName, new Image(display, is)); - } else { - logger.severe("missing image : " + imagePath); - } - } finally { - IOUtil.close(is); - } - } - } - - return skinImageMap.get(name.getName()); - } - - public void dispose() { - logger.info("dispose"); - - if (null != skinImageMap) { - Image image = null; - - Collection<Image> images = skinImageMap.values(); - Iterator<Image> imageIterator = images.iterator(); - - while (imageIterator.hasNext()) { - image = imageIterator.next(); - if (image != null) { - image.dispose(); - } - } - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java deleted file mode 100644 index fdcda07879..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Image Resource Management - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.image; - -import java.io.InputStream; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; - - -/** - * - * - */ -public class ImageRegistry { - public static final String ICONS_FOLDER = "icons"; - public static final String IMAGES_FOLDER = "images"; - - private static Logger logger = - SkinLogger.getSkinLogger(ImageRegistry.class).getLogger(); - - public enum ResourceImageName { - RESOURCE_ABOUT("about_Tizen_SDK.png"), - RESOURCE_BLANK_GUIDE("display_off_guide.png"); - - private String name; - - private ResourceImageName(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - } - - public enum IconName { - DETAIL_INFO("detail_info.png"), - ROTATE("rotate.png"), - SCALE("scale.png"), - SHELL("shell.png"), - ECP("ecp.png"), - ADVANCED("advanced.png"), - CLOSE("close.png"), - SCREENSHOT("screenshot.png"), - HOST_KBD("host_keyboard.png"), - DIAGNOSIS("diagnosis.png"), - FORCE_CLOSE("force_close.png"), - ABOUT("about.png"), - - COPY_SCREEN_SHOT("copy_screenshot_dialog.png"), - REFRESH_SCREEN_SHOT("refresh_screenshot_dialog.png"), - INCREASE_SCALE("increase_scale.png"), - DECREASE_SCALE("decrease_scale.png"), - SAVE_SCREEN_SHOT("save_screenshot_dialog.png"), - - EMULATOR_ICON("emulator_icon.ico"); - - private String name; - - private IconName(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - } - - private Display display; - private Map<String, Image> resourceImageMap; - private Map<String, Image> iconImageMap; - - private static ImageRegistry instance; - private static boolean isInitialized; - - /** - * Constructor - */ - private ImageRegistry() { - /* do nothing */ - } - - public static ImageRegistry getInstance() { - if (null == instance) { - instance = new ImageRegistry(); - } - - return instance; - } - - public void initialize(EmulatorConfig config, String skinPath) { - if (isInitialized) { - return; - } - isInitialized = true; - - this.display = Display.getDefault(); - this.resourceImageMap = new HashMap<String, Image>(); - this.iconImageMap = new HashMap<String, Image>(); - } - - public Image getResourceImage(ResourceImageName name) { - String imageName = name.getName(); - Image image = resourceImageMap.get(imageName); - - if (image == null) { - ClassLoader classLoader = this.getClass().getClassLoader(); - InputStream is = null; - - String resourcePath = IMAGES_FOLDER + "/" + imageName; - - try { - is = classLoader.getResourceAsStream(resourcePath); - if (null != is) { - logger.info("resource image is loaded"); - resourceImageMap.put(imageName, new Image(display, is)); - } else { - logger.severe("missing image : " + resourcePath); - } - } finally { - IOUtil.close(is); - } - - image = resourceImageMap.get(imageName); - if (image != null) { - logger.info("resource " + imageName + " size : " + - image.getImageData().width + "x" + - image.getImageData().height); - } - } - - return image; - } - - public Image getIcon(IconName name) { - if (iconImageMap.size() == 0) { - /* load all of the icons at once */ - ClassLoader classLoader = this.getClass().getClassLoader(); - InputStream is = null; - String imageName, imagePath; - - IconName[] values = IconName.values(); - for (IconName iconName : values) { - imageName = iconName.getName(); - imagePath = ICONS_FOLDER + "/" + imageName; - - try { - is = classLoader.getResourceAsStream(imagePath); - if (null != is) { - logger.fine("icon is loaded : " + imagePath); - iconImageMap.put(imageName, new Image(display, is)); - } else { - logger.severe("missing icon : " + imagePath); - } - } finally { - IOUtil.close(is); - } - } - } - - return iconImageMap.get(name.getName()); - } - - public void dispose() { - Collection<Image> images = null; - Iterator<Image> imageIterator = null; - Image image = null; - - /* resource */ - if (null != resourceImageMap) { - images = resourceImageMap.values(); - - imageIterator = images.iterator(); - - while (imageIterator.hasNext()) { - image = imageIterator.next(); - image.dispose(); - } - } - - /* icon */ - if (null != iconImageMap) { - images = iconImageMap.values(); - - imageIterator = images.iterator(); - - while (imageIterator.hasNext()) { - image = imageIterator.next(); - if (image != null) { - image.dispose(); - } - } - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ProfileSkinImageRegistry.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ProfileSkinImageRegistry.java deleted file mode 100644 index 2bb087bbee..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ProfileSkinImageRegistry.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - * Image Resource Management For Profile-Specific Skin - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.image; - -import java.io.File; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.dbi.EmulatorUI; -import org.tizen.emulator.skin.dbi.ImageListType; -import org.tizen.emulator.skin.dbi.RotationType; -import org.tizen.emulator.skin.dbi.RotationsType; -import org.tizen.emulator.skin.layout.rotation.Rotation; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.StringUtil; - -public class ProfileSkinImageRegistry { - private static Logger logger = SkinLogger.getSkinLogger( - ProfileSkinImageRegistry.class).getLogger(); - - public enum SkinImageType { - PROFILE_IMAGE_TYPE_NORMAL, - PROFILE_IMAGE_TYPE_PRESSED, - DISPLAY_MASK_IMAGE, - DISPLAY_ROTARY_IMAGE - } - - private Display display; - private String skinPath; - private EmulatorUI dbiContents; - private Map<String, Image> skinImageMap; - - /** - * Constructor - */ - public ProfileSkinImageRegistry( - Display display, EmulatorUI dbiContents, String skinPath) { - this.display = display; - this.skinPath = skinPath; - this.dbiContents = dbiContents; - this.skinImageMap = new HashMap<String, Image>(); - } - - private String makeKey(Short id, SkinImageType imageType) { - return id + ":" + imageType.ordinal(); - } - - public Image getSkinImage(Short id, SkinImageType imageType) { - Image image = skinImageMap.get(makeKey(id, imageType)); - - if (image == null) { - RotationsType rotations = dbiContents.getRotations(); - - if (null == rotations) { - logger.severe("Fail to loading rotations element from XML"); - return null; - } - - logger.info("get skin image from " + skinPath); - - Rotation targetRotation = SkinRotations.getRotation(id); - if (targetRotation == null) { - return null; - } - - List<RotationType> rotationList = rotations.getRotation(); - - for (RotationType rotation : rotationList) { - ImageListType imageList = rotation.getImageList(); - if (imageList == null) { - continue; - } - - if (targetRotation.getName().value().equals(rotation.getName().value())) { - if (SkinImageType.PROFILE_IMAGE_TYPE_NORMAL == imageType) { - String mainImage = imageList.getMainImage(); - - String mainKey = makeKey(id, imageType); - skinImageMap.put(mainKey, - new Image(display, skinPath + File.separator + mainImage)); - } else if (SkinImageType.PROFILE_IMAGE_TYPE_PRESSED == imageType) { - String keyPressedImage = imageList.getKeyPressedImage(); - - String pressedKey = makeKey(id, imageType); - skinImageMap.put(pressedKey, - new Image(display, skinPath + File.separator + keyPressedImage)); - } else if (SkinImageType.DISPLAY_MASK_IMAGE == imageType) { - String displayMaskImage = rotation.getDisplay().getMaskImage(); - if (StringUtil.isEmpty(StringUtil.nvl(displayMaskImage))) { - return null; - } - - String displayMaskKey = makeKey(id, imageType); - skinImageMap.put(displayMaskKey, - new Image(display, skinPath + File.separator + displayMaskImage)); - } else if (SkinImageType.DISPLAY_ROTARY_IMAGE == imageType) { - String displayRotaryImage = rotation.getDisplay().getRotaryImage(); - if (StringUtil.isEmpty(StringUtil.nvl(displayRotaryImage))) { - return null; - } - - String displayRotaryKey = makeKey(id, imageType); - skinImageMap.put(displayRotaryKey, - new Image(display, skinPath + File.separator + displayRotaryImage)); - } - - break; - } - } - - image = skinImageMap.get(makeKey(id, imageType)); - } - - return image; - } - - public void dispose() { - logger.info("dispose"); - - if (null != skinImageMap) { - Image image = null; - - Collection<Image> images = skinImageMap.values(); - Iterator<Image> imageIterator = images.iterator(); - - while (imageIterator.hasNext()) { - image = imageIterator.next(); - if (image != null) { - image.dispose(); - } - } - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/SpecialKeyWindowImageRegistry.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/SpecialKeyWindowImageRegistry.java deleted file mode 100644 index dfe5b6f8b8..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/SpecialKeyWindowImageRegistry.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Image Resource Management For Special Key Window - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.image; - -import java.io.File; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.keywindow.dbi.ImageListType; -import org.tizen.emulator.skin.keywindow.dbi.KeyWindowUI; -import org.tizen.emulator.skin.log.SkinLogger; - - -/** - * - * - */ -public class SpecialKeyWindowImageRegistry { - private static Logger logger = - SkinLogger.getSkinLogger(SpecialKeyWindowImageRegistry.class).getLogger(); - - public enum SpecailKeyWindowImageType { - SPECIAL_IMAGE_TYPE_NORMAL, - SPECIAL_IMAGE_TYPE_PRESSED - } - - private Display display; - private String imagePath; - private KeyWindowUI dbiContents; - private Map<String, Image> keyWindowImageMap; - - /** - * Constructor - */ - public SpecialKeyWindowImageRegistry( - Display display, KeyWindowUI dbiContents, String imagePath) { - this.display = display; - this.imagePath = imagePath; - this.dbiContents = dbiContents; - this.keyWindowImageMap = new HashMap<String, Image>(); - } - - private String makeKey(Short id, SpecailKeyWindowImageType imageType) { - return id + ":" + imageType.ordinal(); - } - - public Image getKeyWindowImage(Short id, SpecailKeyWindowImageType imageType) { - Image image = keyWindowImageMap.get(makeKey(id, imageType)); - - if (image == null) { - ImageListType imageList = dbiContents.getImageList(); - if (imageList == null) { - return null; - } - - logger.info("get Key Window image from " + imagePath); - - String mainImage = imageList.getMainImage(); - String keyPressedImage = imageList.getKeyPressedImage(); - - String mainKey = makeKey(id, - SpecailKeyWindowImageType.SPECIAL_IMAGE_TYPE_NORMAL); - keyWindowImageMap.put(mainKey, - new Image(display, imagePath + File.separator + mainImage)); - - String pressedKey = makeKey(id, - SpecailKeyWindowImageType.SPECIAL_IMAGE_TYPE_PRESSED); - keyWindowImageMap.put(pressedKey, - new Image(display, imagePath + File.separator + keyPressedImage)); - - image = keyWindowImageMap.get(makeKey(id, imageType)); - } - - return image; - } - - public void dispose() { - logger.info("dispose"); - - if (null != keyWindowImageMap) { - Image image = null; - - Collection<Image> images = keyWindowImageMap.values(); - Iterator<Image> imageIterator = images.iterator(); - - while (imageIterator.hasNext()) { - image = imageIterator.next(); - if (image != null) { - image.dispose(); - } - } - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/info/EmulatorSkinState.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/info/EmulatorSkinState.java deleted file mode 100644 index c1e8fcadaa..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/info/EmulatorSkinState.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Emulator Skin State - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.info; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; - -public class EmulatorSkinState { - private Point currentResolution; - private int currentScale; - private short currentRotationId; - - private Rectangle displayBounds; - private boolean updateDisplayBounds; - - private Image currentImage; - private Image currentKeyPressedImage; - private Color hoverColor; - - /** - * Constructor - */ - public EmulatorSkinState() { - this.currentResolution = new Point(720, 1280); - this.currentScale = EmulatorConfig.DEFAULT_WINDOW_SCALE; - this.currentRotationId = SkinRotations.PORTRAIT_ID; - - this.displayBounds = null; - this.updateDisplayBounds = false; - } - - /* resolution */ - public synchronized Point getCurrentResolution() { - return currentResolution; - } - - public synchronized int getCurrentResolutionWidth() { - return currentResolution.x; - } - - public synchronized int getCurrentResolutionHeight() { - return currentResolution.y; - } - - public synchronized void setCurrentResolution(Point resolution) { - setCurrentResolutionWidth(resolution.x); - setCurrentResolutionHeight(resolution.y); - } - - public synchronized void setCurrentResolutionWidth(int width) { - if (width < 0) { - width = 0; - } - this.currentResolution.x = width; - } - - public synchronized void setCurrentResolutionHeight(int height) { - if (height < 0) { - height = 0; - } - this.currentResolution.y = height; - } - - /* scale */ - public synchronized int getCurrentScale() { - return currentScale; - } - - public synchronized void setCurrentScale(int scale) { - this.currentScale = scale; - } - - /* rotation */ - public synchronized short getCurrentRotationId() { - return currentRotationId; - } - - public synchronized void setCurrentRotationId() { - this.currentRotationId = SkinRotations.PORTRAIT_ID; - } - - public synchronized void setCurrentRotationId(short rotationId) { - this.currentRotationId = rotationId; - } - - /* display bounds */ - public synchronized Rectangle getDisplayBounds() { - if (displayBounds == null) { - return new Rectangle(0, 0, 10, 10); - } - - return displayBounds; - } - - public synchronized void setDisplayBounds(Rectangle bounds) { - this.displayBounds = bounds; - } - - public synchronized boolean isNeedToUpdateDisplay() { - return updateDisplayBounds; - } - - public synchronized void setNeedToUpdateDisplay(boolean needUpdate) { - this.updateDisplayBounds = needUpdate; - } - - /* skin image */ - public synchronized Image getCurrentImage() { - return currentImage; - } - - public synchronized void setCurrentImage(Image image) { - this.currentImage = image; - } - - public synchronized Image getCurrentKeyPressedImage() { - return currentKeyPressedImage; - } - - public synchronized void setCurrentKeyPressedImage(Image keyPressedImage) { - this.currentKeyPressedImage = keyPressedImage; - } - - /* color of hover */ - public synchronized Color getHoverColor() { - return hoverColor; - } - - public synchronized void setHoverColor(Color color) { - this.hoverColor = color; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java deleted file mode 100644 index 50c66fe329..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Skin Information - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.info; - -import java.util.logging.Logger; - -import org.tizen.emulator.skin.log.SkinLogger; - -/* - * - */ -public class SkinInformation { - private static Logger logger = - SkinLogger.getSkinLogger(SkinInformation.class).getLogger(); - - private String skinName; - private String skinPath; - private boolean isGeneralSkin; - private int skinOption; - - /** - * Constructor - */ - public SkinInformation(String skinName, String skinPath, boolean isGeneralSkin) { - this.skinName = skinName; - this.skinPath = skinPath; - this.isGeneralSkin = isGeneralSkin; - this.skinOption = 0; - - if (isGeneralPurposeSkin() == true) { - logger.info("This skin has a general purpose layout"); - } else { - logger.info("This skin has a profile specific layout"); - } - } - - public String getSkinName() { - return skinName; - } - - public String getSkinPath() { - return skinPath; - } - - public boolean isGeneralPurposeSkin() { - return isGeneralSkin; - } - - public int getSkinOption() { - return skinOption; - } - - public void setSkinOption(int option) { - this.skinOption = option; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java deleted file mode 100644 index 67578d9533..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java +++ /dev/null @@ -1,549 +0,0 @@ -/** - * General-Purpose Skin Layout - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import java.util.List; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.DisplayCanvas; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.EmulatorSkinMain; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants; -import org.tizen.emulator.skin.custom.ColorTag; -import org.tizen.emulator.skin.custom.CustomButton; -import org.tizen.emulator.skin.custom.CustomProgressBar; -import org.tizen.emulator.skin.custom.SkinWindow; -import org.tizen.emulator.skin.dbi.KeyMapType; -import org.tizen.emulator.skin.image.GeneralSkinImageRegistry; -import org.tizen.emulator.skin.image.GeneralSkinImageRegistry.GeneralSkinImageName; -import org.tizen.emulator.skin.image.ImageRegistry.IconName; -import org.tizen.emulator.skin.info.EmulatorSkinState; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.menu.KeyWindowKeeper; -import org.tizen.emulator.skin.menu.PopupMenu; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class GeneralPurposeSkinComposer implements ISkinComposer { - private static final int PAIR_TAG_POSITION_X = 26; - private static final int PAIR_TAG_POSITION_Y = 13; - - private Logger logger = SkinLogger.getSkinLogger( - GeneralPurposeSkinComposer.class).getLogger(); - - private EmulatorConfig config; - private EmulatorSkin skin; - private Shell shell; - private DisplayCanvas displayCanvas; - private Color backgroundColor; - private CustomButton toggleButton; - private ColorTag pairTag; - private EmulatorSkinState currentState; - - private SkinPatches frameMaker; - - private PaintListener shellPaintListener; - private MouseMoveListener shellMouseMoveListener; - private MouseListener shellMouseListener; - - private GeneralSkinImageRegistry imageRegistry; - - public GeneralPurposeSkinComposer( - EmulatorConfig config, EmulatorSkin skin) { - this.config = config; - this.skin = skin; - this.shell = skin.getShell(); - this.currentState = skin.getEmulatorSkinState(); - - this.imageRegistry = - new GeneralSkinImageRegistry(shell.getDisplay()); - - this.frameMaker = new SkinPatches( - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_LT), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_T), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_RT), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_L), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_R), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_LB), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_B), - imageRegistry.getSkinImage(GeneralSkinImageName.SKIN_PATCH_RB)); - - this.backgroundColor = new Color(shell.getDisplay(), new RGB(38, 38, 38)); - } - - @Override - public DisplayCanvas compose(int style) { - shell.setBackground(backgroundColor); - - displayCanvas = new DisplayCanvas(shell, style); - - int x = config.getValidWindowX(); - int y = config.getValidWindowY(); - int scale = currentState.getCurrentScale(); - short rotationId = currentState.getCurrentRotationId(); - - composeInternal(displayCanvas, x, y, scale, rotationId); - logger.info("resolution : " + currentState.getCurrentResolution() + - ", scale : " + scale); - - return displayCanvas; - } - - @Override - public void composeInternal(DisplayCanvas displayCanvas, - final int x, final int y, int scale, short rotationId) { - shell.setLocation(x, y); - - /* This string must match the definition of Emulator-Manager */ - String emulatorName = SkinUtil.makeEmulatorName(config); - shell.setText(SkinUtil.EMULATOR_PREFIX + " - " + emulatorName); - - displayCanvas.setBackground( - shell.getDisplay().getSystemColor(SWT.COLOR_BLACK)); - - shell.setImage(skin.getImageRegistry().getIcon( - IconName.EMULATOR_ICON)); - - /* create a toggle button of key window */ - List<KeyMapType> keyMapList = SkinUtil.getHWKeyMapList( - skin.getEmulatorSkinState().getCurrentRotationId()); - - if (keyMapList != null && keyMapList.isEmpty() == false) { - toggleButton = createToggleButton(); - toggleButton.setBackground(backgroundColor); - } - - /* make a pair tag circle */ - pairTag = new ColorTag(shell, SWT.NO_FOCUS, skin.getColorVM()); - pairTag.setVisible(false); - - /* create a progress bar for booting status */ - skin.bootingProgress = new CustomProgressBar(skin, SWT.NONE, true); - skin.bootingProgress.setBackground(backgroundColor); - - arrangeSkin(scale, rotationId); - - if (currentState.getCurrentImage() == null) { - logger.severe("Failed to load initial skin image. Kill this skin process."); - SkinUtil.openMessage(shell, null, - "Failed to load Skin image file.", SWT.ICON_ERROR, config); - - EmulatorSkinMain.terminateImmediately(-1); - } - - addListeners(); - - /* open the key window if key window menu item was enabled */ - PopupMenu popupMenu = skin.getPopupMenu(); - - if (popupMenu != null && popupMenu.keyWindowItem != null) { - final int dockValue = config.getSkinPropertyInt( - SkinPropertiesConstants.KEYWINDOW_POSITION, SWT.NONE); - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (dockValue == SWT.NONE) { - skin.getKeyWindowKeeper().openKeyWindow( - KeyWindowKeeper.DEFAULT_DOCK_POSITION, false); - } else { - skin.getKeyWindowKeeper().openKeyWindow(dockValue, false); - } - } - }); - } - } - - @Override - public void arrangeSkin(int scale, short rotationId) { - //TODO: eject the calculation from UI thread - - /* calculate display bounds */ - Rectangle displayBounds = adjustDisplayGeometry(displayCanvas, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), - scale, rotationId); - - if (displayBounds == null) { - logger.severe("Failed to read display information for skin."); - SkinUtil.openMessage(shell, null, - "Failed to read display information for skin.\n" + - "Check the contents of skin dbi file.", - SWT.ICON_ERROR, config); - - EmulatorSkinMain.terminateImmediately(-1); - } - logger.info("display bounds : " + displayBounds); - - /* make general skin */ - Image generalSkin = - frameMaker.getPatchedImage(displayBounds.width, displayBounds.height); - - /* make window region */ - Region region = (SwtUtil.isLinuxPlatform() == false) ? - getTrimmedRegion(generalSkin) : /* color key */ - SkinUtil.getTrimmedRegion(generalSkin); - - /* update the skin state information */ - currentState.setCurrentScale(scale); - currentState.setCurrentRotationId(rotationId); - currentState.setDisplayBounds(displayBounds); - - Image tempImage = null; - if (currentState.getCurrentImage() != null) { - tempImage = currentState.getCurrentImage(); - } - currentState.setCurrentImage(generalSkin); - - if (tempImage != null) { - tempImage.dispose(); - } - - /* arrange the display */ - displayCanvas.setBounds(displayBounds); - - /* arrange the toggle button of key window */ - if (toggleButton != null) { - int centerY = ((displayBounds.height - toggleButton.getImageSize().y) / 2); - - toggleButton.setBounds(displayBounds.x + displayBounds.width + 4, - displayBounds.y + centerY, - toggleButton.getImageSize().x, toggleButton.getImageSize().y); - } - - /* arrange the progress bar */ - if (skin.bootingProgress != null) { - skin.bootingProgress.setBounds(displayBounds.x, - displayBounds.y + displayBounds.height + 1, displayBounds.width, 2); - } - - /* set window size */ - if (currentState.getCurrentImage() != null) { - ImageData imageData = currentState.getCurrentImage().getImageData(); - shell.setSize(imageData.width, imageData.height); - } - - /* arrange the pair tag */ - if (rotationId == SkinRotations.PORTRAIT_ID) { - pairTag.setBounds( - PAIR_TAG_POSITION_X, PAIR_TAG_POSITION_Y, - pairTag.getWidth(), pairTag.getHeight()); - } else if (rotationId == SkinRotations.LANDSCAPE_ID) { - pairTag.setBounds( - PAIR_TAG_POSITION_Y, - shell.getSize().y - PAIR_TAG_POSITION_X - pairTag.getHeight(), - pairTag.getWidth(), pairTag.getHeight()); - } else if (rotationId == SkinRotations.REVERSE_PORTRAIT_ID) { - pairTag.setBounds( - shell.getSize().x - PAIR_TAG_POSITION_X - pairTag.getWidth(), - shell.getSize().y - PAIR_TAG_POSITION_Y - pairTag.getHeight(), - pairTag.getWidth(), pairTag.getHeight()); - } else if (rotationId == SkinRotations.REVERSE_LANDSCAPE_ID) { - pairTag.setBounds( - shell.getSize().x - PAIR_TAG_POSITION_Y - pairTag.getWidth(), - PAIR_TAG_POSITION_X, - pairTag.getWidth(), pairTag.getHeight()); - } - - /* custom window shape */ - if (region != null) { - shell.setRegion(region); - } - - currentState.setNeedToUpdateDisplay(true); - shell.redraw(); - } - - @Override - public Rectangle adjustDisplayGeometry( - Canvas displayCanvas, int resolutionW, int resolutionH, - int scale, short rotationId) { - - Rectangle displayBounds = new Rectangle( - frameMaker.getPatchWidth(), frameMaker.getPatchHeight(), 0, 0); - - float convertedScale = SkinUtil.convertScale(scale); - - /* resoultion, that is display size in general skin mode */ - if (SkinRotations.LANDSCAPE_ID == rotationId || - SkinRotations.REVERSE_LANDSCAPE_ID == rotationId) { - displayBounds.width = (int)(resolutionH * convertedScale); - displayBounds.height = (int)(resolutionW * convertedScale); - } else { - displayBounds.width = (int)(resolutionW * convertedScale); - displayBounds.height = (int)(resolutionH * convertedScale); - } - - return displayBounds; - } - - private static Region getTrimmedRegion(Image image) { - if (null == image) { - return null; - } - - ImageData imageData = image.getImageData(); - int width = imageData.width; - int height = imageData.height; - - Region region = new Region(); - region.add(new Rectangle(0, 0, width, height)); - - Display display = Display.getDefault(); - int r = display.getSystemColor(SWT.COLOR_MAGENTA).getRed(); - int g = display.getSystemColor(SWT.COLOR_MAGENTA).getGreen(); - int b = display.getSystemColor(SWT.COLOR_MAGENTA).getBlue(); - int colorKey = 0; - - if (SwtUtil.isWindowsPlatform()) { - colorKey = r << 24 | g << 16 | b << 8; - } else { - colorKey = r << 16 | g << 8 | b; - } - - int j = 0; - for (int i = 0; i < width; i++) { - for (j = 0; j < height; j++) { - int colorPixel = imageData.getPixel(i, j); - if (colorPixel == colorKey /* magenta */) { - region.subtract(i, j, 1, 1); - } - } - } - - return region; - } - - @Override - public void updateSkin() { - logger.info("update skin"); - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - /* update pair tag */ - if (pairTag != null && pairTag.isDisposed() == false) { - SkinWindow keyWindow = skin.getKeyWindowKeeper().getKeyWindow(); - if (keyWindow != null && - keyWindow.getShell().isVisible() == true) { - pairTag.setVisible(true); - } else { - pairTag.setVisible(false); - } - } - } - }); - } - - private CustomButton createToggleButton() { - /* load image for toggle button of key window */ - Image imageNormal = imageRegistry.getSkinImage( - GeneralSkinImageName.TOGGLE_BUTTON_NORMAL); - Image imageHover = imageRegistry.getSkinImage( - GeneralSkinImageName.TOGGLE_BUTTON_HOVER); - Image imagePushed = imageRegistry.getSkinImage( - GeneralSkinImageName.TOGGLE_BUTTON_PUSHED); - - CustomButton toggle = new CustomButton(shell, - SWT.DRAW_TRANSPARENT | SWT.NO_FOCUS, - imageNormal, imageHover, imagePushed); - - toggle.addMouseListener(new MouseListener() { - @Override - public void mouseDown(MouseEvent e) { - if (skin.isKeyWindow == true) { - skin.getKeyWindowKeeper().closeKeyWindow(); - skin.getKeyWindowKeeper().setRecentlyDocked( - KeyWindowKeeper.DEFAULT_DOCK_POSITION); - } else { - skin.getKeyWindowKeeper().openKeyWindow( - KeyWindowKeeper.DEFAULT_DOCK_POSITION, true); - } - } - - @Override - public void mouseUp(MouseEvent e) { - /* do nothing */ - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }); - - return toggle; - } - - private void addListeners() { - shellPaintListener = new PaintListener() { - @Override - public void paintControl(final PaintEvent e) { - if (currentState.isNeedToUpdateDisplay() == true) { - currentState.setNeedToUpdateDisplay(false); - - logger.info("shell transform was changed"); - - skin.setSuitableTransform(); - } - - /* set window size once again (for ubuntu 12.04) */ - if (currentState.getCurrentImage() != null) { - ImageData imageData = currentState.getCurrentImage().getImageData(); - - if (shell.getSize().x != imageData.width - || shell.getSize().y != imageData.height) { - shell.setSize(imageData.width, imageData.height); - } - } - - /* display should be redrawn When host OS wakes up from suspend - on Ubuntu */ - if (SwtUtil.isLinuxPlatform() == true && shell.getRegion() != null) { - if (shell.getRegion().getBounds().x == e.x - && shell.getRegion().getBounds().y == e.y - && shell.getRegion().getBounds().width == e.width - && shell.getRegion().getBounds().height == e.height) { - logger.info("shell re-painting is required"); - - skin.updateDisplay(); - } - } - - /* swt shell does not support native transparency, - so draw image with GC */ - if (currentState.getCurrentImage() != null) { - e.gc.drawImage(currentState.getCurrentImage(), 0, 0); - } - - skin.getKeyWindowKeeper().redock(false, false); - } - }; - - shell.addPaintListener(shellPaintListener); - - shellMouseMoveListener = new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (skin.isShellGrabbing() == true && e.button == 0/* left button */) { - /* move a window */ - Point previousLocation = shell.getLocation(); - Point grabLocation = skin.getGrabPosition(); - if (grabLocation != null) { - int x = previousLocation.x + (e.x - grabLocation.x); - int y = previousLocation.y + (e.y - grabLocation.y); - - shell.setLocation(x, y); - } - - skin.getKeyWindowKeeper().redock(false, false); - } - } - }; - - shell.addMouseMoveListener(shellMouseMoveListener); - - shellMouseListener = new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - if (e.button == 1) { /* left button */ - logger.info("mouseUp in Skin"); - - skin.ungrabShell(); - - skin.getKeyWindowKeeper().redock(false, true); - } - } - - @Override - public void mouseDown(MouseEvent e) { - if (1 == e.button) { /* left button */ - logger.info("mouseDown in Skin"); - - skin.grabShell(e.x, e.y); - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }; - - shell.addMouseListener(shellMouseListener); - } - - @Override - public void composerFinalize() { - if (null != shellPaintListener) { - shell.removePaintListener(shellPaintListener); - } - - if (null != shellMouseMoveListener) { - shell.removeMouseMoveListener(shellMouseMoveListener); - } - - if (null != shellMouseListener) { - shell.removeMouseListener(shellMouseListener); - } - - if (toggleButton != null) { - toggleButton.dispose(); - } - - if (pairTag != null) { - pairTag.dispose(); - pairTag = null; - } - - if (backgroundColor != null) { - backgroundColor.dispose(); - } - - imageRegistry.dispose(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java deleted file mode 100644 index 73a5d6a764..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Hardware Key - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import org.tizen.emulator.skin.util.SkinUtil; - -public class HWKey { - private String name; - private int keyCode; - private HWKeyRegion region; - private String tooltip; - - /** - * Constructor - */ - public HWKey() { - this.name = "unknown"; - this.keyCode = SkinUtil.UNKNOWN_KEYCODE; - } - - public HWKey(String name, int keyCode, HWKeyRegion region, String tooltip) { - this.name = name; - this.keyCode = keyCode; - this.region = region; - this.tooltip = tooltip; - } - - /* name */ - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* keycode */ - public int getKeyCode() { - return keyCode; - } - - public void setKeyCode(int keyCode) { - this.keyCode = keyCode; - } - - /* region */ - public HWKeyRegion getRegion() { - return region; - } - - public void setRegion(HWKeyRegion region) { - this.region = region; - } - - /* tooltip */ - public String getTooltip() { - return tooltip; - } - - public void setTooltip(String tooltip) { - this.tooltip = tooltip; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKeyRegion.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKeyRegion.java deleted file mode 100644 index a45dca1381..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKeyRegion.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Hardware Key Region - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.layout; - -/** - * - * - */ -public class HWKeyRegion { - public int x; - public int y; - public int width; - public int height; - private boolean update; - - public HWKeyRegion(int x, int y, int width, int height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - this.update = false; - } - - public HWKeyRegion(int x, int y, int width, int height, - boolean update) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - this.update = update; - } - - public boolean isNeedUpdate() { - return update; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ISkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ISkinComposer.java deleted file mode 100644 index e12684372d..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ISkinComposer.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Skin Composer Interface - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Canvas; -import org.tizen.emulator.skin.DisplayCanvas; - -public interface ISkinComposer { - public abstract DisplayCanvas compose(int style); - - public abstract void composeInternal(DisplayCanvas DisplayCanvas, - int x, int y, int scale, short rotationId); - - public abstract void arrangeSkin(int scale, short rotationId); - public abstract void updateSkin(); - - public abstract Rectangle adjustDisplayGeometry( - Canvas displayCanvas, int resolutionW, int resolutionH, - int scale, short rotationId); - - public abstract void composerFinalize(); -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileRotarySkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileRotarySkinComposer.java deleted file mode 100644 index 226d1ee9f1..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileRotarySkinComposer.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Profile Rotary Skin Layout - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SkinUtil; - -public class ProfileRotarySkinComposer extends ProfileSpecificSkinComposer { - private Logger logger = SkinLogger.getSkinLogger( - ProfileRotarySkinComposer.class).getLogger(); - - protected Rotary rotary; - - public ProfileRotarySkinComposer( - EmulatorConfig config, EmulatorSkin skin) { - super(config, skin); - - rotary = new Rotary(shell, SWT.DOUBLE_BUFFERED, - imageRegistry, communicator); - } - - @Override - public void arrangeSkin(int scale, short rotationId) { - super.arrangeSkin(scale, rotationId); - - rotary.arrange(scale, rotationId); - - shell.getDisplay().syncExec(new Runnable() { - @Override - public void run() { - logger.info("arrange a rotary"); - - Image rotaryImage = rotary.getImage(); - if (rotaryImage != null) { - final int rotaryW = rotaryImage.getImageData().width; - final int rotaryH = rotaryImage.getImageData().height; - - /* calculate rotary bounds */ - Rectangle displayBounds = currentState.getDisplayBounds(); - final int offsetX = (rotaryW - displayBounds.width) / 2; - final int offsetY = (rotaryH - displayBounds.height) / 2; - rotary.setBounds( - displayBounds.x - offsetX, displayBounds.y - offsetY, - rotaryW, rotaryH); - - /* make rotary region */ - Region rotaryRegion = SkinUtil.getTrimmedRegion(rotaryImage); - Region displayRegion = displayCanvas.getRegion(); - displayRegion.translate(offsetX, offsetY); - rotaryRegion.subtract(displayRegion); - displayRegion.translate(-offsetX, -offsetY); - - rotary.setRegion(rotaryRegion); - } else { - logger.warning("undefined rotary"); - - rotary.setBounds(0, 0, 0, 0); - rotary.setRegion(null); - } - } - }); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java deleted file mode 100644 index 9f8b78f405..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java +++ /dev/null @@ -1,621 +0,0 @@ -/** - * Profile-Specific Skin Layout - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.MouseTrackAdapter; -import org.eclipse.swt.events.MouseTrackListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.DisplayCanvas; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.EmulatorSkinMain; -import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.data.KeyEventData; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants; -import org.tizen.emulator.skin.custom.CustomProgressBar; -import org.tizen.emulator.skin.dbi.DisplayType; -import org.tizen.emulator.skin.dbi.RegionType; -import org.tizen.emulator.skin.image.ImageRegistry.IconName; -import org.tizen.emulator.skin.image.ProfileSkinImageRegistry; -import org.tizen.emulator.skin.image.ProfileSkinImageRegistry.SkinImageType; -import org.tizen.emulator.skin.info.EmulatorSkinState; -import org.tizen.emulator.skin.layout.rotation.Rotation; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.menu.KeyWindowKeeper; -import org.tizen.emulator.skin.menu.PopupMenu; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class ProfileSpecificSkinComposer implements ISkinComposer { - private Logger logger = SkinLogger.getSkinLogger( - ProfileSpecificSkinComposer.class).getLogger(); - - protected EmulatorConfig config; - protected EmulatorSkin skin; - protected Shell shell; - protected DisplayCanvas displayCanvas; - protected EmulatorSkinState currentState; - protected SocketCommunicator communicator; - - private PaintListener shellPaintListener; - private MouseTrackListener shellMouseTrackListener; - private MouseMoveListener shellMouseMoveListener; - private MouseListener shellMouseListener; - - protected ProfileSkinImageRegistry imageRegistry; - private HWKey currentPressedHWKey; - private HWKey currentHoveredHWKey; - - public ProfileSpecificSkinComposer( - EmulatorConfig config, EmulatorSkin skin) { - this.config = config; - this.skin = skin; - this.shell = skin.getShell(); - this.currentState = skin.getEmulatorSkinState(); - this.communicator = skin.communicator; - - this.imageRegistry = new ProfileSkinImageRegistry( - shell.getDisplay(), config.getDbiContents(), skin.skinInfo.getSkinPath()); - - this.currentPressedHWKey = null; - this.currentHoveredHWKey = null; - } - - @Override - public DisplayCanvas compose(int style) { - displayCanvas = new DisplayCanvas(shell, style); - displayCanvas.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_BLACK)); - - int x = config.getValidWindowX(); - int y = config.getValidWindowY(); - int scale = currentState.getCurrentScale(); - short rotationId = currentState.getCurrentRotationId(); - - composeInternal(displayCanvas, x, y, scale, rotationId); - logger.info("resolution : " + currentState.getCurrentResolution() + - ", scale : " + scale); - - return displayCanvas; - } - - @Override - public void composeInternal(DisplayCanvas displayCanvas, - int x, int y, int scale, short rotationId) { - shell.setLocation(x, y); - - /* This string must match the definition of Emulator-Manager */ - String emulatorName = SkinUtil.makeEmulatorName(config); - shell.setText(SkinUtil.EMULATOR_PREFIX + " - " + emulatorName); - - displayCanvas.setBackground( - shell.getDisplay().getSystemColor(SWT.COLOR_BLACK)); - - shell.setImage(skin.getImageRegistry().getIcon( - IconName.EMULATOR_ICON)); - - /* create a progress bar for booting status */ - skin.bootingProgress = new CustomProgressBar(skin, SWT.NONE, true); - skin.bootingProgress.setBackground( - new Color(shell.getDisplay(), new RGB(38, 38, 38))); - - arrangeSkin(scale, rotationId); - - if (currentState.getCurrentImage() == null) { - logger.severe("Failed to load initial skin image. Kill this skin process."); - SkinUtil.openMessage(shell, null, - "Failed to load Skin image file.", SWT.ICON_ERROR, config); - - EmulatorSkinMain.terminateImmediately(-1); - } - - addListeners(); - - /* open the key window if key window menu item was enabled */ - PopupMenu popupMenu = skin.getPopupMenu(); - - if (popupMenu != null && popupMenu.keyWindowItem != null) { - final int dockValue = config.getSkinPropertyInt( - SkinPropertiesConstants.KEYWINDOW_POSITION, SWT.NONE); - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (dockValue == SWT.NONE) { - skin.getKeyWindowKeeper().openKeyWindow( - KeyWindowKeeper.DEFAULT_DOCK_POSITION, false); - } else { - skin.getKeyWindowKeeper().openKeyWindow( - dockValue, false); - } - } - }); - } - } - - @Override - public void arrangeSkin(int scale, short rotationId) { - //TODO: eject the calculation from UI thread - - /* calculate display bounds */ - Rectangle displayBounds = adjustDisplayGeometry(displayCanvas, - currentState.getCurrentResolutionWidth(), - currentState.getCurrentResolutionHeight(), scale, rotationId); - - if (displayBounds == null) { - logger.severe("Failed to read display information for skin."); - SkinUtil.openMessage(shell, null, - "Failed to read display information for skin.\n" + - "Check the contents of skin dbi file.", - SWT.ICON_ERROR, config); - - EmulatorSkinMain.terminateImmediately(-1); - } - logger.info("display bounds : " + displayBounds); - - Image mask = imageRegistry.getSkinImage(rotationId, SkinImageType.DISPLAY_MASK_IMAGE); - if (mask != null) { - displayCanvas.setMaskImage(mask); - - logger.info("display masking"); - - mask = SkinUtil.createScaledImage( - shell.getDisplay(), mask, rotationId, scale); - displayCanvas.setRegion(SkinUtil.getTrimmedRegion(mask)); - - mask.dispose(); - } else { - displayCanvas.setRegion(null); - } - - /* make profile skin */ - Image originSkin = imageRegistry.getSkinImage( - rotationId, SkinImageType.PROFILE_IMAGE_TYPE_NORMAL); - Image profileSkin = SkinUtil.createScaledImage( - shell.getDisplay(), originSkin, rotationId, scale); - - Image originSkinKeyPressed = imageRegistry.getSkinImage( - rotationId, SkinImageType.PROFILE_IMAGE_TYPE_PRESSED); - Image profileSkinKeyPressed = SkinUtil.createScaledImage( - shell.getDisplay(), originSkinKeyPressed, rotationId, scale); - - /* make window region */ - Region region = SkinUtil.getTrimmedRegion(profileSkin); - - /* update the skin state information */ - currentState.setCurrentScale(scale); - currentState.setCurrentRotationId(rotationId); - currentState.setDisplayBounds(displayBounds); - - Image tempImage = null; - Image tempKeyPressedImage = null; - - if (currentState.getCurrentImage() != null) { - tempImage = currentState.getCurrentImage(); - } - if (currentState.getCurrentKeyPressedImage() != null) { - tempKeyPressedImage = currentState.getCurrentKeyPressedImage(); - } - - currentState.setCurrentImage(profileSkin); - currentState.setCurrentKeyPressedImage(profileSkinKeyPressed); - - if (tempImage != null) { - tempImage.dispose(); - } - if (tempKeyPressedImage != null) { - tempKeyPressedImage.dispose(); - } - - /* arrange the display */ - if (SwtUtil.isMacPlatform() == true) { - displayCanvas.setBounds(currentState.getDisplayBounds()); - } - - /* arrange the progress bar */ - if (skin.bootingProgress != null) { - skin.bootingProgress.setBounds(displayBounds.x, - displayBounds.y + displayBounds.height + 1, displayBounds.width, 2); - } - - /* set window size */ - if (currentState.getCurrentImage() != null) { - ImageData imageData = currentState.getCurrentImage().getImageData(); - shell.setSize(imageData.width, imageData.height); - } - - /* custom window shape */ - if (region != null) { - shell.setRegion(region); - } - - currentState.setNeedToUpdateDisplay(true); - shell.redraw(); - } - - @Override - public Rectangle adjustDisplayGeometry( - Canvas displayCanvas, int resolutionW, int resolutionH, - int scale, short rotationId) { - Rectangle displayBounds = new Rectangle(0, 0, 0, 0); - - float convertedScale = SkinUtil.convertScale(scale); - Rotation rotation = SkinRotations.getRotation(rotationId); - if (rotation == null) { - return null; - } - - DisplayType display = rotation.getDisplay(); /* from dbi */ - if (display == null) { - return null; - } - - RegionType region = display.getRegion(); - if (region == null) { - return null; - } - - Integer left = region.getLeft(); - Integer top = region.getTop(); - Integer width = region.getWidth(); - Integer height = region.getHeight(); - - displayBounds.x = (int) (left * convertedScale); - displayBounds.y = (int) (top * convertedScale); - displayBounds.width = (int) (width * convertedScale); - displayBounds.height = (int) (height * convertedScale); - - return displayBounds; - } - - private void drawHover(final HWKey hwKey) { - if (hwKey == null || hwKey.getRegion() == null - || hwKey.getRegion().width == 0 - || hwKey.getRegion().height == 0) { - return; - } - - currentHoveredHWKey = hwKey; - - shell.getDisplay().syncExec(new Runnable() { - public void run() { - GC gc = new GC(shell); - if (gc != null) { - gc.setLineWidth(1); - gc.setForeground(currentState.getHoverColor()); - gc.drawRectangle(currentHoveredHWKey.getRegion().x, - currentHoveredHWKey.getRegion().y, - currentHoveredHWKey.getRegion().width - 1, - currentHoveredHWKey.getRegion().height - 1); - - gc.dispose(); - } - } - }); - } - - private void removeHover() { - if (currentHoveredHWKey == null - || currentHoveredHWKey.getRegion() == null) { - return; - } - - shell.redraw(currentHoveredHWKey.getRegion().x, - currentHoveredHWKey.getRegion().y, - currentHoveredHWKey.getRegion().width, - currentHoveredHWKey.getRegion().height, false); - - currentHoveredHWKey = null; - } - - @Override - public void updateSkin() { - logger.info("update skin"); - - /* do nothing */ - } - - private void addListeners() { - shellPaintListener = new PaintListener() { - @Override - public void paintControl(final PaintEvent e) { - if (currentState.isNeedToUpdateDisplay() == true) { - currentState.setNeedToUpdateDisplay(false); - - logger.info("shell transform was changed"); - - if (SwtUtil.isMacPlatform() == false) { - displayCanvas.setBounds(currentState.getDisplayBounds()); - } - - skin.setSuitableTransform(); - } - - /* set window size once again (for ubuntu 12.04) */ - if (currentState.getCurrentImage() != null) { - ImageData imageData = currentState.getCurrentImage().getImageData(); - - if (shell.getSize().x != imageData.width - || shell.getSize().y != imageData.height) { - shell.setSize(imageData.width, imageData.height); - } - } - - /* display should be redrawn When host OS wakes up from suspend - on Ubuntu */ - if (SwtUtil.isLinuxPlatform() == true && shell.getRegion() != null) { - if (shell.getRegion().getBounds().x == e.x - && shell.getRegion().getBounds().y == e.y - && shell.getRegion().getBounds().width == e.width - && shell.getRegion().getBounds().height == e.height) { - logger.info("shell re-painting is required"); - - skin.updateDisplay(); - } - } - - /* swt shell does not support native transparency, - so draw image with GC */ - if (currentState.getCurrentImage() != null) { - e.gc.drawImage(currentState.getCurrentImage(), 0, 0); - - /* draw the HW key region as the cropped keyPressed image area */ - if (currentPressedHWKey != null - && currentState.getCurrentKeyPressedImage() != null) { - if (currentPressedHWKey.getRegion() != null - && currentPressedHWKey.getRegion().width != 0 - && currentPressedHWKey.getRegion().height != 0) { - e.gc.drawImage(currentState.getCurrentKeyPressedImage(), - currentPressedHWKey.getRegion().x, - currentPressedHWKey.getRegion().y, - currentPressedHWKey.getRegion().width, - currentPressedHWKey.getRegion().height, - currentPressedHWKey.getRegion().x, - currentPressedHWKey.getRegion().y, - currentPressedHWKey.getRegion().width, - currentPressedHWKey.getRegion().height); - } - } - } - - skin.getKeyWindowKeeper().redock(false, false); - } - }; - - shell.addPaintListener(shellPaintListener); - - shellMouseTrackListener = new MouseTrackAdapter() { - @Override - public void mouseExit(MouseEvent e) { - /* shell does not receive event only with MouseMoveListener - in case that : hover hardkey -> mouse move into display area */ - - shell.setToolTipText(null); - removeHover(); - } - }; - - shell.addMouseTrackListener(shellMouseTrackListener); - - shellMouseMoveListener = new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (skin.isShellGrabbing() == true && e.button == 0/* left button */ - && currentPressedHWKey == null) { - /* move a window */ - Point previousLocation = shell.getLocation(); - Point grabLocation = skin.getGrabPosition(); - if (grabLocation != null) { - int x = previousLocation.x + (e.x - grabLocation.x); - int y = previousLocation.y + (e.y - grabLocation.y); - - shell.setLocation(x, y); - } - - skin.getKeyWindowKeeper().redock(false, false); - - return; - } - - final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y, - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - - if (hwKey == null) { - shell.setToolTipText(null); - removeHover(); - } else { - /* enable tool tip */ - if (hwKey.getTooltip().isEmpty() == false) { - shell.setToolTipText(hwKey.getTooltip()); - } - - if (hwKey.getRegion() != null) { - if (currentHoveredHWKey != null) { - HWKeyRegion keyBounds = currentHoveredHWKey.getRegion(); - - if (keyBounds != null) { - if (hwKey.getRegion().x == keyBounds.x - && hwKey.getRegion().y == keyBounds.y - && hwKey.getRegion().width == keyBounds.width - && hwKey.getRegion().height == keyBounds.height) { - /* already got hover rect */ - return; - } else { - removeHover(); - } - } - } - - drawHover(hwKey); - } - } - } - }; - - shell.addMouseMoveListener(shellMouseMoveListener); - - shellMouseListener = new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - if (e.button == 1) { /* left button */ - skin.ungrabShell(); - - skin.getKeyWindowKeeper().redock(false, true); - - /* HW key handling */ - HWKey pressedHWKey = currentPressedHWKey; - if (pressedHWKey == null) { - logger.info("mouseUp in Skin : " + e.x + ", " + e.y); - return; - } - - if (pressedHWKey.getKeyCode() != SkinUtil.UNKNOWN_KEYCODE) { - logger.info(pressedHWKey.getName() + " key is released"); - - /* send HW key event */ - KeyEventData keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), pressedHWKey.getKeyCode(), 0, 0); - communicator.sendToQEMU( - SendCommand.SEND_HW_KEY_EVENT, keyEventData, false); - - currentPressedHWKey = null; - - if (pressedHWKey.getRegion() != null && - pressedHWKey.getRegion().width != 0 && - pressedHWKey.getRegion().height != 0) { - /* roll back a keyPressed image */ - shell.redraw(pressedHWKey.getRegion().x, pressedHWKey.getRegion().y, - pressedHWKey.getRegion().width, pressedHWKey.getRegion().height, false); - - /* roll back HW key region */ - if (pressedHWKey.getRegion().isNeedUpdate() == true) { - SkinUtil.trimShell(shell, currentState.getCurrentImage(), - pressedHWKey.getRegion().x, pressedHWKey.getRegion().y, - pressedHWKey.getRegion().width, pressedHWKey.getRegion().height); - } - } - } - } - } - - @Override - public void mouseDown(MouseEvent e) { - if (1 == e.button) { /* left button */ - skin.grabShell(e.x, e.y); - - /* HW key handling */ - final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y, - currentState.getCurrentScale(), - currentState.getCurrentRotationId()); - if (hwKey == null) { - logger.info("mouseDown in Skin : " + e.x + ", " + e.y); - - return; - } - - if (hwKey.getKeyCode() != SkinUtil.UNKNOWN_KEYCODE) { - logger.info(hwKey.getName() + " key is pressed"); - - shell.setToolTipText(null); - - /* send HW key event */ - KeyEventData keyEventData = new KeyEventData( - KeyEventType.PRESSED.value(), hwKey.getKeyCode(), 0, 0); - communicator.sendToQEMU( - SendCommand.SEND_HW_KEY_EVENT, keyEventData, false); - - currentPressedHWKey = hwKey; - - if (hwKey.getRegion() != null && - hwKey.getRegion().width != 0 && hwKey.getRegion().height != 0) { - /* draw the HW key region as the cropped keyPressed image area */ - shell.redraw(hwKey.getRegion().x, hwKey.getRegion().y, - hwKey.getRegion().width, hwKey.getRegion().height, false); - - /* set pressed HW key region */ - if (hwKey.getRegion().isNeedUpdate() == true) { - SkinUtil.trimShell(shell, currentState.getCurrentKeyPressedImage(), - hwKey.getRegion().x, hwKey.getRegion().y, - hwKey.getRegion().width, hwKey.getRegion().height); - } - } - } - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }; - - shell.addMouseListener(shellMouseListener); - } - - @Override - public void composerFinalize() { - if (null != shellPaintListener) { - shell.removePaintListener(shellPaintListener); - } - - if (null != shellMouseTrackListener) { - shell.removeMouseTrackListener(shellMouseTrackListener); - } - - if (null != shellMouseMoveListener) { - shell.removeMouseMoveListener(shellMouseMoveListener); - } - - if (null != shellMouseListener) { - shell.removeMouseListener(shellMouseListener); - } - - imageRegistry.dispose(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/Rotary.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/Rotary.java deleted file mode 100644 index e57766df6a..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/Rotary.java +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Rotary - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Transform; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.data.RotaryEventData; -import org.tizen.emulator.skin.image.ProfileSkinImageRegistry; -import org.tizen.emulator.skin.image.ProfileSkinImageRegistry.SkinImageType; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SkinUtil; - -public class Rotary extends Canvas { - private Logger logger = SkinLogger.getSkinLogger(Rotary.class).getLogger(); - - private Shell parent; - private ProfileSkinImageRegistry imageRegistry; - private SocketCommunicator communicator; - - private Image image; - private int degrees; /* absolute */ - private int angleDelta; - private Point grabPosition; - - /** - * Constructor - */ - Rotary(final Shell parent, int style, - ProfileSkinImageRegistry imageRegistry, SocketCommunicator communicator) { - super(parent, style); - - this.parent = parent; - this.imageRegistry = imageRegistry; - this.communicator = communicator; - this.image = null; - this.degrees = 0; - this.angleDelta = 0; - this.grabPosition = new Point(-1, -1); - - addListeners(); - - setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_GRAY)); - } - - public Image getImage() { - return image; - } - - public int getDegrees() { - return degrees; - } - - public void arrange(final int scale, final short rotationId) { - logger.info("scale : " + scale + ", rotate : " + rotationId); - - parent.getDisplay().syncExec(new Runnable() { - @Override - public void run() { - if (image != null) { - image.dispose(); - image = null; - } - - Image imageRotary = imageRegistry.getSkinImage( - rotationId, SkinImageType.DISPLAY_ROTARY_IMAGE); - if (imageRotary != null) { - image = SkinUtil.createScaledImage( - parent.getDisplay(), imageRotary, rotationId, scale); - } - - redraw(); - } - }); - } - - private void addListeners() { - /* rendering */ - this.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - if (image != null) { - final int imageHalfW = getImage().getImageData().width / 2; - final int imageHalfH = getImage().getImageData().height / 2; - - Transform transform = new Transform(parent.getDisplay()); - transform.translate(imageHalfW, imageHalfH); - transform.rotate(degrees); - e.gc.setTransform(transform); - - e.gc.drawImage(getImage(), -imageHalfW, -imageHalfH); - - transform.dispose(); - } - } - }); - - /* controlling */ - this.addMouseMoveListener(new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (grabPosition.x >= 0 && grabPosition.y >= 0 && - e.button == 0/* left button */) { - final int angle = SkinUtil.getAngleFromVector(Rotary.this, e.x, e.y); - int delta = angle - angleDelta; - degrees += delta; - - if (delta != 0) { - if (delta < -180) { /* 359 -> 0 */ - delta += 360; - } else if (delta > 180) { /* 0 -> 359 */ - delta -= 360; - } - - /* send to qemu */ - communicator.sendToQEMU(SendCommand.SEND_ROTARY_EVENT, - new RotaryEventData(0, delta), false); - - redraw(); - } - - angleDelta = angle; - } - } - }); - - this.addMouseListener(new MouseListener() { - public void mouseDown(MouseEvent e) { - if (1 == e.button) { /* left button */ - grabPosition.x = e.x; - grabPosition.y = e.y; - angleDelta = SkinUtil.getAngleFromVector(Rotary.this, e.x, e.y); - } - } - - public void mouseUp(MouseEvent e) { - if (e.button == 1) { /* left button */ - grabPosition.x = -1; - grabPosition.y = -1; - angleDelta = 0; - } - } - - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }); - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java deleted file mode 100644 index 8fa006c976..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * General Skin Frame Maker - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.layout; - -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SwtUtil; - -public class SkinPatches { - private Logger logger = - SkinLogger.getSkinLogger(SkinPatches.class).getLogger(); - - private Display display; - private int patchWidth; - private int patchHeight; - - /* nine patches */ - private Image imageLT; /* left-top */ - private Image imageT; /* middle-top */ - private Image imageRT; /* right-top */ - - private Image imageL; - private Image imageR; - - private Image imageLB; /* left-bottom */ - private Image imageB; - private Image imageRB; - - /** - * Constructor - */ - public SkinPatches( - Image leftTop, Image middleTop, Image rightTop, - Image leftMiddle, Image rightMiddle, - Image leftBottom, Image middleBottom, Image rightBottom) { - this.display = Display.getCurrent(); - - imageLT = leftTop; - imageT = middleTop; - imageRT = rightTop; - - imageL = leftMiddle; - imageR = rightMiddle; - - imageLB = leftBottom; - imageB = middleBottom; - imageRB = rightBottom; - - // TODO: configurable - this.patchWidth = imageLT.getImageData().width; - this.patchHeight = imageLT.getImageData().height; - logger.info("patch size : " + patchWidth + "x" + patchHeight); - } - - public int getPatchWidth() { - return patchWidth; - } - - public int getPatchHeight() { - return patchHeight; - } - - public Image getPatchedImage(int centerPatchWidth, int centerPatchHeight) { - int patchedImageWidth = (patchWidth * 2) + centerPatchWidth; - int patchedImageHeight = (patchHeight * 2) + centerPatchHeight; - - ImageData imageData = new ImageData( - patchedImageWidth, patchedImageHeight, 32, - new PaletteData(0xFF000000, 0x00FF0000, 0x0000FF00)); - imageData.transparentPixel = 0; - Image patchedImage = new Image(display, imageData); - - GC gc = new GC(patchedImage); - if (SwtUtil.isLinuxPlatform() == false) { - /* SWT works differently. So, we need a color key */ - gc.setBackground(display.getSystemColor(SWT.COLOR_MAGENTA)); - gc.fillRectangle(0, 0, patchedImageWidth, patchedImageHeight); - } - - /* top side */ - // TODO: copy alphaData - gc.drawImage(imageLT, 0, 0); - gc.drawImage(imageT, 0, 0, imageT.getImageData().width, imageT.getImageData().height, - patchWidth, 0, centerPatchWidth, patchHeight); - gc.drawImage(imageRT, patchWidth + centerPatchWidth, 0); - - /* middle side */ - gc.drawImage(imageL, 0, 0, imageL.getImageData().width, imageL.getImageData().height, - 0, patchHeight, patchWidth, centerPatchHeight); - gc.setBackground(new Color(display, new RGB(38, 38, 38))); - gc.fillRectangle(patchWidth, patchHeight, centerPatchWidth, centerPatchHeight); /* center */ - gc.drawImage(imageR, 0, 0, imageR.getImageData().width, imageR.getImageData().height, - patchWidth + centerPatchWidth, patchHeight, patchWidth, centerPatchHeight); - - /* bottom side */ - gc.drawImage(imageLB, 0, patchHeight + centerPatchHeight); - gc.drawImage(imageB, 0, 0, imageB.getImageData().width, imageB.getImageData().height, - patchWidth, patchHeight + centerPatchHeight, centerPatchWidth, patchHeight); - gc.drawImage(imageRB, patchWidth + centerPatchWidth, patchHeight + centerPatchHeight); - - gc.dispose(); - - return patchedImage; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/rotation/Rotation.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/rotation/Rotation.java deleted file mode 100644 index b441083e98..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/rotation/Rotation.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Rotation Information - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.layout.rotation; - -import java.util.List; - -import org.tizen.emulator.skin.dbi.KeyMapListType; -import org.tizen.emulator.skin.dbi.KeyMapType; -import org.tizen.emulator.skin.dbi.RotationType; - - -public class Rotation extends RotationType { - private int angle; - private List<KeyMapType> listHWKey; - - public int getAngle() { - return angle; - } - - public void setAngle(int degree) { - this.angle = degree; - } - - public List<KeyMapType> getListHWKey() { - if (listHWKey == null) { - KeyMapListType list = getKeyMapList(); - if (list == null) { - /* try to using a KeyMapList of portrait */ - Rotation rotation = SkinRotations.getRotation(SkinRotations.PORTRAIT_ID); - if (rotation == null) { - return null; - } - - list = rotation.getKeyMapList(); - if (list == null) { - return null; - } - } - - listHWKey = list.getKeyMap(); - } - - return listHWKey; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/rotation/SkinRotations.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/rotation/SkinRotations.java deleted file mode 100644 index 2818ae0327..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/rotation/SkinRotations.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Rotation Informations - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.layout.rotation; - -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; - -import org.tizen.emulator.skin.dbi.RotationNameType; -import org.tizen.emulator.skin.dbi.RotationType; - -/** - * - * - */ -public class SkinRotations { - public static final short PORTRAIT_ID = 0; - public static final short LANDSCAPE_ID = 1; - public static final short REVERSE_PORTRAIT_ID = 2; - public static final short REVERSE_LANDSCAPE_ID = 3; - - private static Map<Short, Rotation> rotationMap = - new LinkedHashMap<Short, Rotation>(); - - private SkinRotations() { - /* do nothing */ - } - - public static void put(RotationType rotationType) { - Rotation rotation = new Rotation(); - rotation.setName(rotationType.getName()); - rotation.setDisplay(rotationType.getDisplay()); - rotation.setImageList(rotationType.getImageList()); - rotation.setKeyMapList(rotationType.getKeyMapList()); - - if (RotationNameType.PORTRAIT.value() - .equalsIgnoreCase(rotationType.getName().value())) - { - rotation.setAngle(0); - rotationMap.put(PORTRAIT_ID, rotation); - } - else if (RotationNameType.LANDSCAPE.value() - .equalsIgnoreCase(rotationType.getName().value())) - { - rotation.setAngle(-90); - rotationMap.put(LANDSCAPE_ID, rotation); - } - else if (RotationNameType.REVERSE_PORTRAIT.value() - .equalsIgnoreCase(rotationType.getName().value())) - { - rotation.setAngle(180); - rotationMap.put(REVERSE_PORTRAIT_ID, rotation); - } - else if (RotationNameType.REVERSE_LANDSCAPE.value() - .equalsIgnoreCase(rotationType.getName().value())) - { - rotation.setAngle(90); - rotationMap.put(REVERSE_LANDSCAPE_ID, rotation); - } - } - - public static Rotation getRotation(Short rotationId) { - return rotationMap.get(rotationId); - } - - public static int getAngle(Short rotationId) { - Rotation rotation = rotationMap.get(rotationId); - if (rotation == null) { - return 0; - } - - return rotation.getAngle(); - } - - public static Iterator<Entry<Short, Rotation>> getRotationIterator() { - return rotationMap.entrySet().iterator(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java deleted file mode 100644 index 10c2487e91..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java +++ /dev/null @@ -1,261 +0,0 @@ -/** - * Log Management - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.log; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.FileHandler; -import java.util.logging.Formatter; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import java.util.logging.Logger; - -import org.tizen.emulator.skin.EmulatorSkinMain; -import org.tizen.emulator.skin.util.StringUtil; - -/** - * - * - */ -public class SkinLogger { - public static final String LOG_FOLDER = "logs"; - - public enum SkinLogLevel { - ERROR(Level.SEVERE, "error"), - WARN(Level.WARNING, "warn"), - DEBUG(Level.INFO, "debug"), - TRACE(Level.FINE, "trace"); - - private Level level; - private String value; - - private SkinLogLevel(Level level, String value) { - this.level = level; - this.value = value; - } - - public Level level() { - return this.level; - } - - public String value() { - return this.value; - } - } - - private static final String FILE_NAME = "emulator-skin.log"; - - private static FileHandler fileHandler; - private static boolean isInit; - private static Map<Class<?>, SkinLogger> loggerMap = new HashMap<Class<?>, SkinLogger>(); - - private Logger logger; - - /** - * Constructor - */ - private SkinLogger(Logger logger) { - this.logger = logger; - } - - public Logger getLogger() { - return this.logger; - } - - public static void setLevel(Level level) { - if (null != fileHandler) { - fileHandler.setLevel(level); - } - } - - public static void init(SkinLogLevel logLevel, String filePath) { - if (!isInit) { - isInit = true; - - String path = ""; - - if (!StringUtil.isEmpty(filePath)) { - path = filePath + File.separator; - } - - File dir = new File(path + LOG_FOLDER); - if (dir.mkdir() == false) { - /* do nothing */ - } - - /* delete .lck files after abnormal skin termination */ - File[] listFiles = dir.listFiles(); - if (listFiles != null) { - for (File f : listFiles) { - String name = f.getName(); - - if (!FILE_NAME.equals(name) && name.startsWith(FILE_NAME)) { - if (f.delete() == false) { - /* do nothing */ - } - } - } - } - - File file = new File(dir + File.separator + FILE_NAME); - if (!file.exists()) { - try { - if(!file.createNewFile()) { - System.err.println("[SkinLog:error] " - + "Cannot create skin log file. path : " + file.getAbsolutePath()); - - EmulatorSkinMain.terminateImmediately(-1); - return; - } - } catch (IOException e) { - e.printStackTrace(); - - EmulatorSkinMain.terminateImmediately(-1); - return; - } - } - - try { - fileHandler = new FileHandler(file.getAbsolutePath(), false); - } catch (SecurityException e1) { - e1.printStackTrace(); - } catch (IOException e1) { - e1.printStackTrace(); - } - - try { - fileHandler.setEncoding("UTF-8"); - } catch (SecurityException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - fileHandler.setFormatter(new SkinFormatter()); - fileHandler.setLevel(logLevel.level()); - } - } - - public static void end() { - loggerMap.clear(); - } - - public static <T> SkinLogger getSkinLogger(Class<T> clazz) { - String name = null; - - if (null == clazz) { - name = SkinLogger.class.getName(); - } else { - name = clazz.getName(); - } - - SkinLogger skinLogger = loggerMap.get(clazz); - - if (null != skinLogger) { - return skinLogger; - } else { - Logger logger = Logger.getLogger(name); - if (logger == null) { - logger = Logger.getAnonymousLogger(); - } - - logger.addHandler(fileHandler); - logger.setLevel(fileHandler.getLevel()); - logger.setUseParentHandlers(false); - - SkinLogger sLogger = new SkinLogger(logger); - loggerMap.put(clazz, sLogger); - - return sLogger; - } - } -} - -class SkinFormatter extends Formatter { - private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss"); - private String lineSeparator = System.getProperty("line.separator"); - - @Override - public String format(LogRecord record) { - StringBuilder builder = new StringBuilder(); - - builder.append("["); - builder.append(record.getLevel().toString()); - builder.append(":"); - - String formattedDate = simpleDateFormat.format(new Date(record.getMillis())); - builder.append(formattedDate); - builder.append(":"); - - if (null != record.getSourceClassName()) { - String sourceClassName = record.getSourceClassName(); - String[] split = sourceClassName.split("\\."); - builder.append(split[split.length - 1]); - } else { - builder.append(record.getLoggerName()); - } - - if (null != record.getSourceMethodName()) { - builder.append("."); - builder.append(record.getSourceMethodName()); - } - - builder.append("] "); - - String message = formatMessage(record); - builder.append(message); - - builder.append(lineSeparator); - - if (null != record.getThrown()) { - try { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - - record.getThrown().printStackTrace(pw); - pw.close(); - - builder.append(sw.toString()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - return builder.toString(); - } -} - diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/GeneralKeyWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/GeneralKeyWindow.java deleted file mode 100644 index 85266e695a..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/GeneralKeyWindow.java +++ /dev/null @@ -1,560 +0,0 @@ -/** - * General Key Window - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.menu; - -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.ShellEvent; -import org.eclipse.swt.events.ShellListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -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.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.data.KeyEventData; -import org.tizen.emulator.skin.custom.ColorTag; -import org.tizen.emulator.skin.custom.CustomButton; -import org.tizen.emulator.skin.custom.CustomScrolledComposite; -import org.tizen.emulator.skin.custom.SkinWindow; -import org.tizen.emulator.skin.dbi.KeyMapType; -import org.tizen.emulator.skin.image.GeneralKeyWindowImageRegistry; -import org.tizen.emulator.skin.image.GeneralKeyWindowImageRegistry.GeneralKeyWindowImageName; -import org.tizen.emulator.skin.layout.SkinPatches; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class GeneralKeyWindow extends SkinWindow { - private static final int SHELL_MARGIN_BOTTOM = 3; - private static final int PAIRTAG_CIRCLE_SIZE = 8; - private static final int PAIRTAG_MARGIN_BOTTOM = 6; - private static final int BUTTON_DEFAULT_CNT = 4; - private static final int BUTTON_VERTICAL_SPACING = 7; - private static final int SCROLLBAR_HORIZONTAL_SPACING = 4; - private static final int SCROLLBAR_SIZE_WIDTH = 14; - - private EmulatorSkin skin; - private SkinPatches frameMaker; - - private int widthBase; - private int heightBase; - private int widthScrollbar; - private int cntHiddenButton; - - private Image imageNormal; /* ImageButton image */ - private Image imageHover; /* hovered ImageButton image */ - private Image imagePushed; /* pushed ImageButton image */ - private Image imageFrame; /* nine-patch image */ - - private Color colorFrame; - private GeneralKeyWindowImageRegistry imageRegistry; - private List<KeyMapType> keyMapList; - - private ShellListener shellListener; - private PaintListener shellPaintListener; - private MouseMoveListener shellMouseMoveListener; - private MouseListener shellMouseListener; - - private boolean isGrabbedShell; - private Point grabPosition; - - public GeneralKeyWindow(EmulatorSkin skin, - GeneralKeyWindowImageRegistry imageRegstry, List<KeyMapType> keyMapList) { - super(skin.getShell(), KeyWindowKeeper.DEFAULT_DOCK_POSITION); - - this.skin = skin; - this.parent = skin.getShell(); - this.shell = new Shell(parent.getDisplay() /* for Mac & Always on Top */, - SWT.NO_TRIM | SWT.RESIZE | SWT.TOOL | SWT.NO_FOCUS); - - this.imageRegistry = imageRegstry; - this.frameMaker = new SkinPatches( - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_LT), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_T), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_RT), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_L), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_R), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_LB), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_B), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYWINDOW_PATCH_RB)); - - this.keyMapList = keyMapList; - this.grabPosition = new Point(0, 0); - - shell.setText(parent.getText()); - shell.setImage(parent.getImage()); /* icon */ - - /* load image for HW key button */ - imageNormal = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYBUTTON_NORMAL); - imageHover = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYBUTTON_HOVER); - imagePushed = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.KEYBUTTON_PUSHED); - - /* calculate the key window size */ - int cntButton = BUTTON_DEFAULT_CNT; - if (keyMapList != null) { - cntButton = Math.min(keyMapList.size(), cntButton); - } - - widthBase = imageNormal.getImageData().width; - heightBase = (imageNormal.getImageData().height * cntButton) + - (BUTTON_VERTICAL_SPACING * (cntButton - 1)); - - widthScrollbar = SCROLLBAR_SIZE_WIDTH + SCROLLBAR_HORIZONTAL_SPACING; - final int heightHeaderPart = PAIRTAG_CIRCLE_SIZE + PAIRTAG_MARGIN_BOTTOM; - final int heightTailPart = SHELL_MARGIN_BOTTOM; - - /* make a frame image */ - if (keyMapList != null) { - this.cntHiddenButton = keyMapList.size() - cntButton; - } - - this.imageFrame = frameMaker.getPatchedImage( - widthBase + ((cntHiddenButton > 0) ? widthScrollbar : 0), - heightBase + heightHeaderPart + heightTailPart); - this.colorFrame = new Color(shell.getDisplay(), new RGB(38, 38, 38)); - - shell.setBackground(colorFrame); - - createContents(); - - trimWindow(); - - addKeyWindowListener(); - - shell.setSize(imageFrame.getImageData().width, - imageFrame.getImageData().height); - } - - protected void createContents() { - GridLayout shellGridLayout = new GridLayout(1, false); - shellGridLayout.marginLeft = shellGridLayout.marginRight = frameMaker.getPatchWidth(); - shellGridLayout.marginTop = frameMaker.getPatchHeight(); - shellGridLayout.marginBottom = frameMaker.getPatchHeight() + SHELL_MARGIN_BOTTOM; - shellGridLayout.marginWidth = shellGridLayout.marginHeight = 0; - shellGridLayout.horizontalSpacing = shellGridLayout.verticalSpacing = 0; - - shell.setLayout(shellGridLayout); - - /* make a pair tag circle */ - ColorTag pairTagCanvas = new ColorTag(shell, SWT.NONE, skin.getColorVM()); - pairTagCanvas.setLayoutData(new GridData(PAIRTAG_CIRCLE_SIZE, - PAIRTAG_CIRCLE_SIZE + PAIRTAG_MARGIN_BOTTOM)); - - /* make a region of HW keys */ - if (cntHiddenButton > 0) { - /* added custom scrollbar */ - Image imagesScrollArrowUp[] = new Image[3]; - Image imagesScrollArrowDown[] = new Image[3]; - - imagesScrollArrowUp[0] = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_UPBUTTON_NORMAL); - imagesScrollArrowUp[1] = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_UPBUTTON_HOVER); - imagesScrollArrowUp[2] = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_UPBUTTON_PUSHED); - - imagesScrollArrowDown[0] = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_DOWNBUTTON_NORMAL); - imagesScrollArrowDown[1] = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_DOWNBUTTON_HOVER); - imagesScrollArrowDown[2] = imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_DOWNBUTTON_PUSHED); - - CustomScrolledComposite compositeScroll = - new CustomScrolledComposite(shell, SWT.NONE, - imagesScrollArrowUp, imagesScrollArrowDown, - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_THUMB), - imageRegistry.getKeyWindowImage( - GeneralKeyWindowImageName.SCROLL_SHAFT)); - compositeScroll.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1)); - - Composite compositeBase = new Composite(compositeScroll, SWT.NONE); - - createHwKeys(compositeBase); - - Point sizeContent = compositeBase.computeSize( - widthBase + widthScrollbar, heightBase); - compositeScroll.setContent(compositeBase, sizeContent); - compositeScroll.setExpandHorizontal(true); - compositeScroll.setExpandVertical(true); - - sizeContent.y += (imageNormal.getImageData().height * cntHiddenButton) + - (BUTTON_VERTICAL_SPACING * cntHiddenButton); - compositeScroll.setMinSize(sizeContent); - } else { - ScrolledComposite compositeScroll = new ScrolledComposite(shell, SWT.V_SCROLL); - compositeScroll.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1)); - - Composite compositeBase = new Composite(compositeScroll, SWT.NONE); - createHwKeys(compositeBase); - - compositeScroll.setContent(compositeBase); - compositeScroll.setExpandHorizontal(true); - compositeScroll.setExpandVertical(true); - - compositeScroll.setMinSize( - compositeBase.computeSize(SWT.DEFAULT, SWT.DEFAULT)); - } - } - - protected void createHwKeys(Composite composite) { - composite.setBackground(colorFrame); - - GridLayout compositeGridLayout = new GridLayout(1, false); - compositeGridLayout.marginLeft = compositeGridLayout.marginRight = 0; - compositeGridLayout.marginTop = compositeGridLayout.marginBottom = 0; - compositeGridLayout.marginWidth = compositeGridLayout.marginHeight = 0; - compositeGridLayout.horizontalSpacing = 0; - compositeGridLayout.verticalSpacing = BUTTON_VERTICAL_SPACING; - composite.setLayout(compositeGridLayout); - - /* attach HW keys */ - if (keyMapList != null && keyMapList.isEmpty() == false) { - for (KeyMapType keyEntry : keyMapList) { - final CustomButton HWKeyButton = new CustomButton(composite, - SWT.NO_FOCUS, imageNormal, imageHover, imagePushed); - HWKeyButton.setText(keyEntry.getEventInfo().getKeyName()); - HWKeyButton.setToolTipText(keyEntry.getTooltip()); - HWKeyButton.setBackground(colorFrame); - HWKeyButton.setLayoutData(new GridData(imageNormal.getImageData().width, - imageNormal.getImageData().height)); - - final int keycode = keyEntry.getEventInfo().getKeyCode(); - HWKeyButton.addMouseListener(new MouseListener() { - @Override - public void mouseDown(MouseEvent e) { - logger.info(HWKeyButton.getText() + " key is pressed"); - - KeyEventData keyEventData = new KeyEventData( - KeyEventType.PRESSED.value(), keycode, 0, 0); - skin.communicator.sendToQEMU( - SendCommand.SEND_HW_KEY_EVENT, keyEventData, false); - } - - @Override - public void mouseUp(MouseEvent e) { - logger.info(HWKeyButton.getText() + " key is released"); - - KeyEventData keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), keycode, 0, 0); - skin.communicator.sendToQEMU( - SendCommand.SEND_HW_KEY_EVENT, keyEventData, false); - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }); - } - } - } - - private static Region getTrimmedRegion(Image image) { - if (null == image) { - return null; - } - - ImageData imageData = image.getImageData(); - int width = imageData.width; - int height = imageData.height; - - Region region = new Region(); - region.add(new Rectangle(0, 0, width, height)); - - Display display = Display.getDefault(); - int r = display.getSystemColor(SWT.COLOR_MAGENTA).getRed(); - int g = display.getSystemColor(SWT.COLOR_MAGENTA).getGreen(); - int b = display.getSystemColor(SWT.COLOR_MAGENTA).getBlue(); - int colorKey = 0; - - if (SwtUtil.isWindowsPlatform()) { - colorKey = r << 24 | g << 16 | b << 8; - } else { - colorKey = r << 16 | g << 8 | b; - } - - int j = 0; - for (int i = 0; i < width; i++) { - for (j = 0; j < height; j++) { - int colorPixel = imageData.getPixel(i, j); - if (colorPixel == colorKey /* magenta */) { - region.subtract(i, j, 1, 1); - } - } - } - - return region; - } - - protected void trimWindow() { - /* make window region */ - Region region = (SwtUtil.isLinuxPlatform() == false) ? - getTrimmedRegion(imageFrame) : /* color key */ - SkinUtil.getTrimmedRegion(imageFrame); - - /* custom window shape */ - if (region != null) { - shell.setRegion(region); - } - } - - private void addKeyWindowListener() { - shellPaintListener = new PaintListener() { - @Override - public void paintControl(final PaintEvent e) { - if (imageFrame != null) { - e.gc.drawImage(imageFrame, 0, 0); - } - } - }; - - shell.addPaintListener(shellPaintListener); - - shellListener = new ShellListener() { - @Override - public void shellClosed(ShellEvent event) { - logger.info("General Key Window is closed"); - - dispose(); - } - - @Override - public void shellActivated(ShellEvent event) { - logger.info("activate"); - - if (SwtUtil.isMacPlatform() == true) { - if (parent.isDisposed() == false) { - parent.moveAbove(shell); - } - } else { - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - parent.setActive(); - } - }); - } - } - - @Override - public void shellDeactivated(ShellEvent event) { - logger.info("deactivate"); - - /* do nothing */ - } - - @Override - public void shellIconified(ShellEvent event) { - /* do nothing */ - } - - @Override - public void shellDeiconified(ShellEvent event) { - logger.info("deiconified"); - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (parent.getMinimized() == true) { - parent.setMinimized(false); - } - } - }); - } - }; - - shell.addShellListener(shellListener); - - shellMouseMoveListener = new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (isGrabbedShell == true && e.button == 0/* left button */) { - if (getDockPosition() != SWT.NONE) { - dock(SWT.NONE, false, false); - shell.moveAbove(parent); - } - - /* move a window */ - Point previousLocation = shell.getLocation(); - int x = previousLocation.x + (e.x - grabPosition.x); - int y = previousLocation.y + (e.y - grabPosition.y); - - shell.setLocation(x, y); - return; - } - } - }; - - shell.addMouseMoveListener(shellMouseMoveListener); - - shellMouseListener = new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - if (e.button == 1) { /* left button */ - isGrabbedShell = false; - grabPosition.x = grabPosition.y = 0; - - /* Let me check whether the key window was landed - * on docking area. */ - Rectangle parentBounds = parent.getBounds(); - Rectangle childBounds = shell.getBounds(); - - int heightOneThird = parentBounds.height / 3; - int widthDockingArea = 30; - int widthIntersectRegion = 5; - - /* right-middle */ - Rectangle attachBoundsRC = new Rectangle( - (parentBounds.x + parentBounds.width) - widthIntersectRegion, - parentBounds.y + heightOneThird, - widthDockingArea, heightOneThird); - /* right-top */ - Rectangle attachBoundsRT = new Rectangle( - (parentBounds.x + parentBounds.width) - widthIntersectRegion, - parentBounds.y, - widthDockingArea, heightOneThird); - /* right-bottom */ - Rectangle attachBoundsRB = new Rectangle( - (parentBounds.x + parentBounds.width) - widthIntersectRegion, - parentBounds.y + (heightOneThird * 2), - widthDockingArea, heightOneThird); - - /* 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(attachBoundsRT) == true) { - dock(SWT.RIGHT | SWT.TOP, false, 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); - } - } - } - - @Override - public void mouseDown(MouseEvent e) { - if (1 == e.button) { /* left button */ - isGrabbedShell = true; - grabPosition.x = e.x; - grabPosition.y = e.y; - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }; - - shell.addMouseListener(shellMouseListener); - - if (SwtUtil.isWindowsPlatform() == false) { - /* keep window region while OS theme changing */ - shell.getDisplay().addListener(SWT.Settings, new Listener() { - @Override - public void handleEvent(Event e) { - trimWindow(); - } - }); - } - } - - private void dispose() { - if (null != shellPaintListener) { - shell.removePaintListener(shellPaintListener); - } - - if (null != shellListener) { - shell.removeShellListener(shellListener); - } - - if (null != shellMouseMoveListener) { - shell.removeMouseMoveListener(shellMouseMoveListener); - } - - if (null != shellMouseListener) { - shell.removeMouseListener(shellMouseListener); - } - - colorFrame.dispose(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/KeyWindowKeeper.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/KeyWindowKeeper.java deleted file mode 100644 index 6342540572..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/KeyWindowKeeper.java +++ /dev/null @@ -1,272 +0,0 @@ -/** - * Key Window Controller - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.menu; - -import java.util.List; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.custom.SkinWindow; -import org.tizen.emulator.skin.dbi.KeyMapType; -import org.tizen.emulator.skin.image.GeneralKeyWindowImageRegistry; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SkinUtil; - -public class KeyWindowKeeper { - public static final int DEFAULT_DOCK_POSITION = (SWT.RIGHT | SWT.CENTER); - - private static Logger logger = - SkinLogger.getSkinLogger(KeyWindowKeeper.class).getLogger(); - - private EmulatorSkin skin; - private SkinWindow keyWindow; - private int recentlyDocked; - private int indexLayout; - - private GeneralKeyWindowImageRegistry imageRegstry; - - /** - * Constructor - */ - public KeyWindowKeeper(EmulatorSkin skin) { - this.skin = skin; - this.recentlyDocked = SWT.NONE; - this.indexLayout = -1; - this.imageRegstry = null; - } - - public void openKeyWindow(int dockValue, boolean recreate) { - if (getKeyWindow() != null) { - if (recreate == false) { - /* show the Key Window */ - selectKeyWindowMenu(skin.isKeyWindow = true); - - keyWindow.getShell().setVisible(true); - SkinUtil.setTopMost(keyWindow.getShell(), skin.isOnTop); - - skin.updateSkin(); - - return; - } else { - logger.info("recreate a keywindow"); - closeKeyWindow(); - } - } - - /* create a Key Window */ - determineLayout(); - - if (isGeneralKeyWindow() == true) { - if (imageRegstry == null) { - logger.warning("GeneralKeyWindowImageRegistry is null"); - return; - } - - List<KeyMapType> keyMapList = SkinUtil.getHWKeyMapList( - skin.getEmulatorSkinState().getCurrentRotationId()); - - if (keyMapList == null) { - logger.info("keyMapList is null"); - - selectKeyWindowMenu(skin.isKeyWindow = false); - return; - } else if (keyMapList.isEmpty() == true) { - logger.info("keyMapList is empty"); - - selectKeyWindowMenu(skin.isKeyWindow = false); - return; - } - - keyWindow = new GeneralKeyWindow(skin, imageRegstry, keyMapList); - } else { - Menu keywindowMenu = skin.getPopupMenu().keyWindowItem.getMenu(); - MenuItem layout = keywindowMenu.getItem(indexLayout); - if (layout == null) { - layout = keywindowMenu.getItem(0); - if (layout == null) { - return; - } - - layout.setSelection(true); - } - - String layoutName = layout.getText(); - logger.info("generate a \'" + layoutName + "\' key window!"); - - keyWindow = new SpecialKeyWindow(skin, layoutName); - } - - selectKeyWindowMenu(skin.isKeyWindow = true); - SkinUtil.setTopMost(keyWindow.getShell(), skin.isOnTop); - - keyWindow.open(dockValue); - - skin.updateSkin(); - } - - public void closeKeyWindow() { - selectKeyWindowMenu(skin.isKeyWindow = false); - - if (getKeyWindow() != null) { - keyWindow.getShell().close(); - keyWindow = null; - } - - skin.updateSkin(); - } - - public void hideKeyWindow() { - selectKeyWindowMenu(skin.isKeyWindow = false); - - if (getKeyWindow() != null) { - keyWindow.getShell().setVisible(false); - } - - skin.updateSkin(); - } - - public SkinWindow getKeyWindow() { - if (keyWindow != null && - keyWindow.getShell().isDisposed() == true) { - keyWindow = null; - } - - return keyWindow; - } - - public int getLayoutIndex() { - return indexLayout; - } - - public boolean isGeneralKeyWindow() { - return (getLayoutIndex() < 0); - } - - public int determineLayout() { - MenuItem keywindowItem = skin.getPopupMenu().keyWindowItem; - - if (keywindowItem != null && keywindowItem.getMenu() != null) { - logger.info("key window has a special layout"); - - indexLayout = 0; - - MenuItem[] layouts = keywindowItem.getMenu().getItems(); - for (int i = 0; i < layouts.length; i++) { - MenuItem layout = layouts[i]; - - if (layout.getSelection() == true) { - indexLayout = i; - - logger.info("the \'" + layout.getText() + - "\' layout is selected for key window"); - break; - } - } - } else { - logger.info("key window has a general layout"); - - indexLayout = -1; - - if (imageRegstry == null) { - imageRegstry = new GeneralKeyWindowImageRegistry( - skin.getShell().getDisplay()); - } - } - - return indexLayout; - } - - /* for Menu */ - public boolean isSelectKeyWindowMenu() { - MenuItem keywindowMenu = skin.getPopupMenu().keyWindowItem; - - if (keywindowMenu != null) { - if (isGeneralKeyWindow() == true) { - return keywindowMenu.getSelection(); - } else { - for (MenuItem layout : keywindowMenu.getMenu().getItems()) { - if (layout.getSelection() == true) { - return true; - } - } - } - } - - return false; - } - - public void selectKeyWindowMenu(boolean on) { - MenuItem keywindowMenu = skin.getPopupMenu().keyWindowItem; - - if (keywindowMenu != null) { - if (isGeneralKeyWindow() == true) { - keywindowMenu.setSelection(on); - } else { - MenuItem layout = keywindowMenu.getMenu().getItem(indexLayout); - if (layout != null) { - layout.setSelection(on); - } - } - } - } - - /* for docking */ - public void redock(boolean correction, boolean enableLogger) { - if (keyWindow != null) { - keyWindow.redock(correction, enableLogger); - } - } - - public int getDockPosition() { - if (keyWindow == null) { - return SWT.None; - } - - return keyWindow.getDockPosition(); - } - - public int getRecentlyDocked() { - return recentlyDocked; - } - - public void setRecentlyDocked(int dockValue) { - recentlyDocked = dockValue; - } - - public void dispose() { - closeKeyWindow(); - - if (imageRegstry != null) { - imageRegstry.dispose(); - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/PopupMenu.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/PopupMenu.java deleted file mode 100644 index 1bd07cc71f..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/PopupMenu.java +++ /dev/null @@ -1,674 +0,0 @@ -/** - * Right Click Popup Menu - * - * Copyright (C) 2013 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.menu; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.dbi.MenuItemType; -import org.tizen.emulator.skin.dbi.PopupMenuType; -import org.tizen.emulator.skin.dbi.ScaleItemType; -import org.tizen.emulator.skin.image.ImageRegistry; -import org.tizen.emulator.skin.image.ImageRegistry.IconName; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class PopupMenu { - public static final String TOPMOST_MENUITEM_NAME = "&Always On Top"; - public static final String ROTATE_MENUITEM_NAME = "&Rotate"; - public static final String SCALE_MENUITEM_NAME = "&Scale"; - public static final String INTERPOLATION_MENUITEM_NAME = "&Quality"; - public static final String KEYWINDOW_MENUITEM_NAME = "Contro&ller"; - public static final String ADVANCED_MENUITEM_NAME = "Ad&vanced"; - public static final String SCREENSHOT_MENUITEM_NAME = "&Screen Shot"; - public static final String HOSTKBD_MENUITEM_NAME = "&Host Keyboard"; - public static final String DIAGNOSIS_MENUITEM_NAME = "&Diagnosis"; - public static final String RAMDUMP_MENUITEM_NAME = "&Ram Dump"; - public static final String ABOUT_MENUITEM_NAME = "&About"; - public static final String FORCECLOSE_MENUITEM_NAME = "&Force Close"; - public static final String SDBSHELL_MENUITEM_NAME = "S&hell"; - public static final String ECP_MENUITEM_NAME = "Control &Panel"; - public static final String CLOSE_MENUITEM_NAME = "&Close"; - - private static Logger logger = - SkinLogger.getSkinLogger(PopupMenu.class).getLogger(); - - private EmulatorConfig config; - private EmulatorSkin skin; - private Shell shell; - private ImageRegistry imageRegistry; - private Menu contextMenu; - - /* default menu items */ - public MenuItem detailInfoItem; - public MenuItem onTopItem; - public MenuItem rotateItem; - public MenuItem scaleItem; - public MenuItem interpolationItem; - public MenuItem interpolationHighItem; - public MenuItem interpolationLowItem; - public MenuItem keyWindowItem; /* key window menu */ - public MenuItem advancedItem; /* advanced menu */ - public MenuItem screenshotItem; - public MenuItem hostKbdItem; - public MenuItem hostKbdOnItem; - public MenuItem hostKbdOffItem; - public MenuItem diagnosisItem; - public MenuItem ramdumpItem; - public MenuItem aboutItem; - public MenuItem forceCloseItem; - public MenuItem shellItem; - public MenuItem ecpItem; - public MenuItem closeItem; - - /** - * Constructor - */ - public PopupMenu(EmulatorConfig config, EmulatorSkin skin) { - this.config = config; - this.skin = skin; - this.shell = skin.getShell(); - this.imageRegistry = skin.getImageRegistry(); - - createMenu(); - } - - private void createMenu() { - logger.info("create a popup menu"); - - contextMenu = new Menu(shell); - - addMenuItems(contextMenu); - } - - private void addMenuItems(final Menu menu) { - PopupMenuType itemProperties = config.getDbiContents().getPopupMenu(); - - /* Emulator detail info menu */ - detailInfoItem = createDetailInfoItem(menu); - - if (detailInfoItem != null) { - new MenuItem(menu, SWT.SEPARATOR); - } - - /* Always on top menu */ - if (SwtUtil.isMacPlatform() == false) { /* not supported on mac */ - if (itemProperties == null || - itemProperties.getTopmostItem() == null) { - onTopItem = createOnTopItem(menu, TOPMOST_MENUITEM_NAME); - } else { - MenuItemType topmostMenuType = itemProperties.getTopmostItem(); - if (topmostMenuType.isVisible() == true) { - onTopItem = createOnTopItem(menu, - (topmostMenuType.getItemName().isEmpty()) ? - TOPMOST_MENUITEM_NAME : topmostMenuType.getItemName()); - } - } - } - - /* Rotate menu */ - if (itemProperties == null || - itemProperties.getRotateItem() == null) { - rotateItem = createRotateItem(menu, ROTATE_MENUITEM_NAME); - } else { - MenuItemType rotationMenuType = itemProperties.getRotateItem(); - if (rotationMenuType.isVisible() == true) { - rotateItem = createRotateItem(menu, - (rotationMenuType.getItemName().isEmpty()) ? - ROTATE_MENUITEM_NAME : rotationMenuType.getItemName()); - } else { - /* do not rotate */ - skin.getEmulatorSkinState().setCurrentRotationId(); - } - } - - /* Scale menu */ - if (itemProperties == null || - itemProperties.getScaleItem() == null) { - scaleItem = createScaleItem(menu, SCALE_MENUITEM_NAME, null); - } else { - ScaleItemType scaleMenuType = itemProperties.getScaleItem(); - if (scaleMenuType.isVisible() == true) { - String menuName = (scaleMenuType.getItemName().isEmpty()) ? - SCALE_MENUITEM_NAME : scaleMenuType.getItemName(); - - List<ScaleItemType.FactorItem> factors = scaleMenuType.getFactorItem(); - if (factors == null || factors.size() == 0) { - logger.info("create a predefined Scale menu"); - - scaleItem = createScaleItem(menu, menuName, null); - } else { - logger.info("create a custom Scale menu"); - - scaleItem = createScaleItem(menu, menuName, factors); - } - } else { - /* do not scaling */ - skin.getEmulatorSkinState().setCurrentScale(100); - } - } - - if (onTopItem != null || rotateItem != null || scaleItem != null) { - new MenuItem(menu, SWT.SEPARATOR); - } - - /* Advanced menu */ - Menu advancedSubMenu = new Menu(menu.getShell(), SWT.DROP_DOWN); - { - /* Key Window menu */ - if (itemProperties == null || - itemProperties.getKeywindowItem() == null) { - keyWindowItem = createKeyWindowItem(advancedSubMenu, KEYWINDOW_MENUITEM_NAME); - } else { - MenuItemType keywindowMenuType = itemProperties.getKeywindowItem(); - if (keywindowMenuType.isVisible() == true) { - keyWindowItem = createKeyWindowItem(advancedSubMenu, - (keywindowMenuType.getItemName().isEmpty()) ? - KEYWINDOW_MENUITEM_NAME : keywindowMenuType.getItemName()); - } - } - - /* Screen shot menu */ - screenshotItem = createScreenShotItem( - advancedSubMenu, SCREENSHOT_MENUITEM_NAME); - - /* VirtIO Keyboard menu */ - if (itemProperties == null || - itemProperties.getHostKeyboardItem() == null) { - hostKbdItem = createHostKbdItem(advancedSubMenu, HOSTKBD_MENUITEM_NAME); - } else { - MenuItemType hostKbdMenuType = itemProperties.getHostKeyboardItem(); - if (hostKbdMenuType.isVisible() == true) { - hostKbdItem = createHostKbdItem(advancedSubMenu, - (hostKbdMenuType.getItemName().isEmpty()) ? - HOSTKBD_MENUITEM_NAME : hostKbdMenuType.getItemName()); - } - } - - /* Diagnosis menu */ - if (SwtUtil.isLinuxPlatform()) { //TODO: windows - Menu diagnosisSubMenu = new Menu(advancedSubMenu.getShell(), SWT.DROP_DOWN); - { - /* Ram Dump menu */ - if (itemProperties == null || - itemProperties.getRamdumpItem() == null) { - ramdumpItem = createRamDumpItem(diagnosisSubMenu, RAMDUMP_MENUITEM_NAME); - } else { - MenuItemType ramdumpMenuType = itemProperties.getRamdumpItem(); - if (ramdumpMenuType.isVisible() == true) { - ramdumpItem = createRamDumpItem(diagnosisSubMenu, - (ramdumpMenuType.getItemName().isEmpty()) ? - RAMDUMP_MENUITEM_NAME : ramdumpMenuType.getItemName()); - } - } - } - - if (ramdumpItem != null) { - diagnosisItem = new MenuItem(advancedSubMenu, SWT.CASCADE); - diagnosisItem.setText(DIAGNOSIS_MENUITEM_NAME); - diagnosisItem.setImage(imageRegistry.getIcon(IconName.DIAGNOSIS)); - diagnosisItem.setMenu(diagnosisSubMenu); - } - } - - if (screenshotItem != null || hostKbdItem != null || diagnosisItem != null) { - new MenuItem(advancedSubMenu, SWT.SEPARATOR); - } - - /* About menu */ - aboutItem = createAboutItem( - advancedSubMenu, ABOUT_MENUITEM_NAME); - - /* Force close menu */ - if (itemProperties == null || - itemProperties.getForceCloseItem() == null) { - forceCloseItem = createForceCloseItem(advancedSubMenu, FORCECLOSE_MENUITEM_NAME); - } else { - MenuItemType closeMenuType = itemProperties.getForceCloseItem(); - if (closeMenuType.isVisible() == true) { - forceCloseItem = createForceCloseItem(advancedSubMenu, - (closeMenuType.getItemName().isEmpty()) ? - FORCECLOSE_MENUITEM_NAME : closeMenuType.getItemName()); - } - } - - int cnt = advancedSubMenu.getItemCount(); - if (cnt > 0) { - MenuItem endItem = advancedSubMenu.getItem(cnt - 1); - if (endItem != null && (endItem.getStyle() & SWT.SEPARATOR) != 0) { - logger.info("delete unnecessary separator"); - - endItem.dispose(); - } - } - - if (screenshotItem != null || hostKbdItem != null || diagnosisItem != null - || aboutItem != null || forceCloseItem != null) { - advancedItem = new MenuItem(menu, SWT.CASCADE); - advancedItem.setText(ADVANCED_MENUITEM_NAME); - advancedItem.setImage(imageRegistry.getIcon(IconName.ADVANCED)); - - advancedItem.setMenu(advancedSubMenu); - } - } - - /* Shell menu */ - if (itemProperties == null || - itemProperties.getShellItem() == null) { - shellItem = createShellItem(menu, SDBSHELL_MENUITEM_NAME); - } else { - MenuItemType shellMenuType = itemProperties.getShellItem(); - if (shellMenuType.isVisible() == true) { - shellItem = createShellItem(menu, - (shellMenuType.getItemName().isEmpty()) ? - SDBSHELL_MENUITEM_NAME : shellMenuType.getItemName()); - } - } - - /* Emulator Control Panel menu */ - if (itemProperties == null || - itemProperties.getControlPanelItem() == null) { - ecpItem = createEcpItem(menu, ECP_MENUITEM_NAME); - } else { - MenuItemType ecpMenuType = itemProperties.getControlPanelItem(); - if (ecpMenuType.isVisible() == true) { - ecpItem = createEcpItem(menu, - (ecpMenuType.getItemName().isEmpty()) ? - ECP_MENUITEM_NAME : ecpMenuType.getItemName()); - } - } - - if (keyWindowItem != null || advancedItem != null || - shellItem != null || ecpItem != null) { - new MenuItem(menu, SWT.SEPARATOR); - } - - /* Close menu */ - if (itemProperties == null || - itemProperties.getCloseItem() == null) { - closeItem = createCloseItem(menu, CLOSE_MENUITEM_NAME); - } else { - MenuItemType closeMenuType = itemProperties.getCloseItem(); - if (closeMenuType.isVisible() == true) { - closeItem = createCloseItem(menu, - (closeMenuType.getItemName().isEmpty()) ? - CLOSE_MENUITEM_NAME : closeMenuType.getItemName()); - } - } - - int cnt = menu.getItemCount(); - if (cnt > 0) { - MenuItem endItem = menu.getItem(cnt - 1); - if (endItem != null && (endItem.getStyle() & SWT.SEPARATOR) != 0) { - logger.info("delete unnecessary separator"); - - endItem.dispose(); - } - } - } - - private MenuItem createMenuItem(Menu menu, int style, - String name, Image image, SelectionAdapter listener, boolean selected) { - MenuItem item = new MenuItem(menu, style); - - if (name != null) { - item.setText(name); - } - - if (image != null) { - item.setImage(image); - } - - if (listener != null) { - item.addSelectionListener(listener); - } - - item.setSelection(selected); - - return item; - } - - private MenuItem createDetailInfoItem(Menu menu) { - return createMenuItem(menu, SWT.PUSH, - SkinUtil.makeEmulatorName(config), - imageRegistry.getIcon(IconName.DETAIL_INFO), - skin.createDetailInfoMenuListener(), - false); - } - - private MenuItem createOnTopItem(Menu menu, String name) { - return createMenuItem(menu, SWT.CHECK, - name, - null, - skin.createTopMostMenuListener(), - skin.isOnTop); - } - - private MenuItem createRotateItem(Menu menu, String name) { - MenuItem item = createMenuItem(menu, SWT.CASCADE, - name, - imageRegistry.getIcon(IconName.ROTATE), - null, - false); - - item.setMenu(skin.createRotateMenu()); - - return item; - } - - private MenuItem createScaleItem(Menu menu, String name, - List<ScaleItemType.FactorItem> factors) { - MenuItem item = createMenuItem(menu, SWT.CASCADE, - name, - imageRegistry.getIcon(IconName.SCALE), - null, - false); - - item.setMenu(createScaleSubItem(menu, factors)); - - return item; - } - - private Menu createScaleSubItem(Menu menu, - List<ScaleItemType.FactorItem> factors) { - SelectionAdapter scaleListener = - skin.createScaleMenuListener(); - - Menu subMenu = new Menu(menu.getShell(), SWT.DROP_DOWN); - - if (factors == null) { - /* use predefined factor array */ - ScaleItemType.FactorItem actual = new ScaleItemType.FactorItem(); - actual.setItemName("1x"); - actual.setValue(100); - - ScaleItemType.FactorItem threeQuater = new ScaleItemType.FactorItem(); - threeQuater.setItemName("3/4x"); - threeQuater.setValue(75); - - ScaleItemType.FactorItem half = new ScaleItemType.FactorItem(); - half.setItemName("1/2x"); - half.setValue(50); - - ScaleItemType.FactorItem quater = new ScaleItemType.FactorItem(); - quater.setItemName("1/4x"); - quater.setValue(25); - - factors = Arrays.asList(actual, threeQuater, half, quater); - } - - MenuItem matchedItem = null; - for (ScaleItemType.FactorItem factor : factors) { - String factorName = factor.getItemName(); - if (factorName == null || factorName.isEmpty()) { - factorName = factor.getValue() + "%"; - } - - final MenuItem factorItem = createMenuItem(subMenu, SWT.RADIO, - factorName, - null, - scaleListener, - false); - - factorItem.setData(factor.getValue()); - - if (skin.getEmulatorSkinState().getCurrentScale() - == (Integer) factorItem.getData()) { - matchedItem = factorItem; - } - } - - if (matchedItem == null) { - matchedItem = subMenu.getItem(0); - if (matchedItem == null) { - return null; - } - - skin.getEmulatorSkinState().setCurrentScale( - (Integer) matchedItem.getData()); - } - - matchedItem.setSelection(true); - - /* interpolation menu */ - interpolationItem = createInterpolationItem( - subMenu, INTERPOLATION_MENUITEM_NAME); - - return subMenu; - } - - private MenuItem createInterpolationItem(Menu menu, String name) { - MenuItem item = createMenuItem(menu, SWT.CASCADE, - name, null, null, false); - - item.setMenu(createInterpolationSubItem(menu)); - - return item; - } - - private Menu createInterpolationSubItem(Menu menu) { - SelectionAdapter interpolationListener = - skin.createInterpolationMenuListener(); - - Menu subMenu = new Menu(menu.getShell(), SWT.DROP_DOWN); - - interpolationHighItem = createMenuItem(subMenu, SWT.RADIO, - "High", null, - interpolationListener, - skin.isOnInterpolation); - - interpolationLowItem = createMenuItem(subMenu, SWT.RADIO, - "Low", null, - interpolationListener, - !skin.isOnInterpolation); - - return subMenu; - } - - private MenuItem createKeyWindowItem(Menu menu, String name) { - /* load Key Window layouts */ - String pathLayoutRoot = skin.skinInfo.getSkinPath() + - File.separator + SpecialKeyWindow.KEYWINDOW_LAYOUT_ROOT; - ArrayList<File> layouts = getKeyWindowLayoutList(pathLayoutRoot); - - MenuItem item = null; - if (layouts != null && layouts.size() != 0) { - item = createMenuItem(menu, SWT.CASCADE, - name, null, null, false); - - item.setMenu(createKeyWindowSubItem(menu, layouts)); - } else { /* no need to create sub menu for general key window */ - item = createMenuItem(menu, SWT.CHECK, - name, - null, - skin.createKeyWindowMenuListener(), - skin.isKeyWindow); - } - - return item; - } - - private Menu createKeyWindowSubItem(Menu menu, - ArrayList<File> layouts) { - SelectionAdapter keyWindowListener = - skin.createKeyWindowMenuListener(); - - Menu subMenu = new Menu(menu.getShell(), SWT.DROP_DOWN); - - for (int i = 0; i < layouts.size(); i++) { - File dir = layouts.get(i); - - createMenuItem(subMenu, SWT.CHECK, - dir.getName(), - null, - keyWindowListener, - (i == 0) ? true : false); - } - - return subMenu; - } - - private MenuItem createScreenShotItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - imageRegistry.getIcon(IconName.SCREENSHOT), - skin.createScreenshotMenuListener(), - false); - } - - private MenuItem createHostKbdItem(Menu menu, String name) { - MenuItem item = createMenuItem(menu, SWT.CASCADE, - name, - imageRegistry.getIcon(IconName.HOST_KBD), - null, - false); - - item.setMenu(createKbdSubItem(menu)); - - return item; - } - - private Menu createKbdSubItem(Menu menu) { - SelectionAdapter hostKbdListener = - skin.createHostKbdMenuListener(); - - Menu subMenu = new Menu(menu.getShell(), SWT.DROP_DOWN); - - hostKbdOnItem = createMenuItem(subMenu, SWT.RADIO, - "On", null, - hostKbdListener, - skin.isOnKbd); - - hostKbdOffItem = createMenuItem(subMenu, SWT.RADIO, - "Off", null, - hostKbdListener, - !skin.isOnKbd); - - return subMenu; - } - - private MenuItem createRamDumpItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - null, - skin.createRamdumpMenuListener(), - false); - } - - private MenuItem createAboutItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - imageRegistry.getIcon(IconName.ABOUT), - skin.createAboutMenuListener(), - false); - } - - private MenuItem createForceCloseItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - imageRegistry.getIcon(IconName.FORCE_CLOSE), - skin.createForceCloseMenuListener(), - false); - } - - private MenuItem createShellItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - imageRegistry.getIcon(IconName.SHELL), - skin.createShellMenuListener(), - false); - } - - private MenuItem createEcpItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - imageRegistry.getIcon(IconName.ECP), - skin.createEcpMenuListener(), - false); - } - - private MenuItem createCloseItem(Menu menu, String name) { - return createMenuItem(menu, SWT.PUSH, - name, - imageRegistry.getIcon(IconName.CLOSE), - skin.createCloseMenuListener(), - false); - } - - public Menu getMenuRoot() { - return contextMenu; - } - - private ArrayList<File> getKeyWindowLayoutList(String path) { - File pathRoot = new File(path); - - if (pathRoot.exists() == true) { - FileFilter filter = new FileFilter() { - @Override - public boolean accept(File pathname) { - if (!pathname.isDirectory()) { - return false; - } - - return true; - } - }; - - File[] layoutPaths = pathRoot.listFiles(filter); - if (layoutPaths == null || layoutPaths.length <= 0) { - logger.info("the layout of key window not found"); - return null; - } - - ArrayList<File> layoutList = new ArrayList<File>(); - for (File layout : layoutPaths) { - logger.info("the layout of key window detected : " + layout.getName()); - - layoutList.add(layout); - } - - return layoutList; - } - - return null; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/SpecialKeyWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/SpecialKeyWindow.java deleted file mode 100644 index c8f7367795..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/menu/SpecialKeyWindow.java +++ /dev/null @@ -1,521 +0,0 @@ -/** - * Special Key Window - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * Hyunjin Lee <hyunjin816.lee@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.menu; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.List; -import java.util.logging.Level; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.ShellEvent; -import org.eclipse.swt.events.ShellListener; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseButtonType; -import org.tizen.emulator.skin.comm.ICommunicator.MouseEventType; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator; -import org.tizen.emulator.skin.comm.sock.data.KeyEventData; -import org.tizen.emulator.skin.comm.sock.data.MouseEventData; -import org.tizen.emulator.skin.custom.SkinWindow; -import org.tizen.emulator.skin.exception.JaxbException; -import org.tizen.emulator.skin.image.SpecialKeyWindowImageRegistry; -import org.tizen.emulator.skin.image.SpecialKeyWindowImageRegistry.SpecailKeyWindowImageType; -import org.tizen.emulator.skin.keywindow.dbi.EventInfoType; -import org.tizen.emulator.skin.keywindow.dbi.KeyMapType; -import org.tizen.emulator.skin.keywindow.dbi.KeyWindowUI; -import org.tizen.emulator.skin.keywindow.dbi.RegionType; -import org.tizen.emulator.skin.layout.HWKey; -import org.tizen.emulator.skin.layout.HWKeyRegion; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.JaxbUtil; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class SpecialKeyWindow extends SkinWindow { - public static final String KEYWINDOW_LAYOUT_ROOT = "keywindow-layout"; - public static final String DBI_FILE_NAME = "default.dbi"; - - private SpecialKeyWindowImageRegistry imageRegistry; - private SocketCommunicator communicator; - - private KeyWindowUI dbiContents; - private Image keyWindowImage; - private Image keyWindowPressedImage; - - private ShellListener shellListener; - private PaintListener shellPaintListener; - private MouseMoveListener shellMouseMoveListener; - private MouseListener shellMouseListener; - - private boolean isGrabbedShell; - private Point grabPosition; - private HWKey currentPressedHWKey; - private boolean isTouch; - - public SpecialKeyWindow(EmulatorSkin skin, String layoutName) { - super(skin.getShell(), KeyWindowKeeper.DEFAULT_DOCK_POSITION); - - this.parent = skin.getShell(); - this.shell = new Shell(parent.getDisplay() /* for Mac & Always on Top */, - SWT.NO_TRIM | SWT.RESIZE | SWT.TOOL | SWT.NO_FOCUS); - this.communicator = skin.communicator; - - this.isGrabbedShell= false; - this.grabPosition = new Point(0, 0); - - shell.setText(parent.getText()); - shell.setBackground(parent.getBackground()); - shell.setImage(parent.getImage()); - - /* load dbi file */ - String skinPath = skin.skinInfo.getSkinPath(); - String specialKeyWindowPath = skinPath + File.separator - + KEYWINDOW_LAYOUT_ROOT + File.separator + layoutName; - logger.info("special key window path : " + specialKeyWindowPath); - - this.dbiContents = loadXMLForKeyWindow(specialKeyWindowPath); - - /* image init */ - this.imageRegistry = new SpecialKeyWindowImageRegistry( - shell.getDisplay(), dbiContents, specialKeyWindowPath); - - /* get keywindow image */ - //TODO: null - this.keyWindowImage = imageRegistry.getKeyWindowImage( - (short)0, SpecailKeyWindowImageType.SPECIAL_IMAGE_TYPE_NORMAL); - this.keyWindowPressedImage = imageRegistry.getKeyWindowImage( - (short)0, SpecailKeyWindowImageType.SPECIAL_IMAGE_TYPE_PRESSED); - - /* set window size */ - if (keyWindowImage != null) { - ImageData imageData = keyWindowImage.getImageData(); - shell.setSize(imageData.width, imageData.height); - } - - /* custom window shape */ - trimWindow(); - - addKeyWindowListener(); - } - - private KeyWindowUI loadXMLForKeyWindow(String skinPath) { - String dbiPath = skinPath + File.separator + DBI_FILE_NAME; - logger.info("load dbi file from " + dbiPath); - - FileInputStream fis = null; - KeyWindowUI keyWindowUI = null; - - try { - fis = new FileInputStream(dbiPath); - logger.info("============ dbi contents ============"); - byte[] bytes = IOUtil.getBytes(fis); - logger.info(new String(bytes, "UTF-8")); - logger.info("======================================="); - - keyWindowUI = JaxbUtil.unmarshal(bytes, KeyWindowUI.class); - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (JaxbException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } finally { - IOUtil.close(fis); - } - - return keyWindowUI; - } - - private HWKey getHWKey(int currentX, int currentY) { - List<KeyMapType> keyMapList = dbiContents.getKeyMapList().getKeyMap(); - if (keyMapList == null) { - return null; - } - - for (KeyMapType keyEntry : keyMapList) { - RegionType region = keyEntry.getRegion(); - - int scaledX = (int) region.getLeft(); - int scaledY = (int) region.getTop(); - int scaledWidth = (int) region.getWidth(); - int scaledHeight = (int) region.getHeight(); - - if (SkinUtil.isInGeometry(currentX, currentY, - scaledX, scaledY, scaledWidth, scaledHeight)) { - EventInfoType eventInfo = keyEntry.getEventInfo(); - - HWKey hwKey = new HWKey( - eventInfo.getKeyName(), - eventInfo.getKeyCode(), - new HWKeyRegion(scaledX, scaledY, scaledWidth, scaledHeight), - keyEntry.getTooltip()); - - return hwKey; - } - } - - return null; - } - - protected void trimWindow() { - Region region = SkinUtil.getTrimmedRegion(keyWindowImage); - if (region != null) { - shell.setRegion(region); - } - } - - private void addKeyWindowListener() { - shellPaintListener = new PaintListener() { - @Override - public void paintControl(final PaintEvent e) { - if (keyWindowImage != null) { - e.gc.drawImage(keyWindowImage, 0, 0); - } - } - }; - - shell.addPaintListener(shellPaintListener); - - shellListener = new ShellListener() { - @Override - public void shellClosed(ShellEvent event) { - logger.info("Special Key Window is closed"); - - dispose(); - } - - @Override - public void shellActivated(ShellEvent event) { - logger.info("activate"); - - if (SwtUtil.isMacPlatform() == true) { - if (parent.isDisposed() == false) { - parent.moveAbove(shell); - } - } else { - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - parent.setActive(); - } - }); - } - } - - @Override - public void shellDeactivated(ShellEvent event) { - logger.info("deactivate"); - - /* do nothing */ - } - - @Override - public void shellIconified(ShellEvent event) { - /* do nothing */ - } - - @Override - public void shellDeiconified(ShellEvent event) { - logger.info("deiconified"); - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (parent.getMinimized() == true) { - parent.setMinimized(false); - } - } - }); - } - }; - - shell.addShellListener(shellListener); - - shellMouseMoveListener = new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (isTouch == true) { - logger.info("mouseMove in KeyWindow : " + e.x + ", " + e.y); - - HWKey pressedHWKey = currentPressedHWKey; - int x = pressedHWKey.getRegion().x; - int y = pressedHWKey.getRegion().y; - int width = pressedHWKey.getRegion().width; - int height = pressedHWKey.getRegion().height; - //int eventType; - - if (SkinUtil.isInGeometry(e.x, e.y, x, y, width, height)) { - //eventType = MouseEventType.DRAG.value(); - } else { - isTouch = false; - //eventType = MouseEventType.RELEASE.value(); - /* rollback a keyPressed image region */ - shell.redraw(x, y, width, height, false); - } - - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.DRAG.value(), - e.x, e.y, e.x, e.y, 0); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - - return; - } else if (isGrabbedShell == true && e.button == 0/* left button */) { - if (getDockPosition() != SWT.NONE) { - dock(SWT.NONE, false, false); - shell.moveAbove(parent); - } - - /* move a window */ - Point previousLocation = shell.getLocation(); - int x = previousLocation.x + (e.x - grabPosition.x); - int y = previousLocation.y + (e.y - grabPosition.y); - - shell.setLocation(x, y); - - return; - } - } - }; - - shell.addMouseMoveListener(shellMouseMoveListener); - - shellMouseListener = new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - if (e.button == 1) { /* left button */ - isGrabbedShell = false; - grabPosition.x = grabPosition.y = 0; - - /* HW key handling */ - HWKey pressedHWKey = currentPressedHWKey; - if (pressedHWKey == null) { - logger.info("mouseUp in KeyWindow : " + e.x + ", " + e.y); - - /* Let me check whether the key window was landed - * on docking area. */ - Rectangle parentBounds = parent.getBounds(); - Rectangle childBounds = shell.getBounds(); - - int heightOneThird = parentBounds.height / 3; - int widthDockingArea = 30; - int widthIntersectRegion = 5; - - /* right-middle */ - Rectangle attachBoundsRC = new Rectangle( - (parentBounds.x + parentBounds.width) - widthIntersectRegion, - parentBounds.y + heightOneThird, - widthDockingArea, heightOneThird); - /* right-top */ - Rectangle attachBoundsRT = new Rectangle( - (parentBounds.x + parentBounds.width) - widthIntersectRegion, - parentBounds.y, - widthDockingArea, heightOneThird); - /* right-bottom */ - Rectangle attachBoundsRB = new Rectangle( - (parentBounds.x + parentBounds.width) - widthIntersectRegion, - parentBounds.y + (heightOneThird * 2), - widthDockingArea, heightOneThird); - - /* 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(attachBoundsRT) == true) { - dock(SWT.RIGHT | SWT.TOP, false, 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); - } - - return; - } - - if (pressedHWKey.getKeyCode() != SkinUtil.UNKNOWN_KEYCODE) { - logger.info(pressedHWKey.getName() + " key is released"); - - /* send event */ - if (isTouch) { - isTouch = false; - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.RELEASE.value(), - e.x, e.y, e.x, e.y, 0); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } else { - KeyEventData keyEventData = new KeyEventData( - KeyEventType.RELEASED.value(), pressedHWKey.getKeyCode(), 0, 0); - communicator.sendToQEMU( - SendCommand.SEND_HW_KEY_EVENT, keyEventData, false); - } - - currentPressedHWKey = null; - - /* rollback a keyPressed image resion */ - shell.redraw(pressedHWKey.getRegion().x, pressedHWKey.getRegion().y, - pressedHWKey.getRegion().width, pressedHWKey.getRegion().height, false); - } - } - } - - @Override - public void mouseDown(MouseEvent e) { - if (1 == e.button) { /* left button */ - /* HW key handling */ - final HWKey hwKey = getHWKey(e.x, e.y); - if (hwKey == null) { - logger.info("mouseDown in KeyWindow : " + e.x + ", " + e.y); - - isGrabbedShell = true; - grabPosition.x = e.x; - grabPosition.y = e.y; - - return; - } - - if (hwKey.getKeyCode() != SkinUtil.UNKNOWN_KEYCODE) { - logger.info(hwKey.getName() + " key is pressed"); - - /* send event */ - if (hwKey.getTooltip().equalsIgnoreCase("touch")) { - isTouch = true; - MouseEventData mouseEventData = new MouseEventData( - MouseButtonType.LEFT.value(), MouseEventType.PRESS.value(), - e.x, e.y, e.x, e.y, 0); - communicator.sendToQEMU( - SendCommand.SEND_MOUSE_EVENT, mouseEventData, false); - } else { - KeyEventData keyEventData = new KeyEventData( - KeyEventType.PRESSED.value(), hwKey.getKeyCode(), 0, 0); - communicator.sendToQEMU( - SendCommand.SEND_HW_KEY_EVENT, keyEventData, false); - } - - currentPressedHWKey = hwKey; - - shell.setToolTipText(null); - - /* draw the HW key region as the cropped keyPressed image area */ - if (hwKey.getRegion() != null && - hwKey.getRegion().width != 0 && hwKey.getRegion().height != 0) { - shell.getDisplay().syncExec(new Runnable() { - public void run() { - if (keyWindowPressedImage != null) { - GC gc = new GC(shell); - if (gc != null) { - gc.drawImage(keyWindowPressedImage, - hwKey.getRegion().x, hwKey.getRegion().y, - hwKey.getRegion().width, hwKey.getRegion().height, - hwKey.getRegion().x, hwKey.getRegion().y, - hwKey.getRegion().width, hwKey.getRegion().height); - gc.dispose(); - } - } - } /* end of run */ - }); - } - - } - } - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - }; - - shell.addMouseListener(shellMouseListener); - - /* keep window region while OS theme changing */ - shell.getDisplay().addListener(SWT.Settings, new Listener() { - @Override - public void handleEvent(Event e) { - trimWindow(); - } - }); - } - - private void dispose() { - if (null != shellPaintListener) { - shell.removePaintListener(shellPaintListener); - } - - if (null != shellListener) { - shell.removeShellListener(shellListener); - } - - if (null != shellMouseMoveListener) { - shell.removeMouseMoveListener(shellMouseMoveListener); - } - - if (null != shellMouseListener) { - shell.removeMouseListener(shellMouseListener); - } - - imageRegistry.dispose(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ClipbrdTransfer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ClipbrdTransfer.java deleted file mode 100644 index ea00431f59..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ClipbrdTransfer.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Clipboard - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * SangHo Park <sangho1206.park@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 - * - */ - -package org.tizen.emulator.skin.screenshot; - -import java.awt.Image; -import java.awt.Toolkit; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; - -import org.tizen.emulator.skin.util.StringUtil; - -public class ClipbrdTransfer { - public static void write(String filePath) { - if (StringUtil.isEmpty(filePath) == true) { - return; - } - - Toolkit toolkit = Toolkit.getDefaultToolkit(); - toolkit.getSystemClipboard().setContents( - new ClipbrdTransferable(toolkit.createImage(filePath)), null); - } - - static class ClipbrdTransferable implements Transferable { - private Image image; - - public ClipbrdTransferable(Image image) { - this.image = image; - } - - @Override - public DataFlavor[] getTransferDataFlavors() { - return new DataFlavor[] { DataFlavor.imageFlavor }; - } - - @Override - public boolean isDataFlavorSupported(DataFlavor flavor) { - return (flavor == DataFlavor.imageFlavor); - } - - @Override - public Object getTransferData(DataFlavor flavor) { - if (isDataFlavorSupported(flavor) == true) { - return image; - } else { - return null; - } - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java deleted file mode 100644 index 32a0aae345..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java +++ /dev/null @@ -1,885 +0,0 @@ -/** - * Screenshot Window - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Munkyu Im <munkyu.im@samsung.com> - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.screenshot; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.ImageTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -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.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.ImageLoader; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -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.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Scale; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.ToolBar; -import org.eclipse.swt.widgets.ToolItem; -import org.tizen.emulator.skin.EmulatorSkin; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.exception.ScreenShotException; -import org.tizen.emulator.skin.image.ImageRegistry; -import org.tizen.emulator.skin.image.ImageRegistry.IconName; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; -import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.SkinUtil; -import org.tizen.emulator.skin.util.StringUtil; -import org.tizen.emulator.skin.util.SwtUtil; - -public class ScreenShotDialog { - public static final String JNI_LIBRARY_FILE = "clipboard"; - private final static String DETAIL_SCREENSHOT_WINDOW_TITLE = "Screen Shot"; - - private final static String DEFAULT_FILE_EXTENSION = "png"; - private static final int CANVAS_MARGIN = 30; - private static final int TOOLITEM_COOLTIME = 200; - private static final double MAX_SCALE_MULTIPLE = 8; - - private static Logger logger = - SkinLogger.getSkinLogger(ScreenShotDialog.class).getLogger(); - - protected EmulatorSkin skin; - protected EmulatorConfig config; - protected Shell shell; - - private ScrolledComposite scrollComposite; - protected Canvas canvasShot; - protected Image imageShot; - protected boolean isCanvasDragging; - protected Point canvasGrabPosition; - - private Composite statusComposite; - private Label labelResolution; - private Label labelScale; - private Label labelPoint; - - private ToolItem refreshItem; - private ToolItem copyItem; - private ToolItem scaleItem; - private Scale scale; - private double scaleLevel; - private double scaleSize; - private boolean isCtrlPressed; - - /** - * @brief constructor - * @param Image icon : screenshot window icon resource - */ - public ScreenShotDialog(final EmulatorSkin skin, - EmulatorConfig config, Image icon) { - this.skin = skin; - this.config = config; - - this.canvasGrabPosition = new Point(-1, -1); - this.scaleLevel = 100; - - isCtrlPressed = false; - - if (SwtUtil.isMacPlatform() == false) { - shell = new Shell(skin.getShell(), SWT.SHELL_TRIM); - } else { - shell = new Shell(skin.getShell().getDisplay(), SWT.SHELL_TRIM); - } - shell.setText(DETAIL_SCREENSHOT_WINDOW_TITLE - + " - " + SkinUtil.makeEmulatorName(config)); - - /* To prevent the icon switching on Mac */ - if (SwtUtil.isMacPlatform() == false) { - if (icon != null) { - shell.setImage(icon); - } - } - - GridLayout gridLayout = new GridLayout(); - gridLayout.marginWidth = gridLayout.marginHeight = 0; - gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0; - shell.setLayout(gridLayout); - - shell.addListener(SWT.Close, new Listener() { - @Override - public void handleEvent(Event event) { - logger.info("ScreenShot Window is closed"); - - if (null != imageShot) { - imageShot.dispose(); - } - - skin.screenShotDialog = null; - } - }); - - /* tool bar */ - createToolBar(shell); - - /* zoom in/out for using wheel */ - shell.addMouseWheelListener(new MouseWheelListener() { - @Override - public void mouseScrolled(MouseEvent e) { - if (isCtrlPressed) { - if (e.count < 0 && scale.getSelection() > 0) { - downScaleLevel(); - scale.setSelection(scale.getSelection() - 1); - scale.setToolTipText(getScaleLevel() + "%"); - } else if (e.count > 0 && scale.getSelection() < 6) { - upScaleLevel(); - scale.setSelection(scale.getSelection() + 1); - scale.setToolTipText(getScaleLevel() + "%"); - } else { - return; - } - updateWindow(); - } - } - }); - - /* screenshot canvas */ - scrollComposite = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.H_SCROLL); - GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); - scrollComposite.setLayoutData(gridData); - - scrollComposite.setExpandHorizontal(true); - scrollComposite.setExpandVertical(true); - - canvasShot = new Canvas(scrollComposite, SWT.FOCUSED); - canvasShot.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); - - scrollComposite.setContent(canvasShot); - - /* status bar */ - createStatusBar(shell); - - shell.pack(); - adjustWindow(skin); - - createCanvasListener(canvasShot); - } - - private void adjustWindow(EmulatorSkin skin) { - final Rectangle monitorBounds = Display.getDefault().getBounds(); - logger.info("host monitor display bounds : " + monitorBounds); - final Rectangle emulatorBounds = skin.getShell().getBounds(); - logger.info("current Emulator window bounds : " + emulatorBounds); - Rectangle dialogBounds = shell.getBounds(); - logger.info("current ScreenShot window bounds : " + dialogBounds); - - /* size correction */ - shell.setSize(emulatorBounds.width, emulatorBounds.height); - dialogBounds = shell.getBounds(); - logger.info("current ScreenShot Dialog bounds : " + dialogBounds); - - /* location correction */ - int x = emulatorBounds.x + emulatorBounds.width + 20; - int y = emulatorBounds.y; - if ((x + dialogBounds.width) > (monitorBounds.x + monitorBounds.width)) { - x = emulatorBounds.x - dialogBounds.width - 20; - } - if (y < monitorBounds.y) { - y = monitorBounds.y; - } else if ((y + dialogBounds.height) > (monitorBounds.y + monitorBounds.height)) { - y = (monitorBounds.y + monitorBounds.height) - dialogBounds.height; - } - shell.setLocation(x, y); - - logger.info("ScreenShot window bounds : " + shell.getBounds()); - } - - private void createCanvasListener(Canvas canvas) { - canvas.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - logger.fine("draw shot"); - - if (null != imageShot && !imageShot.isDisposed()) { - e.gc.setInterpolation(SWT.NONE); - - final Rectangle imageBounds = imageShot.getBounds(); - e.gc.drawImage(imageShot, 0, 0, imageBounds.width, imageBounds.height, - CANVAS_MARGIN, CANVAS_MARGIN, - (int)(imageBounds.width * scaleLevel / 100), - (int)(imageBounds.height * scaleLevel / 100)); - } - } - }); - - canvas.addMouseMoveListener(new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - if (isCanvasDragging == true) { - Point origin = scrollComposite.getOrigin(); - origin.x += canvasGrabPosition.x - e.x; - origin.y += canvasGrabPosition.y - e.y; - scrollComposite.setOrigin(origin); - } - int MaxWidth = 0, MaxHeight = 0; - scaleSize = scale.getSelection() - 3; - int curX = (int)((e.x - CANVAS_MARGIN) * Math.pow(2, -scaleSize)); - int curY = (int)((e.y - CANVAS_MARGIN) * Math.pow(2, -scaleSize)); - - /* checking Rotation */ - switch (skin.getEmulatorSkinState().getCurrentRotationId()) { - case SkinRotations.LANDSCAPE_ID: - case SkinRotations.REVERSE_LANDSCAPE_ID: - MaxWidth = skin.getEmulatorSkinState().getCurrentResolutionHeight(); - MaxHeight = skin.getEmulatorSkinState().getCurrentResolutionWidth(); - break; - case SkinRotations.PORTRAIT_ID: - case SkinRotations.REVERSE_PORTRAIT_ID: - default: - MaxWidth = skin.getEmulatorSkinState().getCurrentResolutionWidth(); - MaxHeight = skin.getEmulatorSkinState().getCurrentResolutionHeight(); - break; - } - - if (curX < 0) - curX = 0; - else if (curX > MaxWidth) - curX = MaxWidth; - if (curY < 0) - curY = 0; - else if (curY > MaxHeight) - curY = MaxHeight; - - labelPoint.setText(" x : " + curX + ", y : " + curY + " "); - labelPoint.update(); - } - }); - - canvas.addMouseListener(new MouseListener() { - @Override - public void mouseDoubleClick(MouseEvent e) { - /* do nothing */ - } - - @Override - public void mouseDown(MouseEvent e) { - if (1/* left button */ == e.button) { - isCanvasDragging = true; - canvasGrabPosition.x = e.x; - canvasGrabPosition.y = e.y; - } - } - - @Override - public void mouseUp(MouseEvent e) { - if (1/* left button */ == e.button) { - isCanvasDragging = false; - canvasGrabPosition.x = -1; - canvasGrabPosition.y = -1; - } - } - }); - - canvas.addKeyListener(new KeyListener() { - @Override - public void keyPressed(KeyEvent e) { - if (SWT.CTRL == e.keyCode) { - isCtrlPressed = true; - scrollComposite.setEnabled(false); - scale.setEnabled(false); - } - } - - @Override - public void keyReleased(KeyEvent e) { - if (SWT.CTRL == e.keyCode) { - isCtrlPressed = false; - scrollComposite.setEnabled(true); - scale.setEnabled(true); - } - } - }); - } - - private void clickShutter() throws ScreenShotException { - Image maskImage = skin.getDisplayCanvas().getMaskImage(); - if (maskImage != null && skin.getDisplayCanvas().getRegion() != null) { - capture(SkinUtil.getMaskDataForImage(shell.getDisplay(), maskImage)); - } else { - capture(null); - } - - shell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - updateWindow(); - } - }); - } - - protected void capture(ImageData maskData) throws ScreenShotException { - /* abstract */ - } - - private double getScaleLevel() { - return scaleLevel; - } - - private void setScaleLevel(double level) { - scaleLevel = level; - logger.info("set scaling level : " + scaleLevel); - } - - private void downScaleLevel() { - scaleLevel /= 2; - logger.info("down scaling level : " + scaleLevel); - } - - private void upScaleLevel() { - scaleLevel *= 2; - logger.info("up scaling level : " + scaleLevel); - } - - private void updateWindow() { - logger.info("update"); - - if (imageShot != null) { - ImageData imageData = imageShot.getImageData(); - int width = (int)(imageData.width * scaleLevel / 100) + (2 * CANVAS_MARGIN); - int height = (int)(imageData.height * scaleLevel / 100) + (2 * CANVAS_MARGIN); - logger.info("update composite width : " + width + ", height : " + height); - - scrollComposite.setMinSize(width, height); - } - - /* update image */ - canvasShot.redraw(); - - /* update status bar */ - if (labelScale != null) { - labelScale.setText(" " + scaleLevel + "% "); - labelScale.update(); - } - } - - protected ImageData getRotateImageData(ImageData srcData) { - int direction = SWT.NONE; - - switch (skin.getEmulatorSkinState().getCurrentRotationId()) { - case SkinRotations.PORTRAIT_ID: - return srcData; - case SkinRotations.LANDSCAPE_ID: - direction = SWT.LEFT; - break; - case SkinRotations.REVERSE_PORTRAIT_ID: - direction = SWT.DOWN; - break; - case SkinRotations.REVERSE_LANDSCAPE_ID: - direction = SWT.RIGHT; - break; - default: - return srcData; - } - - ImageData rotatedData = rotateImageData(srcData, direction); - return rotatedData; - } - - /* - * refrence web page : http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Rotateandflipanimage.htm - */ - private ImageData rotateImageData(ImageData srcData, int direction) { - int bytesPerPixel = srcData.bytesPerLine / srcData.width; - int destBytesPerLine = (direction == SWT.DOWN) ? - srcData.width * bytesPerPixel : srcData.height * bytesPerPixel; - - byte[] newData = new byte[srcData.data.length]; - int srcWidth = 0, srcHeight = 0; - - int destX = 0, destY = 0, destIndex = 0, srcIndex = 0; - for (int srcY = 0; srcY < srcData.height; srcY++) { - for (int srcX = 0; srcX < srcData.width; srcX++) { - switch (direction) { - case SWT.LEFT: /* left 90 degrees */ - destX = srcY; - destY = srcData.width - srcX - 1; - srcWidth = srcData.height; - srcHeight = srcData.width; - break; - case SWT.RIGHT: /* right 90 degrees */ - destX = srcData.height - srcY - 1; - destY = srcX; - srcWidth = srcData.height; - srcHeight = srcData.width; - break; - case SWT.DOWN: /* 180 degrees */ - destX = srcData.width - srcX - 1; - destY = srcData.height - srcY - 1; - srcWidth = srcData.width; - srcHeight = srcData.height; - break; - } - - destIndex = (destY * destBytesPerLine) + (destX * bytesPerPixel); - srcIndex = (srcY * srcData.bytesPerLine) + (srcX * bytesPerPixel); - System.arraycopy(srcData.data, srcIndex, newData, destIndex, bytesPerPixel); - } - } - - /* destBytesPerLine is used as scanlinePad - * to ensure that no padding is required */ - return new ImageData(srcWidth, srcHeight, - srcData.depth, srcData.palette, destBytesPerLine, newData); - } - - private void createToolBar(final Shell parent) { - ImageRegistry imageRegistry = skin.getImageRegistry(); - - ToolBar toolBar = new ToolBar(parent, SWT.HORIZONTAL | SWT.BORDER); - GridData gridData = new GridData( - GridData.FILL_HORIZONTAL, GridData.CENTER, true, false); - toolBar.setLayoutData(gridData); - - /* save */ - ToolItem saveItem = new ToolItem(toolBar, SWT.FLAT); - saveItem.setImage(imageRegistry.getIcon(IconName.SAVE_SCREEN_SHOT)); - saveItem.setToolTipText("Save to file"); - - saveItem.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Save menu is selected"); - - FileDialog fileDialog = new FileDialog(parent, SWT.SAVE); - fileDialog.setText("Save Image"); - - String[] filter = { "*.png;*.PNG;*.jpg;*.JPG;*.jpeg;*.JPEG;*.bmp;*.BMP" }; - fileDialog.setFilterExtensions(filter); - - String[] filterName = { "Image files (*.png *.jpg *.jpeg *.bmp)" }; - fileDialog.setFilterNames(filterName); - - String vmName = SkinUtil.getVmName(config); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - String dateString = formatter.format(new Date(System.currentTimeMillis())); - - fileDialog.setFileName(vmName + "-" + - dateString + "." + DEFAULT_FILE_EXTENSION); - - String userHome = System.getProperty("user.home"); - if (!StringUtil.isEmpty(userHome)) { - fileDialog.setFilterPath(userHome); - } else { - logger.warning("Cannot find user home path in java System properties."); - } - - fileDialog.setOverwrite(true); - String filePath = fileDialog.open(); - saveImageFile(filePath, fileDialog); - } - }); - - /* copy to clipboard */ - copyItem = new ToolItem(toolBar, SWT.FLAT); - copyItem.setImage(imageRegistry.getIcon(IconName.COPY_SCREEN_SHOT)); - copyItem.setToolTipText("Copy to clipboard"); - - copyItem.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("CopyToClipboard menu is selected"); - - if (null == imageShot || imageShot.isDisposed()) { - SkinUtil.openMessage(parent, null, - "Fail to copy to clipboard.", SWT.ICON_ERROR, config); - return; - } - - copyItem.setEnabled(false); - parent.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(TOOLITEM_COOLTIME); - } catch (InterruptedException e) { - e.printStackTrace(); - } - copyItem.setEnabled(true); - } - }); - - copyImageToClipboard(imageShot); - } - }); - - new ToolItem(toolBar, SWT.SEPARATOR); - - /* refresh */ - refreshItem = new ToolItem(toolBar, SWT.FLAT); - refreshItem.setImage(imageRegistry.getIcon(IconName.REFRESH_SCREEN_SHOT)); - refreshItem.setToolTipText("Refresh image"); - - refreshItem.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - logger.info("Refresh menu is selected"); - - refreshItem.setEnabled(false); - - parent.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(TOOLITEM_COOLTIME); - } catch (InterruptedException e) { - e.printStackTrace(); - } - refreshItem.setEnabled(true); - } - }); - - try { - clickShutter(); - } catch (ScreenShotException ex) { - logger.log(Level.SEVERE, "Fail to create a screen shot.", ex); - SkinUtil.openMessage(parent, null, - "Fail to create a screen shot.", SWT.ERROR, config); - } - } - }); - - new ToolItem(toolBar, SWT.SEPARATOR); - - /* zoom in & out slider */ - scaleItem = new ToolItem(toolBar, SWT.SEPARATOR); - scaleItem.setWidth(100); - scale = new Scale(toolBar, SWT.HORIZONTAL); - scale.setMinimum(0); - scale.setMaximum(6); - scale.setPageIncrement(1); - scale.setIncrement(1); - scale.setSelection(3); - scale.setToolTipText(scaleLevel + "%"); - scaleItem.setControl(scale); - scale.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - scaleSize = scale.getSelection() - 3; - - setScaleLevel(Math.pow(2, scaleSize) * 100); - updateWindow(); - - /* update tool tip text */ - scale.setToolTipText(getScaleLevel() + "%"); - - /* update status bar */ - if (labelScale != null) { - labelScale.setText(" " + scaleLevel + "% "); - labelScale.update(); - } - } - }); - - scale.addKeyListener(new KeyListener() { - - @Override - public void keyPressed(KeyEvent e) { - if (SWT.CTRL == e.keyCode) { - isCtrlPressed = true; - scrollComposite.setEnabled(false); - scale.setEnabled(false); - } - } - - @Override - public void keyReleased(KeyEvent e) { - if (SWT.CTRL == e.keyCode) { - isCtrlPressed = false; - scrollComposite.setEnabled(true); - scale.setEnabled(true); - } - } - }); - - toolBar.addKeyListener(new KeyListener() { - @Override - public void keyPressed(KeyEvent e) { - if (SWT.CTRL == e.keyCode) { - isCtrlPressed = true; - scrollComposite.setEnabled(false); - scale.setEnabled(false); - } - } - - @Override - public void keyReleased(KeyEvent e) { - if (SWT.CTRL == e.keyCode) { - isCtrlPressed = false; - scrollComposite.setEnabled(true); - scale.setEnabled(true); - } - } - }); - } - - private void createStatusBar(final Shell parent) { - statusComposite = new Composite(parent, SWT.NONE); - RowLayout row = new RowLayout(SWT.HORIZONTAL); - row.marginLeft = 0; - row.marginTop = row.marginBottom = 0; - statusComposite.setLayout(row); - - labelResolution = new Label(statusComposite, SWT.BORDER | SWT.SHADOW_IN); - labelResolution.setText(" Resolution : " + - skin.getEmulatorSkinState().getCurrentResolutionWidth() + "x" + - skin.getEmulatorSkinState().getCurrentResolutionHeight() + " "); - - labelScale = new Label(statusComposite, SWT.BORDER | SWT.SHADOW_IN); - labelScale.setText(" " + scaleLevel + "% "); - - labelPoint = new Label(statusComposite, SWT.BORDER | SWT.SHADOW_IN); - labelPoint.setText(" x : " + skin.getEmulatorSkinState().getCurrentResolutionWidth() * (int)MAX_SCALE_MULTIPLE + - ", y : " + skin.getEmulatorSkinState().getCurrentResolutionHeight() * (int)MAX_SCALE_MULTIPLE + " "); - } - - private void copyImageToClipboard(Image image) { - ImageData imageData = image.getImageData(); - - if (SwtUtil.isLinuxPlatform() == true && - SwtUtil.is64bitPlatform() == true) { - /* use Python for Ubuntu 64bit */ - FileOutputStream fos = null; - String fileName = "screenshot" + - skin.config.getArgInt(ArgsConstants.VM_BASE_PORT) + ".png"; - - try { - fos = new FileOutputStream(fileName, false); - } catch (FileNotFoundException ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - SkinUtil.openMessage(shell, null, - "Failed to copy to clipboard : \n" + ee.getMessage(), - SWT.ICON_ERROR, config); - return; - } - - ImageLoader loader = new ImageLoader(); - loader.data = new ImageData[] { imageData }; - - loader.save(fos, SWT.IMAGE_PNG); - IOUtil.close(fos); - - ProcessBuilder procPy = new ProcessBuilder(); - procPy.command("python", "clipboard.py", fileName); - - logger.info(procPy.command().toString()); - - try { - procPy.start(); - } catch (Exception ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - SkinUtil.openMessage(shell, null, - "Failed to copy to clipboard : \n" + ee.getMessage(), - SWT.ICON_ERROR, config); - } - } else if (SwtUtil.isWindowsPlatform() == true && - skin.getDisplayCanvas().getRegion() != null) { - /* use java.awt to transfer a transparent background image */ - String fileName = "screenshot" + - skin.config.getArgInt(ArgsConstants.VM_BASE_PORT) + ".png"; - - try { - saveImageFileInternal(fileName, SWT.IMAGE_PNG, imageData); - } catch (Exception ee) { - logger.log(Level.SEVERE, ee.getMessage(), ee); - SkinUtil.openMessage(shell, null, - "Failed to copy to clipboard : \n" + ee.getMessage(), - SWT.ICON_ERROR, config); - return; - } - - ClipbrdTransfer.write(fileName); - } else { - /* use SWT */ - ImageLoader loader = new ImageLoader(); - - if (SwtUtil.isWindowsPlatform() == true) { - /* convert to RGBA */ - imageData.palette = - new PaletteData(0xFF000000, 0x00FF0000, 0x0000FF00); - } - loader.data = new ImageData[] { imageData }; - - ByteArrayOutputStream bao = new ByteArrayOutputStream(); - loader.save(bao, SWT.IMAGE_PNG); - - ImageData pngData = new ImageData( - new ByteArrayInputStream(bao.toByteArray())); - - Object[] imageObject = new Object[] { pngData }; - - Transfer[] transfer = new Transfer[] { ImageTransfer.getInstance() }; - Clipboard clipboard = new Clipboard(shell.getDisplay()); - clipboard.setContents(imageObject, transfer); - - clipboard.dispose(); - } - } - - private void saveImageFile(String fileFullPath, FileDialog fileDialog) { - if (null == fileFullPath) { - return; - } - - String format = ""; - String[] split = fileFullPath.split("\\."); - - if (1 < split.length) { - format = split[split.length - 1]; - - if (new File(split[split.length - 2]).isDirectory()) { - /* There is no file name */ - SkinUtil.openMessage(shell, null, - "Use correct file name.", SWT.ICON_WARNING, config); - - String path = fileDialog.open(); - saveImageFile(path, fileDialog); - } - } - - try { - if (StringUtil.isEmpty(format)) { - if (fileFullPath.endsWith(".")) { - fileFullPath += DEFAULT_FILE_EXTENSION; - } else { - fileFullPath += "." + DEFAULT_FILE_EXTENSION; - } - } - - if (StringUtil.isEmpty(format) || format.equalsIgnoreCase("png")) { - saveImageFileInternal(fileFullPath, - SWT.IMAGE_PNG, imageShot.getImageData()); - } else if (format.equalsIgnoreCase("jpg") || format.equalsIgnoreCase("jpeg")) { - saveImageFileInternal(fileFullPath, - SWT.IMAGE_JPEG, imageShot.getImageData()); - } else if (format.equalsIgnoreCase("bmp")) { - saveImageFileInternal(fileFullPath, - SWT.IMAGE_BMP, imageShot.getImageData()); - } else { - SkinUtil.openMessage(shell, null, - "Use the specified image formats. (PNG / JPG / JPEG / BMP)", - SWT.ICON_WARNING, config); - - String path = fileDialog.open(); - saveImageFile(path, fileDialog); - } - } catch (Exception ex) { - logger.log(Level.SEVERE, "Fail to save this image file.", ex); - SkinUtil.openMessage(shell, null, - "Fail to save this image file.", SWT.ERROR, config); - - String path = fileDialog.open(); - saveImageFile(path, fileDialog); - } - } - - private void saveImageFileInternal(String filePath, - int imageFormat, ImageData imageData) throws Exception { - ImageLoader loader = new ImageLoader(); - - Image maskImage = skin.getDisplayCanvas().getMaskImage(); - if (maskImage != null && skin.getDisplayCanvas().getRegion() != null && - SwtUtil.isWindowsPlatform() == true) { - /* When save an PNG image with mask data on Windows, - * transparent background cannot be applied to image file. - * So, to handle alpha channel, transparent pixel field in ImageData class - * should get a color key value from background area. */ - - final int colorKey = imageData.palette.getPixel(new RGB(255, 0, 255)); - final int fakeKey = imageData.palette.getPixel(new RGB(255, 1, 255)); - SkinUtil.setColorKeyFromMask(shell.getDisplay(), - colorKey, fakeKey, maskImage.getImageData(), imageData); - - imageData.transparentPixel = colorKey; - imageData.maskData = null; - } - - loader.data = new ImageData[] { imageData }; - - FileOutputStream fos = new FileOutputStream(filePath, false); - loader.save(fos, imageFormat); - - IOUtil.close(fos); - } - - public void open() throws ScreenShotException { - if (shell.isDisposed()) { - return; - } - - try { - clickShutter(); - } catch (ScreenShotException e) { - shell.close(); - - throw e; - } - - shell.open(); - } - - public Shell getShell() { - return shell; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/SdlScreenShotWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/SdlScreenShotWindow.java deleted file mode 100644 index 8f1839ff90..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/SdlScreenShotWindow.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Screenshot Window - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.screenshot; - -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.tizen.emulator.skin.EmulatorSdlSkin; -import org.tizen.emulator.skin.comm.ICommunicator.SendCommand; -import org.tizen.emulator.skin.comm.sock.SocketCommunicator.DataTranfer; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.exception.ScreenShotException; -import org.tizen.emulator.skin.log.SkinLogger; - -public class SdlScreenShotWindow extends ScreenShotDialog { - private static Logger logger = SkinLogger.getSkinLogger( - SdlScreenShotWindow.class).getLogger(); - - private PaletteData palette; - - /** - * @brief constructor - * @param Image icon : screenshot window icon resource - */ - public SdlScreenShotWindow(EmulatorSdlSkin emulatorSkin, - EmulatorConfig config, PaletteData palette, Image icon) { - super(emulatorSkin, config, icon); - - this.palette = palette; - } - - @Override - protected void capture(ImageData maskData) throws ScreenShotException { - logger.info("screenshot capture"); - - DataTranfer dataTranfer = skin.communicator.sendDataToQEMU( - SendCommand.SEND_SCREENSHOT_REQ, null, true); - byte[] receivedData = - skin.communicator.getReceivedData(dataTranfer); - - if (null != receivedData) { - int width = skin.getEmulatorSkinState().getCurrentResolutionWidth(); - int height = skin.getEmulatorSkinState().getCurrentResolutionHeight(); - ImageData imageData = new ImageData(width, height, - EmulatorSdlSkin.DISPLAY_COLOR_DEPTH, palette, 1, receivedData); - - imageData = getRotateImageData(imageData); - - Image tempImage = imageShot; - if (maskData != null) { - imageShot = new Image(shell.getDisplay(), imageData, maskData); - } else { - imageShot = new Image(shell.getDisplay(), imageData); - } - - if (tempImage != null) { - tempImage.dispose(); - } - - canvasShot.redraw(); - } else { - throw new ScreenShotException("Fail to get image data."); - } - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ShmScreenShotWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ShmScreenShotWindow.java deleted file mode 100644 index 8841a7d5c5..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ShmScreenShotWindow.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Screenshot Window - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.screenshot; - -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.tizen.emulator.skin.EmulatorShmSkin; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.exception.ScreenShotException; -import org.tizen.emulator.skin.log.SkinLogger; - -public class ShmScreenShotWindow extends ScreenShotDialog { - private static Logger logger = SkinLogger.getSkinLogger( - ShmScreenShotWindow.class).getLogger(); - - private PaletteData palette; - - /** - * @brief constructor - * @param Image icon : screenshot window icon resource - */ - public ShmScreenShotWindow(EmulatorShmSkin emulatorSkin, - EmulatorConfig config, PaletteData palette, Image icon) { - super(emulatorSkin, config, icon); - - this.palette = palette; - } - - @Override - protected void capture(ImageData maskData) throws ScreenShotException { - logger.info("screenshot capture"); - - int width = skin.getEmulatorSkinState().getCurrentResolutionWidth(); - int height = skin.getEmulatorSkinState().getCurrentResolutionHeight(); - int[] arrayFramebuffer = new int[width * height]; - - //int result = - ((EmulatorShmSkin) skin).getPixels(arrayFramebuffer); - //logger.info("getPixels native function returned " + result); - - ImageData imageData = new ImageData(width, height, - EmulatorShmSkin.DISPLAY_COLOR_DEPTH, palette); - /* from shared memory */ - imageData.setPixels(0, 0, - width * height, arrayFramebuffer, 0); - - imageData = getRotateImageData(imageData); - - Image tempImage = imageShot; - if (maskData != null) { - imageShot = new Image(shell.getDisplay(), imageData, maskData); - } else { - imageShot = new Image(shell.getDisplay(), imageData); - } - - if (tempImage != null) { - tempImage.dispose(); - } - - canvasShot.redraw(); - } -}
\ No newline at end of file diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/CocoaUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/CocoaUtil.java deleted file mode 100644 index 430df17a0d..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/CocoaUtil.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Munkyu Im <munkyu.im@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.util; - -import java.lang.reflect.InvocationTargetException; - -public class CocoaUtil { - - private static final long aboutMenuValue = 0; - private static final long prefMenuValue = 2; - public static final String NSApplication_CLASS = "org.eclipse.swt.internal.cocoa.NSApplication"; - public static final String NSMenu_CLASS = "org.eclipse.swt.internal.cocoa.NSMenu"; - public static final String NSMenuItem_CLASS = "org.eclipse.swt.internal.cocoa.NSMenuItem"; - - public static Object invokeMethod(Class<?> clazz, Object object, String method, Object[] args) - throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, - SecurityException, NoSuchMethodException { - Class<?>[] signature = new Class[args.length]; - for (int i = 0; i < args.length; i++) { - Class<?> thisClass = args[i].getClass(); - if (thisClass == Integer.class) - signature[i] = int.class; - else if (thisClass == Long.class) - signature[i] = long.class; - else if (thisClass == Byte.class) - signature[i] = byte.class; - else if ( thisClass == Boolean.class ) - signature[i] = boolean.class; - else - signature[i] = thisClass; - } - return clazz.getDeclaredMethod(method, signature).invoke(object, args); - } - - // remove about and preference menu item - public void removeTopMenuItems() { - try { - Class<?> nsmenuClass = Class.forName(NSMenu_CLASS); - Class<?> nsmenuitemClass = Class.forName(NSMenuItem_CLASS); - Class<?> nsapplicationClass = Class.forName(NSApplication_CLASS); - - Object sharedApplication = nsapplicationClass.getDeclaredMethod( - "sharedApplication", (Class<?>[]) null).invoke(null, - (Object[]) null); - Object mainMenu = sharedApplication.getClass() - .getDeclaredMethod("mainMenu", (Class<?>[]) null) - .invoke(sharedApplication, (Object[]) null); - - Object mainMenuItem = invokeMethod(nsmenuClass, mainMenu, - "itemAtIndex", new Object[] { new Long(0) }); - Object appMenu = mainMenuItem.getClass() - .getDeclaredMethod("submenu", (Class<?>[]) null) - .invoke(mainMenuItem, (Object[]) null); - - Object aboutMenuItem = invokeMethod(nsmenuClass, appMenu, - "itemAtIndex", new Object[] { new Long(aboutMenuValue) }); - Object prefMenuItem = invokeMethod(nsmenuClass, appMenu, - "itemAtIndex", new Object[] { new Long(prefMenuValue) }); - - //set hidden - invokeMethod(nsmenuitemClass, aboutMenuItem, "setHidden", - new Object[] { new Boolean(true) }); - invokeMethod(nsmenuitemClass, prefMenuItem, "setHidden", - new Object[] { new Boolean(true) }); - - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/IOUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/IOUtil.java deleted file mode 100644 index 43f4077e9a..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/IOUtil.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.util; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.net.Socket; - -/** - * - * - */ -public class IOUtil { - private IOUtil() { - /* do nothing */ - } - - public static void closeSocket(Socket socket) { - try { - if (null != socket) { - socket.close(); - socket = null; - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static void close(Closeable closeable) { - try { - if (null != closeable) { - closeable.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static byte[] getBytes(InputStream is) throws IOException { - ByteArrayOutputStream bao = new ByteArrayOutputStream(); - byte[] buffer = new byte[1024]; - - int read = 0; - while(0 < (read = is.read(buffer))) { - bao.write(buffer, 0, read); - } - - return bao.toByteArray(); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/JaxbUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/JaxbUtil.java deleted file mode 100644 index b6ac272e8a..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/JaxbUtil.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * JAXB Utilities - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.util; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.stream.StreamSource; - -import org.tizen.emulator.skin.exception.JaxbException; - - -/** - * - * - */ -public class JaxbUtil { - private JaxbUtil() { - /* do nothing */ - } - - public static <T> T unmarshal( - byte[] inputBytes, Class<T> clazz) throws JaxbException { - return unmarshal(new ByteArrayInputStream(inputBytes), clazz); - } - - public static <T> T unmarshal( - InputStream in, Class<T> clazz) throws JaxbException { - try { - Unmarshaller u = getContext(clazz).createUnmarshaller(); - JAXBElement<T> element = u.unmarshal(new StreamSource(in), clazz); - - return element.getValue(); - } catch (JAXBException e) { - throw new JaxbException(e); - } catch (Throwable e) { - throw new JaxbException(e); - } - } - - public static void marshal( - Object object, OutputStream out) throws JaxbException { - try { - Marshaller m = getContext(object.getClass()).createMarshaller(); - - m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - - m.marshal(object, out); - } catch (JAXBException e) { - throw new JaxbException(e); - } catch (Throwable e) { - throw new JaxbException(e); - } - } - - private static JAXBContext getContext(Class<?> clazz) throws JaxbException { - try { - String qualifier = clazz.getCanonicalName(); - if (qualifier == null) { - throw new JAXBException("underlying class does not have a canonical name"); - } - - int index = qualifier.lastIndexOf('.'); - if (-1 != index) { - qualifier = qualifier.substring(0, index); - } - - return JAXBContext.newInstance(qualifier, clazz.getClassLoader()); - } catch (JAXBException e) { - throw new JaxbException(e); - } - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java deleted file mode 100644 index 8acd31fb72..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java +++ /dev/null @@ -1,1135 +0,0 @@ -/** - * Skin Utilities - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.util; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URISyntaxException; -import java.util.List; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.skin.config.EmulatorConfig; -import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; -import org.tizen.emulator.skin.dbi.EventInfoType; -import org.tizen.emulator.skin.dbi.KeyMapType; -import org.tizen.emulator.skin.dbi.RegionType; -import org.tizen.emulator.skin.layout.HWKey; -import org.tizen.emulator.skin.layout.HWKeyRegion; -import org.tizen.emulator.skin.layout.rotation.Rotation; -import org.tizen.emulator.skin.layout.rotation.SkinRotations; -import org.tizen.emulator.skin.log.SkinLogger; - - -/** - * - * - */ -public class SkinUtil { - public static final String GTK_OS_CLASS = "org.eclipse.swt.internal.gtk.OS"; - public static final String WIN32_OS_CLASS = "org.eclipse.swt.internal.win32.OS"; - public static final String COCOA_OS_CLASS = "org.eclipse.swt.internal.cocoa.OS"; - - public static final int UNKNOWN_KEYCODE = -1; - public static final int SCALE_CONVERTER = 100; - - public static final String EMULATOR_PREFIX = "Emulator"; - - private static Logger logger = - SkinLogger.getSkinLogger(SkinUtil.class).getLogger(); - - private static String binaryPath; - - static { - File executable = null; - try { - executable = new File(SkinUtil.class.getProtectionDomain().getCodeSource() - .getLocation().toURI().getPath()); - } catch (URISyntaxException e) { - e.printStackTrace(); - } - - if (executable != null) { - binaryPath = executable.getParent() + File.separator; - } else { - binaryPath = ""; - } - } - - private SkinUtil() { - /* do nothing */ - } - - public static String getVmName(EmulatorConfig config) { - String vmPath = config.getArg(ArgsConstants.VM_PATH); - - String regex = ""; - if (SwtUtil.isWindowsPlatform()) { - regex = "\\" + File.separator; - } else { - regex = File.separator; - } - - String[] split = StringUtil.nvl(vmPath).split(regex); - String vmName = split[split.length - 1]; - - return vmName; - } - - public static String makeEmulatorName(EmulatorConfig config) { - String vmName = getVmName(config); - - if (StringUtil.isEmpty(vmName)) { - vmName = EMULATOR_PREFIX; - } - - int portNumber = config.getArgInt(ArgsConstants.VM_BASE_PORT) + 1; - - return vmName + ":" + portNumber; - } - - public static Properties loadProperties(String filePath, boolean create) { - FileInputStream fis = null; - Properties properties = null; - - try { - File file = new File(filePath); - - if (create == true) { - if (file.exists() == false) { - if (file.createNewFile() == false) { - logger.severe( - "Fail to create new " + filePath + " property file."); - return null; - } - } - - fis = new FileInputStream(filePath); - properties = new Properties(); - properties.load(fis); - } else { - if (file.exists() == true) { - fis = new FileInputStream(filePath); - properties = new Properties(); - properties.load(fis); - } - } - - logger.info("load properties file : " + filePath); - } catch (IOException e) { - logger.log(Level.SEVERE, "failed to load skin properties file", e); - } finally { - IOUtil.close(fis); - } - - return properties; - } - - public static String getSdbPath() { - StringBuilder sdbPath = new StringBuilder(".." + File.separator + ".." - + File.separator + ".." + File.separator + ".." - + File.separator + ".." + File.separator + "tools" - + File.separator); - if (SwtUtil.isWindowsPlatform()) { - sdbPath.append("ansicon.exe"); - } else { - sdbPath.append("sdb"); - } - - return (binaryPath + sdbPath.toString()); - } - - public static String getEcpPath() { - return (binaryPath + "emulator-control-panel.jar"); - } - - public static String getSdkVersionFilePath() { - return (binaryPath + ".." + File.separator + ".." + - File.separator + ".." + File.separator + ".." + - File.separator + ".." + File.separator + "sdk.version"); - } - - public static List<KeyMapType> getHWKeyMapList(short rotationId) { - Rotation rotation = SkinRotations.getRotation(rotationId); - if (rotation == null) { - return null; - } - - return rotation.getListHWKey(); - } - - public static HWKey getHWKey(int currentX, int currentY, - int scale, short rotationId) { - float convertedScale = convertScale(scale); - - List<KeyMapType> keyMapList = getHWKeyMapList(rotationId); - if (keyMapList == null) { - return null; - } - - RegionType region = null; - for (KeyMapType keyEntry : keyMapList) { - region = keyEntry.getRegion(); - - int scaledX = (int) (region.getLeft() * convertedScale); - int scaledY = (int) (region.getTop() * convertedScale); - int scaledWidth = (int) (region.getWidth() * convertedScale); - int scaledHeight = (int) (region.getHeight() * convertedScale); - - if (isInGeometry(currentX, currentY, - scaledX, scaledY, scaledWidth, scaledHeight)) { - EventInfoType eventInfo = keyEntry.getEventInfo(); - - HWKey hwKey = new HWKey( - eventInfo.getKeyName(), - eventInfo.getKeyCode(), - new HWKeyRegion(scaledX, scaledY, scaledWidth, scaledHeight, - keyEntry.getRegion().isUpdate()), - keyEntry.getTooltip()); - - return hwKey; - } - } - - return null; - } - - public static boolean isInGeometry(int currentX, int currentY, - int targetX, int targetY, int targetWidth, int targetHeight) { - if ((currentX >= targetX) && (currentY >= targetY)) { - if ((currentX <= (targetX + targetWidth)) && - (currentY <= (targetY + targetHeight))) { - return true; - } - } - - return false; - } - - public static void setColorKeyFromMask(Display display, - int colorKey, int fakeKey, ImageData srcData, ImageData dstData) { - if (srcData == null || dstData == null) { - return; - } - - int j = 0; - for (int i = 0; i < dstData.width; i++) { - for (j = 0; j < dstData.height; j++) { - if (srcData.getAlpha(i, j) == 0) { - dstData.setPixel(i, j, colorKey); - } else if (srcData.getPixel(i, j) == colorKey) { - dstData.setPixel(i, j, fakeKey); - } - } - } - } - - public static ImageData getMaskDataForImage(Display display, Image srcImage) { - if (srcImage == null || srcImage.isDisposed() == true) { - return null; - } - - ImageData srcImageData = srcImage.getImageData(); - int[] maskArray = new int[srcImageData.width * srcImageData.height]; - - int j = 0; - for (int i = 0; i < srcImageData.width; i++) { - for (j = 0; j < srcImageData.height; j++) { - if (srcImageData.getAlpha(i, j) != 0) { - maskArray[i * srcImageData.width + j] = 1; - } else { - maskArray[i * srcImageData.width + j] = 0; - } - } - } - - ImageData maskData = new ImageData(srcImageData.width, srcImageData.height, 1, - new PaletteData(new RGB[] { new RGB(0, 0, 0), new RGB(255, 255, 255) })); - maskData.setPixels(0, 0, srcImageData.width * srcImageData.height, maskArray, 0); - - return maskData; - } - - public static Region getTrimmedRegion(Image image) { - if (null == image) { - return null; - } - - ImageData imageData = image.getImageData(); - int width = imageData.width; - int height = imageData.height; - - Region region = new Region(); - region.add(new Rectangle(0, 0, width, height)); - - int j = 0; - for (int i = 0; i < width; i++) { - for (j = 0; j < height; j++) { - if (0 == imageData.getAlpha(i, j)) { - region.subtract(i, j, 1, 1); - } - } - } - - return region; - } - - public static void trimShell(Shell shell, Image image, - int left, int top, int width, int height) { - if (image == null - || (width == 0 && height == 0)) { - return; - } - - ImageData imageData = image.getImageData(); - int right = left + width; - int bottom = top + height; - - Region region = shell.getRegion(); - if (region == null) { - return; - } - - int j = 0; - for (int i = left; i < right; i++) { - for (j = top; j < bottom; j++) { - if (0 == imageData.getAlpha(i, j)) { - region.subtract(i, j, 1, 1); - } else { - region.add(i, j, 1, 1); - } - } - } - - shell.setRegion(region); - } - - public static int[] convertMouseGeometry( - int originalX, int originalY, int displayWidth, int displayHeight, - int scale, short rotationId) { - float convertedScale = convertScale(scale); - - int x = (int) (originalX * (1 / convertedScale)); - int y = (int) (originalY * (1 / convertedScale)); - - int rotatedX = x; - int rotatedY = y; - - if (rotationId == SkinRotations.LANDSCAPE_ID) { - rotatedX = displayWidth - y; - rotatedY = x; - } else if (rotationId == SkinRotations.REVERSE_PORTRAIT_ID) { - rotatedX = displayWidth - x; - rotatedY = displayHeight - y; - } else if (rotationId == SkinRotations.REVERSE_LANDSCAPE_ID) { - rotatedX = y; - rotatedY = displayHeight - x; - } - - return new int[] { rotatedX, rotatedY }; - } - - public static Image createScaledImage(Display display, - Image imageOrigin, short rotationId, int scale) { - if (imageOrigin == null) { - return null; - } - - ImageData imageDataSrc = imageOrigin.getImageData(); - ImageData imageDataDst = (ImageData) imageDataSrc.clone(); - - float convertedScale = convertScale(scale); - - int width = (int) (imageDataSrc.width * convertedScale); - int height = (int) (imageDataSrc.height * convertedScale); - imageDataDst = imageDataDst.scaledTo(width, height); - - return new Image(display, imageDataDst); - } - - public static float convertScale(int scale) { - return (float) scale / SCALE_CONVERTER; - } - - public static <T> int openMessage(Shell shell, - String title, String message, int style, EmulatorConfig config) { - MessageBox messageBox = new MessageBox(shell, style); - - if (!StringUtil.isEmpty(title)) { - messageBox.setText(title); - } else { - messageBox.setText(makeEmulatorName(config)); - } - - messageBox.setMessage(StringUtil.nvl(message)); - return messageBox.open(); - } - - /* for java reflection */ - private static Field getOSField(String field) { - String className = ""; - - if (SwtUtil.isLinuxPlatform()) { - className = GTK_OS_CLASS; - } else if (SwtUtil.isWindowsPlatform()) { - className = WIN32_OS_CLASS; - } else if (SwtUtil.isMacPlatform()) { - className = COCOA_OS_CLASS; - } - - Field f = null; - try { - f = Class.forName(className).getField(field); - } catch (ClassNotFoundException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (SecurityException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (NoSuchFieldException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - - return f; - } - - private static Method getOSMethod(String method, Class<?>... parameterTypes) { - String className = ""; - - if (SwtUtil.isLinuxPlatform()) { - className = GTK_OS_CLASS; - } else if (SwtUtil.isWindowsPlatform()) { - className = WIN32_OS_CLASS; - } else if (SwtUtil.isMacPlatform()) { - className = COCOA_OS_CLASS; - } - - Method m = null; - try { - m = Class.forName(className).getMethod(method, parameterTypes); - } catch (ClassNotFoundException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (SecurityException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (NoSuchMethodException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - - return m; - } - - private static Method getOSMethod(String method) { - return getOSMethod(method, new Class<?>[] {}); - } - - private static Object invokeOSMethod(Method method, Object... args) { - if (null == method) { - return null; - } - - try { - return method.invoke(null, args); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (IllegalAccessException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } catch (InvocationTargetException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - - return null; - } - - private static Object invokeOSMethod(Method method) { - return invokeOSMethod(method, new Object[] {}); - } - - private static boolean setTopMost32(Shell shell, boolean isOnTop) { - if (SwtUtil.isLinuxPlatform()) { - /* reference : - http://wmctrl.sourcearchive.com/documentation/1.07/main_8c-source.html */ - - /* if (!OS.GDK_WINDOWING_X11()) { - logger.warning("There is no x11 system."); - return; - } - - int eventData0 = isOnTop ? 1 : 0; // 'add' or 'remove' - int topHandle = 0; - - Method m = null; - try { - m = Shell.class.getDeclaredMethod("topHandle", new Class<?>[] {}); - m.setAccessible(true); - topHandle = (Integer) m.invoke( shell, new Object[] {}); - } catch (SecurityException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (NoSuchMethodException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (InvocationTargetException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } - - int xWindow = OS.gdk_x11_drawable_get_xid( - OS.GTK_WIDGET_WINDOW(topHandle)); - int xDisplay = OS.GDK_DISPLAY(); - - byte[] messageBuffer = Converter.wcsToMbcs(null, "_NET_WM_STATE", true); - int xMessageAtomType = OS.XInternAtom(xDisplay, messageBuffer, false); - - messageBuffer = Converter.wcsToMbcs(null, "_NET_WM_STATE_ABOVE", true); - int xMessageAtomAbove = OS.XInternAtom(xDisplay, messageBuffer, false); - - XClientMessageEvent event = new XClientMessageEvent(); - event.type = OS.ClientMessage; - event.window = xWindow; - event.message_type = xMessageAtomType; - event.format = 32; - event.data[0] = eventData0; - event.data[1] = xMessageAtomAbove; - - int clientEvent = OS.g_malloc(XClientMessageEvent.sizeof); - OS.memmove(clientEvent, event, XClientMessageEvent.sizeof); - int rootWin = OS.XDefaultRootWindow(xDisplay); - // SubstructureRedirectMask : 1L<<20 | SubstructureNotifyMask : 1L<<19 - OS.XSendEvent(xDisplay, rootWin, false, - (int) ( 1L << 20 | 1L << 19 ), clientEvent); - OS.g_free(clientEvent); */ - - - Boolean gdkWindowingX11 = - (Boolean) invokeOSMethod(getOSMethod("GDK_WINDOWING_X11")); - if (null == gdkWindowingX11) { - logger.warning("GDK_WINDOWING_X11 returned null. There is no x11 system."); - return false; - } - - int eventData0 = isOnTop ? 1 : 0; /* 'add' or 'remove' */ - int topHandle = 0; - - Method m = null; - try { - m = Shell.class.getDeclaredMethod("topHandle", new Class<?>[] {}); - - m.setAccessible(true); - topHandle = (Integer) m.invoke(shell, new Object[] {}); - } catch (SecurityException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (NoSuchMethodException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (InvocationTargetException ex ) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Integer gtkWidgetWindow = (Integer) invokeOSMethod( - getOSMethod("GTK_WIDGET_WINDOW", int.class), topHandle); - if (null == gtkWidgetWindow) { - logger.warning("GTK_WIDGET_WINDOW returned null"); - return false; - } - - Integer xWindow = (Integer) invokeOSMethod( - getOSMethod("gdk_x11_drawable_get_xid", int.class), gtkWidgetWindow); - if (null == xWindow) { - logger.warning("gdk_x11_drawable_get_xid returned null"); - return false; - } - - Integer gdkDisplay = (Integer) invokeOSMethod( - getOSMethod("gdk_display_get_default")); - if (null == gdkDisplay) { - logger.warning("gdk_display_get_default returned null"); - return false; - } - - Integer xDisplay = (Integer) invokeOSMethod( - getOSMethod("gdk_x11_display_get_xdisplay", int.class), gdkDisplay); - if (null == xDisplay) { - logger.warning("gdk_x11_display_get_xdisplay returned null"); - - /* deprecated function */ - xDisplay = (Integer) invokeOSMethod(getOSMethod("GDK_DISPLAY")); - if (null == xDisplay) { - logger.warning("GDK_DISPLAY returned null"); - return false; - } - } - - Method xInternAtom = getOSMethod( - "XInternAtom", int.class, byte[].class, boolean.class); - - Class<?> converterClass = null; - try { - converterClass = Class.forName("org.eclipse.swt.internal.Converter"); - } catch (ClassNotFoundException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Method wcsToMbcs = null; - byte[] messageBufferState = null; - byte[] messageBufferAbove = null; - - try { - wcsToMbcs = converterClass.getMethod( - "wcsToMbcs", String.class, String.class, boolean.class); - } catch (SecurityException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (NoSuchMethodException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - try { - messageBufferState = - (byte[]) wcsToMbcs.invoke(null, null, "_NET_WM_STATE", true); - messageBufferAbove = - (byte[]) wcsToMbcs.invoke(null, null, "_NET_WM_STATE_ABOVE", true); - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (InvocationTargetException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Integer xMessageAtomType = (Integer) invokeOSMethod( - xInternAtom, xDisplay, messageBufferState, false); - if (null == xMessageAtomType) { - logger.warning("xMessageAtomType is null"); - return false; - } - - Integer xMessageAtomAbove = (Integer) invokeOSMethod( - xInternAtom, xDisplay, messageBufferAbove, false); - if (null == xMessageAtomAbove) { - logger.warning("xMessageAtomAbove is null"); - return false; - } - - Class<?> eventClazz = null; - Object event = null; - try { - eventClazz = Class.forName("org.eclipse.swt.internal.gtk.XClientMessageEvent"); - event = eventClazz.newInstance(); - } catch (InstantiationException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (ClassNotFoundException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } - - if (null == eventClazz || null == event) { - return false; - } - - Integer malloc = null; - try { - Field type = eventClazz.getField("type"); - - Field clientMessageField = getOSField("ClientMessage"); - if (null == clientMessageField) { - logger.warning("clientMessageField is null"); - return false; - } - type.set(event, clientMessageField.get(null)); - - Field window = eventClazz.getField("window"); - window.set(event, xWindow); - Field messageType = eventClazz.getField("message_type"); - messageType.set(event, xMessageAtomType); - Field format = eventClazz.getField("format"); - format.set(event, 32); - - Object data = Array.newInstance(int.class, 5); - Array.setInt(data, 0, eventData0); - Array.setInt(data, 1, xMessageAtomAbove); - Array.setInt(data, 2, 0); - Array.setInt(data, 3, 0); - Array.setInt(data, 4, 0); - - Field dataField = eventClazz.getField("data"); - dataField.set(event, data); - - Field sizeofField = eventClazz.getField("sizeof"); - Integer sizeof = (Integer) sizeofField.get(null); - - Method gMalloc = getOSMethod("g_malloc", int.class); - malloc = (Integer) invokeOSMethod(gMalloc, sizeof); - - Method memmove = - getOSMethod("memmove", int.class, eventClazz, int.class); - invokeOSMethod(memmove, malloc, event, sizeof); - - } catch (NoSuchFieldException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Method xDefaultRootWindow = - getOSMethod("XDefaultRootWindow", int.class); - Integer rootWin = - (Integer) invokeOSMethod(xDefaultRootWindow, xDisplay); - - Method xSendEvent = getOSMethod("XSendEvent", - int.class, int.class, boolean.class, int.class, int.class); - Method xFlush = getOSMethod("XFlush", int.class); - - /* SubstructureRedirectMask : 1L<<20 | SubstructureNotifyMask : 1L<<19 */ - invokeOSMethod(xSendEvent, xDisplay, rootWin, - false, (int) (1L << 20 | 1L << 19), malloc); - invokeOSMethod(xFlush, xDisplay); - - invokeOSMethod(getOSMethod("g_free", int.class), malloc); - - } else if (SwtUtil.isWindowsPlatform()) { - Point location = shell.getLocation(); - - /* int hWndInsertAfter = 0; - if (isOnTop) { - hWndInsertAfter = OS.HWND_TOPMOST; - } else { - hWndInsertAfter = OS.HWND_NOTOPMOST; - } - OS.SetWindowPos(shell.handle, - hWndInsertAfter, location.x, location.y, 0, 0, OS.SWP_NOSIZE); */ - - int hWndInsertAfter = 0; - int noSize = 0; - - try { - if (isOnTop) { - Field topMost = getOSField("HWND_TOPMOST"); - if (null == topMost) { - logger.warning("topMost is null"); - return false; - } - - hWndInsertAfter = topMost.getInt(null); - } else { - Field noTopMost = getOSField("HWND_NOTOPMOST"); - if (null == noTopMost) { - logger.warning("HWND_NOTOPMOST is null"); - return false; - } - - hWndInsertAfter = noTopMost.getInt(null); - } - - Field noSizeField = getOSField("SWP_NOSIZE"); - if (null == noSizeField) { - logger.warning("SWP_NOSIZE is null"); - return false; - } - - noSize = noSizeField.getInt(null); - - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Method m = getOSMethod("SetWindowPos", - int.class, int.class, int.class, - int.class, int.class, int.class, int.class); - - /* org.eclipse.swt.widgets.Shell */ - int shellHandle = 0; - try { - Field field = shell.getClass().getField("handle"); - shellHandle = field.getInt(shell); - logger.info("shell.handle:" + shellHandle); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } catch (IllegalAccessException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } catch (SecurityException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } catch (NoSuchFieldException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } - - invokeOSMethod(m, shellHandle, hWndInsertAfter, - location.x, location.y, 0, 0, noSize); - - } else if (SwtUtil.isMacPlatform()) { - /* do nothing */ - logger.warning("not supported yet"); - return false; - } - - return true; - } - - private static boolean setTopMost64(Shell shell, boolean isOnTop) { - if (SwtUtil.isLinuxPlatform()) { - Boolean gdkWindowingX11 = - (Boolean) invokeOSMethod(getOSMethod("GDK_WINDOWING_X11")); - if (null == gdkWindowingX11) { - logger.warning("GDK_WINDOWING_X11 returned null. There is no x11 system."); - return false; - } - - int eventData0 = isOnTop ? 1 : 0; /* 'add' or 'remove' */ - long topHandle = 0; - - Method m = null; - try { - m = Shell.class.getDeclaredMethod("topHandle", new Class<?>[] {}); - - m.setAccessible(true); - topHandle = (Long) m.invoke(shell, new Object[] {}); - } catch (SecurityException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (NoSuchMethodException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (InvocationTargetException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Long gtkWidgetWindow = (Long) invokeOSMethod( - getOSMethod("GTK_WIDGET_WINDOW", long.class), topHandle); - if (null == gtkWidgetWindow) { - logger.warning("GTK_WIDGET_WINDOW returned null"); - return false; - } - - Long xWindow = (Long) invokeOSMethod( - getOSMethod("gdk_x11_drawable_get_xid", long.class), gtkWidgetWindow); - if (null == xWindow) { - logger.warning("gdk_x11_drawable_get_xid returned null"); - return false; - } - - Long gdkDisplay = (Long) invokeOSMethod( - getOSMethod("gdk_display_get_default")); - if (null == gdkDisplay) { - logger.warning("gdk_display_get_default returned null"); - return false; - } - - Long xDisplay = (Long) invokeOSMethod( - getOSMethod("gdk_x11_display_get_xdisplay", long.class), gdkDisplay); - if (null == xDisplay) { - logger.warning("gdk_x11_display_get_xdisplay returned null"); - - /* deprecated function */ - xDisplay = (Long) invokeOSMethod(getOSMethod("GDK_DISPLAY")); - if (null == xDisplay) { - logger.warning("GDK_DISPLAY returned null"); - return false; - } - } - - Method xInternAtom = getOSMethod( - "XInternAtom", long.class, byte[].class, boolean.class); - - Class<?> converterClass = null; - try { - converterClass = Class.forName("org.eclipse.swt.internal.Converter"); - } catch (ClassNotFoundException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Method wcsToMbcs = null; - byte[] messageBufferState = null; - byte[] messageBufferAbove = null; - - try { - wcsToMbcs = converterClass.getMethod( - "wcsToMbcs", String.class, String.class, boolean.class); - } catch (SecurityException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (NoSuchMethodException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - try { - messageBufferState = - (byte[]) wcsToMbcs.invoke(null, null, "_NET_WM_STATE", true); - messageBufferAbove = - (byte[]) wcsToMbcs.invoke(null, null, "_NET_WM_STATE_ABOVE", true); - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (InvocationTargetException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Long xMessageAtomType = (Long) invokeOSMethod( - xInternAtom, xDisplay, messageBufferState, false); - if (null == xMessageAtomType) { - logger.warning("xMessageAtomType is null"); - return false; - } - - Long xMessageAtomAbove = (Long) invokeOSMethod( - xInternAtom, xDisplay, messageBufferAbove, false); - if (null == xMessageAtomAbove) { - logger.warning("xMessageAtomAbove is null"); - return false; - } - - Class<?> eventClazz = null; - Object event = null; - try { - eventClazz = Class.forName("org.eclipse.swt.internal.gtk.XClientMessageEvent"); - event = eventClazz.newInstance(); - } catch (InstantiationException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } catch (ClassNotFoundException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - } - - if (null == eventClazz || null == event) { - return false; - } - - Long malloc = null; - try { - Field type = eventClazz.getField("type"); - - Field clientMessageField = getOSField("ClientMessage"); - if (null == clientMessageField) { - logger.warning("clientMessageField is null"); - return false; - } - type.set(event, clientMessageField.get(null)); - - Field window = eventClazz.getField("window"); - window.set(event, xWindow); - Field messageType = eventClazz.getField("message_type"); - messageType.set(event, xMessageAtomType); - Field format = eventClazz.getField("format"); - format.set(event, 32); - - Object data = Array.newInstance(long.class, 5); - Array.setLong(data, 0, eventData0); - Array.setLong(data, 1, xMessageAtomAbove); - Array.setLong(data, 2, 0); - Array.setLong(data, 3, 0); - Array.setLong(data, 4, 0); - - Field dataField = eventClazz.getField("data"); - dataField.set(event, data); - - Field sizeofField = eventClazz.getField("sizeof"); - Integer sizeof = (Integer) sizeofField.get(null); - - Method gMalloc = getOSMethod("g_malloc", long.class); - malloc = (Long) invokeOSMethod(gMalloc, sizeof.longValue()); - - Method memmove = - getOSMethod("memmove", long.class, eventClazz, long.class); - invokeOSMethod(memmove, malloc, event, sizeof.longValue()); - - } catch (NoSuchFieldException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Method xDefaultRootWindow = - getOSMethod("XDefaultRootWindow", long.class); - Long rootWin = - (Long) invokeOSMethod(xDefaultRootWindow, xDisplay); - - Method xSendEvent = getOSMethod("XSendEvent", long.class, long.class, boolean.class, - long.class, long.class); - Method xFlush = getOSMethod("XFlush", long.class); - - /* ubstructureRedirectMask : 1L<<20 | SubstructureNotifyMask : 1L<<19 */ - invokeOSMethod(xSendEvent, xDisplay, rootWin, - false, (long) (1L << 20 | 1L << 19), malloc); - invokeOSMethod(xFlush, xDisplay); - - invokeOSMethod(getOSMethod("g_free", long.class), malloc); - - } else if (SwtUtil.isWindowsPlatform()) { - Point location = shell.getLocation(); - - long hWndInsertAfter = 0; - int noSize = 0; - - try { - if (isOnTop) { - Field topMost = getOSField("HWND_TOPMOST"); - if (null == topMost) { - logger.warning("topMost is null"); - return false; - } - - hWndInsertAfter = topMost.getLong(null); - } else { - Field noTopMost = getOSField("HWND_NOTOPMOST"); - if (null == noTopMost) { - logger.warning("noTopMost is null"); - return false; - } - - hWndInsertAfter = noTopMost.getLong(null); - } - - Field noSizeField = getOSField("SWP_NOSIZE"); - if (null == noSizeField) { - logger.warning("SWP_NOSIZE is null"); - return false; - } - - noSize = noSizeField.getInt(null); - - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); - return false; - } - - Method m = getOSMethod("SetWindowPos", - long.class, long.class, int.class, - int.class, int.class, int.class, int.class); - - /* org.eclipse.swt.widgets.Shell */ - long shellHandle = 0; - try { - Field field = shell.getClass().getField("handle"); - shellHandle = field.getLong(shell); - logger.info("shell.handle:" + shellHandle); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } catch (IllegalAccessException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } catch (SecurityException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } catch (NoSuchFieldException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - return false; - } - - invokeOSMethod(m, shellHandle, hWndInsertAfter, - location.x, location.y, 0, 0, noSize); - - } else if (SwtUtil.isMacPlatform()) { - /* do nothing */ - logger.warning("not supported yet"); - return false; - } - - return true; - } - - public static boolean setTopMost(Shell shell, boolean isOnTop) { - if (shell == null) { - return false; - } - - logger.info("set Always on Top : " + isOnTop); - - if (SwtUtil.is64bitPlatform() == true) { - logger.info("64bit architecture : " + System.getProperty("os.arch")); - return setTopMost64(shell, isOnTop); /* 64bit */ - } - - logger.info("32bit architecture : " + System.getProperty("os.arch")); - return setTopMost32(shell, isOnTop); /* 32bit */ - } - - public static int getAngleFromVector(Control con, int x, int y) { - return (int)Math.toDegrees( - Math.atan2(y - (con.getSize().y / 2), x - (con.getSize().x / 2))); - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/StringUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/StringUtil.java deleted file mode 100644 index 34a7899cbb..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/StringUtil.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * String Utilities - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 - * - */ - -package org.tizen.emulator.skin.util; - -import java.io.File; -import java.io.IOException; - -/** - * - * - */ -public class StringUtil { - private StringUtil() { - /* do nothing */ - } - - public static boolean isEmpty(String value) { - return (null == value) || (0 == value.length()); - } - - public static String nvl(String value) { - return (null == value) ? "" : value; - } - - public static String getCanonicalPath(String filePath) throws IOException { - String canonicalPath = ""; - - File file = new File(filePath); - if (file.exists() == false) { - return ""; - } - - try { - canonicalPath = file.getCanonicalPath(); - - if (file.isDirectory() == false) { - canonicalPath = canonicalPath.substring( - 0, canonicalPath.lastIndexOf(File.separator)); - if (canonicalPath.compareTo("") == 0) { - return "./"; - } - } - } catch (IOException e) { - throw e; - } - - return canonicalPath; - } -} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SwtUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SwtUtil.java deleted file mode 100644 index 01bed42234..0000000000 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SwtUtil.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * SWT Utilities - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@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 - * - */ - -package org.tizen.emulator.skin.util; - -import org.eclipse.swt.SWT; - - -/** - * - * - */ -public class SwtUtil { - private SwtUtil() { - /* do nothing */ - } - - public static boolean isLinuxPlatform() { - return "gtk".equalsIgnoreCase(SWT.getPlatform()); - } - - public static boolean isWindowsPlatform() { - return "win32".equalsIgnoreCase(SWT.getPlatform()); /* win32-win32-x86_64 */ - } - - public static boolean isMacPlatform() { - return "cocoa".equalsIgnoreCase(SWT.getPlatform()); - } - - public static boolean is64bitPlatform() { - /* internal/Library.java::arch() */ - String osArch = System.getProperty("os.arch"); /* $NON-NLS-1$ */ - - if (osArch.equals("amd64") || osArch.equals("x86_64") || - osArch.equals("IA64W") || osArch.equals("ia64")) { - /* $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ */ - return true; - } - - return false; - } -} diff --git a/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd b/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd deleted file mode 100644 index 2b9f3c011f..0000000000 --- a/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd +++ /dev/null @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.tizen.org/emulator/skin/dbi" -xmlns:dbi="http://www.tizen.org/emulator/skin/dbi" elementFormDefault="qualified"> - - <element name="EmulatorUI"> - <complexType> - <all> - <element name="dbi_version" type="float" minOccurs="1" maxOccurs="1"> </element> - <element name="layer" type="string" minOccurs="0" maxOccurs="1"> </element> - <element name="rotations" type="dbi:rotationsType" minOccurs="1" maxOccurs="1"> </element> - <element name="hover" type="dbi:hoverType" minOccurs="0" maxOccurs="1"> </element> - <element name="popupMenu" type="dbi:popupMenuType" minOccurs="0" maxOccurs="1"> </element> - <element name="option" type="dbi:optionType" minOccurs="0" maxOccurs="1"> </element> - </all> - </complexType> - </element> - - <complexType name="rotationsType"> - <sequence> - <element name="rotation" type="dbi:rotationType" minOccurs="1" maxOccurs="unbounded"> </element> - </sequence> - </complexType> - - <complexType name="rotationType"> - <sequence> - <element name="display" type="dbi:displayType" minOccurs="1" maxOccurs="1"> </element> - <element name="imageList" type="dbi:imageListType" minOccurs="1" maxOccurs="1"> </element> - <element name="keyMapList" type="dbi:keyMapListType" minOccurs="1" maxOccurs="1"> </element> - </sequence> - <attribute name="name" type="dbi:rotationNameType" use="required"> </attribute> - </complexType> - - <simpleType name="rotationNameType"> - <restriction base="string"> - <enumeration value="Portrait"> </enumeration> - <enumeration value="Landscape"> </enumeration> - <enumeration value="Reverse Portrait"> </enumeration> - <enumeration value="Reverse Landscape"> </enumeration> - </restriction> - </simpleType> - - <complexType name="imageListType"> - <all> - <element name="mainImage" type="string" minOccurs="1" maxOccurs="1"> </element> - <element name="keyPressedImage" type="string" minOccurs="0" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="displayType"> - <all> - <element name="region" type="dbi:regionType" minOccurs="1" maxOccurs="1"> </element> - <element name="maskImage" type="string" minOccurs="0" maxOccurs="1"> </element> - <element name="rotaryImage" type="string" minOccurs="0" maxOccurs="1"> </element> - </all> - <attribute name="id" type="int" use="required"> </attribute> - </complexType> - - <complexType name="keyMapListType"> - <sequence> - <element name="keyMap" type="dbi:keyMapType" minOccurs="0" maxOccurs="unbounded"> </element> - </sequence> - </complexType> - - <complexType name="keyMapType"> - <sequence> - <element name="region" type="dbi:regionType" minOccurs="1" maxOccurs="1"> </element> - <element name="eventInfo" type="dbi:eventInfoType" minOccurs="0" maxOccurs="1"> </element> - <element name="tooltip" type="string" minOccurs="0" maxOccurs="1"> </element> - </sequence> - </complexType> - - <complexType name="eventInfoType"> - <all> - <element name="keyCode" type="int" minOccurs="1" maxOccurs="1"> </element> - <element name="keyName" type="string" minOccurs="1" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="regionType"> - <attribute name="left" type="int"> </attribute> - <attribute name="top" type="int"> </attribute> - <attribute name="width" type="int"> </attribute> - <attribute name="height" type="int"> </attribute> - <attribute name="update" type="boolean" default="false" use="optional"> </attribute> - </complexType> - - <complexType name="hoverType"> - <all> - <element name="color" type="dbi:rgbType" minOccurs="0" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="rgbType"> - <attribute name="R" type="unsignedInt"> </attribute> - <attribute name="G" type="unsignedInt"> </attribute> - <attribute name="B" type="unsignedInt"> </attribute> - </complexType> - - <complexType name="popupMenuType"> - <all> - <element name="topmostItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="rotateItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="scaleItem" type="dbi:scaleItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="keywindowItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="hostKeyboardItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="ramdumpItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="shellItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="controlPanelItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="forceCloseItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - <element name="closeItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="menuItemType"> - <attribute name="itemName" type="string" default="" use="optional"> </attribute> - <attribute name="visible" type="boolean" default="true" use="optional"> </attribute> - </complexType> - - <complexType name="scaleItemType"> - <sequence> - <element name="factorItem" minOccurs="0" maxOccurs="unbounded"> - <complexType> - <simpleContent> - <extension base="int"> - <attribute name="itemName" type="string" default="" use="optional" /> - </extension> - </simpleContent> - </complexType> - </element> - </sequence> - <attribute name="itemName" type="string" default="" use="optional"> </attribute> - <attribute name="visible" type="boolean" default="true" use="optional"> </attribute> - </complexType> - - <complexType name="optionType"> - <all> - <element name="blankGuide" minOccurs="0" maxOccurs="1"> - <complexType> - <attribute name="visible" type="boolean" default="true" use="optional"> </attribute> - </complexType> - </element> - </all> - </complexType> - -</schema> diff --git a/tizen/src/skin/client/xsd/SpecialKeyWindow-layout.xsd b/tizen/src/skin/client/xsd/SpecialKeyWindow-layout.xsd deleted file mode 100644 index f53abc0354..0000000000 --- a/tizen/src/skin/client/xsd/SpecialKeyWindow-layout.xsd +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.tizen.org/emulator/skin/keywindow/dbi" -xmlns:dbi="http://www.tizen.org/emulator/skin/keywindow/dbi" elementFormDefault="qualified"> - - <element name="KeyWindowUI"> - <complexType> - <sequence> - <element name="dbi_version" type="float" minOccurs="1" maxOccurs="1"> </element> - <element name="imageList" type="dbi:imageListType" minOccurs="1" maxOccurs="1"> </element> - <element name="keyMapList" type="dbi:keyMapListType" minOccurs="1" maxOccurs="1"> </element> - <element name="hover" type="dbi:hoverType" minOccurs="0" maxOccurs="1"> </element> - </sequence> - </complexType> - </element> - - <complexType name="imageListType"> - <all> - <element name="mainImage" type="string" minOccurs="1" maxOccurs="1"> </element> - <element name="keyPressedImage" type="string" minOccurs="0" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="keyMapListType"> - <sequence> - <element name="keyMap" type="dbi:keyMapType" minOccurs="0" maxOccurs="unbounded"> </element> - </sequence> - </complexType> - - <complexType name="keyMapType"> - <sequence> - <element name="region" type="dbi:regionType" minOccurs="1" maxOccurs="1"> </element> - <element name="eventInfo" type="dbi:eventInfoType" minOccurs="0" maxOccurs="1"> </element> - <element name="tooltip" type="string" minOccurs="0" maxOccurs="1"> </element> - </sequence> - </complexType> - - <complexType name="eventInfoType"> - <all> - <element name="keyCode" type="int" minOccurs="1" maxOccurs="1"> </element> - <element name="keyName" type="string" minOccurs="1" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="regionType"> - <attribute name="left" type="int"> </attribute> - <attribute name="top" type="int"> </attribute> - <attribute name="width" type="int"> </attribute> - <attribute name="height" type="int"> </attribute> - </complexType> - - <complexType name="hoverType"> - <all> - <element name="color" type="dbi:rgbType" minOccurs="0" maxOccurs="1"> </element> - </all> - </complexType> - - <complexType name="rgbType"> - <attribute name="R" type="unsignedInt"> </attribute> - <attribute name="G" type="unsignedInt"> </attribute> - <attribute name="B" type="unsignedInt"> </attribute> - </complexType> - -</schema> diff --git a/tizen/src/skin/maruskin_client.c b/tizen/src/skin/maruskin_client.c deleted file mode 100644 index feb4d84d1d..0000000000 --- a/tizen/src/skin/maruskin_client.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * communicate with java skin process - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> - -#include "qemu-common.h" - -#include "maruskin_client.h" -#include "maruskin_server.h" -#include "emulator.h" -#include "util/sdb.h" -#include "debug_ch.h" -#include "emul_state.h" -#include "maruskin_operation.h" - -#ifdef CONFIG_WIN32 -#include <windows.h> -#include "qemu/error-report.h" -#endif - -MULTI_DEBUG_CHANNEL(qemu, skinclient); - - -#define SKIN_SERVER_READY_TIME 3 /* second */ -#define SKIN_SERVER_SLEEP_TIME 10 /* milli second */ - -#define SPACE_LEN 1 -#define QUOTATION_LEN 2 -#define EQUAL_LEN 1 - -#define OPT_UID "uid" -#define OPT_VM_PATH "vm.path" -#define OPT_VM_SKIN_PORT "vm.skinport" -#define OPT_VM_BASE_PORT "vm.baseport" -#define OPT_DISPLAY_SHM "display.shm" -#define OPT_INPUT_MOUSE "input.mouse" -#define OPT_INPUT_TOUCH "input.touch" -#define OPT_MAX_TOUCHPOINT "input.touch.maxpoint" -#define OPT_PROXY_ADDR "proxy.addr" -#define OPT_PROXY_PORT "proxy.port" -#define OPT_USE_TAP "use.tap" - -#define OPT_BOOLEAN_TRUE "true" -#define OPT_BOOLEAN_FALSE "false" - -extern char tizen_target_path[]; - -static int skin_argc; -static char** skin_argv; - -#ifdef CONFIG_WIN32 -static const char* JAVA_EXEFILE_PATH = NULL; -#endif - -static void *run_skin_client(void *arg) -{ - gchar *cmd = NULL; - char argv[JAVA_MAX_COMMAND_LENGTH] = { 0, }; - - INFO("run skin client\n"); - int i; - for (i = 0; i < skin_argc; ++i) { - strncat(argv, "\"", 1); - strncat(argv, skin_argv[i], strlen(skin_argv[i])); - strncat(argv, "\" ", 2); - INFO("[skin args %d] %s\n", i, skin_argv[i]); - } - - //srand( time( NULL ) ); - int uid = 0; //rand(); - //INFO( "generated skin uid:%d\n", uid ); - - char* vm_path = tizen_target_path; - //INFO( "vm_path:%s\n", vm_path ); - - int skin_server_port = get_skin_server_port(); - int vm_base_port = get_emul_vm_base_port(); - - char buf_skin_server_port[16] = { 0, }; - char buf_uid[16] = { 0, }; - char buf_vm_base_port[16] = { 0, }; - sprintf(buf_skin_server_port, "%d", skin_server_port); - sprintf(buf_uid, "%d", uid); - sprintf(buf_vm_base_port, "%d", vm_base_port); - - /* display */ - char buf_display_shm[8] = { 0, }; - 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, }; - if (is_mouse_enabled() == true) { - strcpy(buf_input, OPT_INPUT_MOUSE); - } else { - strcpy(buf_input, OPT_INPUT_TOUCH); - } - - /* network */ - const char *proxy_addr = NULL; - int proxy_addr_len = 0; - - const char *http_proxy = get_http_proxy_addr(); - if (!http_proxy || !g_strcmp0("", http_proxy)) { - proxy_addr = g_strdup_printf("%s= %s=", - OPT_PROXY_ADDR, OPT_PROXY_PORT); - proxy_addr_len = (int)strlen(proxy_addr); - } else { - char **proxy = g_strsplit(http_proxy, ":", 2); - if (proxy[0] && proxy[1]) { - proxy_addr = g_strdup_printf("%s=%s %s=%s", - OPT_PROXY_ADDR, proxy[0], - OPT_PROXY_PORT, proxy[1]); - proxy_addr_len = (int)strlen(proxy_addr); - } - g_strfreev(proxy); - } - gchar const* tap_enabled = g_strdup_printf("%s=%s", OPT_USE_TAP, - is_netclient_tap_attached() ? "true" : "false"); - int tap_opt_len = (int)strlen(tap_enabled); - - get_java_path(&JAVA_EXEFILE_PATH); -#ifdef CONFIG_WIN32 - char const* bin_dir = get_bin_path(); - int bin_len = strlen(bin_dir); - char bin_dir_win[bin_len]; - strcpy(bin_dir_win, bin_dir); - bin_dir_win[strlen(bin_dir_win) -1] = '\0'; -#else - char const* bin_dir = get_bin_path(); -#endif - INFO("bin directory : %s\n", bin_dir); - - int maxtouchpoint = get_max_touch_point(); - int len_maxtouchpoint = 0; - if (maxtouchpoint > 9) { - len_maxtouchpoint = 2; - } else { - len_maxtouchpoint = 1; - } - - /* calculate buffer length */ - int cmd_len = strlen(JAVA_EXEFILE_PATH) + SPACE_LEN + - strlen(JAVA_EXEOPTION) + SPACE_LEN + - strlen(JAVA_LIBRARY_PATH) + EQUAL_LEN + -#ifdef CONFIG_WIN32 - QUOTATION_LEN + strlen((char*)bin_dir_win) + SPACE_LEN + - QUOTATION_LEN + strlen(bin_dir) + strlen(JAR_SKINFILE) + SPACE_LEN + -#else - QUOTATION_LEN + strlen(bin_dir) + SPACE_LEN + - QUOTATION_LEN + strlen(bin_dir) + strlen(JAR_SKINFILE) + SPACE_LEN + -#endif - - strlen(OPT_VM_SKIN_PORT) + EQUAL_LEN + - strlen(buf_skin_server_port) + SPACE_LEN + - strlen(OPT_UID) + EQUAL_LEN + - strlen(buf_uid) + SPACE_LEN + - strlen(OPT_VM_PATH) + EQUAL_LEN + - QUOTATION_LEN + strlen(vm_path) + SPACE_LEN + - strlen(OPT_VM_BASE_PORT) + EQUAL_LEN + - strlen(buf_vm_base_port) + SPACE_LEN + - strlen(OPT_DISPLAY_SHM) + EQUAL_LEN + - strlen(buf_display_shm) + SPACE_LEN + - strlen(buf_input) + EQUAL_LEN + - strlen(OPT_BOOLEAN_TRUE) + SPACE_LEN + - strlen(OPT_MAX_TOUCHPOINT) + EQUAL_LEN + - len_maxtouchpoint + SPACE_LEN + - proxy_addr_len + SPACE_LEN + - tap_opt_len + SPACE_LEN + 1 + - strlen(argv); - - INFO("skin command length : %d\n", cmd_len); - cmd = g_malloc0(cmd_len); - - /*if (len > JAVA_MAX_COMMAND_LENGTH) { - INFO("swt command length is too long! (%d)\n", len); - len = JAVA_MAX_COMMAND_LENGTH; - }*/ - - snprintf(cmd, cmd_len, "%s %s %s=\"%s\" \ -\"%s%s\" \ -%s=%d \ -%s=%d \ -%s=\"%s\" \ -%s=%d \ -%s=%s \ -%s=%s \ -%s=%d \ -%s \ -%s \ -%s", - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, -#ifdef CONFIG_WIN32 - bin_dir_win, bin_dir, JAR_SKINFILE, -#else - bin_dir, bin_dir, JAR_SKINFILE, -#endif - OPT_VM_SKIN_PORT, skin_server_port, - OPT_UID, uid, - OPT_VM_PATH, vm_path, - OPT_VM_BASE_PORT, vm_base_port, - OPT_DISPLAY_SHM, buf_display_shm, - buf_input, OPT_BOOLEAN_TRUE, - OPT_MAX_TOUCHPOINT, maxtouchpoint, - proxy_addr, - tap_enabled, - argv); - - INFO("command for swt : %s\n", cmd); - -#ifdef CONFIG_WIN32 - /* for 64bit windows */ - JAVA_EXEFILE_PATH = NULL; - - //WinExec( cmd, SW_SHOW ); - { - STARTUPINFO sti = { 0 }; - PROCESS_INFORMATION pi = { 0 }; - if (!CreateProcess(NULL, - cmd, - NULL, - NULL, - FALSE, - NORMAL_PRIORITY_CLASS, - NULL, - NULL, - &sti, - &pi)) - { - ERR("Unable to generate process! error %u\n", GetLastError()); - error_report("CreateProcess function failed. " - "Unable to generate process."); - exit(1); - } - - INFO("wait for single object..\n"); - DWORD dwRet = WaitForSingleObject( - pi.hProcess, // process handle - INFINITE); - - switch(dwRet) { - case WAIT_OBJECT_0: - INFO("the child thread state was signaled!\n"); - break; - case WAIT_TIMEOUT: - INFO("time-out interval elapsed,\ - and the child thread's state is nonsignaled.\n"); - break; - case WAIT_FAILED: - ERR("WaitForSingleObject() failed, error %u\n", GetLastError()); - break; - } - - /* retrieves the termination status of the specified process */ - if (GetExitCodeProcess(pi.hProcess, &dwRet) != 0) { - ERR("failed to GetExitCodeProcess, error %u\n", GetLastError()); - } - INFO("child return value : %d\n", dwRet); - - if (dwRet != 0) { - /* child process is terminated with some problem. - So qemu process will terminate, too. immediately. */ - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - } - - if (CloseHandle(pi.hProcess) != 0) { - INFO("child thread handle was closed successfully!\n"); - } else { - ERR("failed to close child thread handle, error %u\n", GetLastError()); - } - } - -#else /* ifndef CONFIG_WIN32 */ - int ret = system(cmd); - - if (ret == 127) { - INFO("can't execute /bin/sh!\n"); - } else if(ret == -1) { - INFO("fork error!\n"); - } else { - ret = WEXITSTATUS(ret); - /* The high-order 8 bits are the exit code from exit() */ - /* The low-order 8 bits are zero if the process exited normally */ - INFO("child return value : %d\n", ret); - - if (ret != 0) { - /* child process is terminated with some problem. - So qemu process will terminate, too. immediately. */ - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - } - } - -#endif - - g_free(cmd); - - return NULL; -} - -int start_skin_client(int argc, char* argv[]) -{ - int count = 0; - int skin_server_ready = 0; - - while(1) { - if (100 * SKIN_SERVER_READY_TIME < count) { - break; - } - - if (is_ready_skin_server()) { - skin_server_ready = 1; - break; - } else { - count++; - INFO("sleep for ready. count:%d\n", count); - -#ifdef CONFIG_WIN32 - Sleep(SKIN_SERVER_SLEEP_TIME); -#else - usleep(1000 * SKIN_SERVER_SLEEP_TIME); -#endif - } - - } - - if (!skin_server_ready) { - ERR("skin_server is not ready.\n"); - return -1; - } - - skin_argc = argc; - skin_argv = argv; - QemuThread thread_id; - qemu_thread_create(&thread_id, "skin_client", run_skin_client, NULL, QEMU_THREAD_DETACHED); - return 1; -} - -#ifdef CONFIG_JAVA_UI -int start_simple_client(char* msg) -{ - int ret = 0; - gchar *cmd = NULL; - - INFO("run simple client\n"); - - get_java_path(&JAVA_EXEFILE_PATH); -#ifdef CONFIG_WIN32 - char const* bin_dir = get_bin_path(); - int bin_dir_len = strlen(bin_dir); - char bin_dir_win[bin_dir_len]; - strcpy(bin_dir_win, bin_dir); - bin_dir_win[strlen(bin_dir_win) -1] = '\0'; -#else - char const* bin_dir = get_bin_path(); -#endif - INFO("bin directory : %s\n", bin_dir); - - /* calculate buffer length */ - int cmd_len = strlen(JAVA_EXEFILE_PATH) + SPACE_LEN + - strlen(JAVA_EXEOPTION) + SPACE_LEN + - strlen(JAVA_LIBRARY_PATH) + EQUAL_LEN + -#ifdef CONFIG_WIN32 - QUOTATION_LEN + strlen((char*)bin_dir_win) + SPACE_LEN + - QUOTATION_LEN + strlen(bin_dir) + strlen(JAR_SKINFILE) + SPACE_LEN + -#else - QUOTATION_LEN + strlen(bin_dir) + SPACE_LEN + - QUOTATION_LEN + strlen(bin_dir) + strlen(JAR_SKINFILE) + SPACE_LEN + -#endif - - strlen(JAVA_SIMPLEMODE_OPTION) + EQUAL_LEN + - QUOTATION_LEN + strlen(msg) + 1; - - INFO("skin command length : %d\n", cmd_len); - cmd = g_malloc0(cmd_len); - - snprintf(cmd, cmd_len, "%s %s %s=\"%s\" \"%s%s\" %s=\"%s\"", -#ifdef CONFIG_WIN32 - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, bin_dir_win, -#else - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, bin_dir, -#endif - bin_dir, JAR_SKINFILE, JAVA_SIMPLEMODE_OPTION, msg); - - INFO("command for swt : %s\n", cmd); - -#ifdef CONFIG_WIN32 - JAVA_EXEFILE_PATH = NULL; - - ret = WinExec(cmd, SW_SHOW); -#else - ret = system(cmd); -#endif - - INFO("child return value : %d\n", ret); - - g_free(cmd); - - return 1; -} -#else -// FIXME: should implement it -int start_simple_client(char* msg) { - return 1; -} -#endif diff --git a/tizen/src/skin/maruskin_client.h b/tizen/src/skin/maruskin_client.h deleted file mode 100644 index 5e6cd3d256..0000000000 --- a/tizen/src/skin/maruskin_client.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * communicate with java skin process - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 MARUSKIN_CLIENT_H_ -#define MARUSKIN_CLIENT_H_ - -#include "tizen/src/util/exported_strings.h" - -int start_skin_client(int argc, char* argv[]); -int start_simple_client(char* msg); - -#endif /* MARUSKIN_CLIENT_H_ */ diff --git a/tizen/src/skin/maruskin_keymap.c b/tizen/src/skin/maruskin_keymap.c deleted file mode 100644 index 3a15284283..0000000000 --- a/tizen/src/skin/maruskin_keymap.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * keymap - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 "maruskin_keymap.h" -#include "emul_state.h" -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(qemu, skinkeymap); - -#ifdef KEYMAP_DEBUG -static void trace_binary(int decimal) -{ - if (decimal != 0) { - trace_binary(decimal / 2); - fprintf(stdout, "%d", decimal % 2); - fflush(stdout); - } -} -#endif - -int javakeycode_to_scancode( - int event_type, int java_keycode, int state_mask, int key_location) -{ - bool character = true; - int vk = 0; - -#ifdef KEYMAP_DEBUG - /* print key information */ - TRACE("keycode = %d(", java_keycode); - trace_binary(java_keycode); - fprintf(stdout, ")\n"); -#endif - - character = !(java_keycode & JAVA_KEYCODE_BIT); - vk = java_keycode & JAVA_KEY_MASK; - - /* CapsLock & NumLock key processing */ - if (character == false) { - if (vk == JAVA_KEY_CAPS_LOCK) { - if (event_type == KEY_PRESSED) { - set_emul_caps_lock_state(get_emul_caps_lock_state() ^ 1); //toggle - } - return 58; - } else if (vk == JAVA_KEY_NUM_LOCK) { - if (event_type == KEY_PRESSED) { - set_emul_num_lock_state(get_emul_num_lock_state() ^ 1); //toggle - } - return 69; - } - } - - /* check CapsLock & NumLock key sync */ - if (event_type == KEY_PRESSED) { - int caps_lock = -1; - int num_lock = -1; - - caps_lock = get_host_lock_key_state(HOST_CAPSLOCK_KEY); - num_lock = get_host_lock_key_state(HOST_NUMLOCK_KEY); - - if (caps_lock != -1 && get_emul_caps_lock_state() != caps_lock) { - virtio_keyboard_event(58); - virtio_keyboard_event(58 | 0x80); - set_emul_caps_lock_state(get_emul_caps_lock_state() ^ 1); - INFO("qemu CapsLock state was synchronized with host key value (%d)\n", - get_emul_caps_lock_state()); - } - if (num_lock != -1 && get_emul_num_lock_state() != num_lock) { - virtio_keyboard_event(69); - virtio_keyboard_event(69 | 0x80); - set_emul_num_lock_state(get_emul_num_lock_state() ^ 1); - INFO("qemu NumLock state was synchronized with host key value (%d)\n", - get_emul_num_lock_state()); - } - } - -#if 0 -#ifdef _WIN32 - return MapVirtualKey(vk, MAPVK_VK_TO_VSC); -#endif -#endif - - if (vk == 0) { //meta keys - TRACE("meta key\n"); - - if (java_keycode == JAVA_KEYCODE_BIT_CTRL) { /* ctrl key */ - if (key_location == JAVA_KEYLOCATION_RIGHT) { - virtio_keyboard_event(224); //0xE0 - } - return 29; - } else if (java_keycode == JAVA_KEYCODE_BIT_SHIFT) { /* shift key */ -#ifndef _WIN32 - //keyLocation information is not supported at swt of windows version - if (key_location == JAVA_KEYLOCATION_RIGHT) { - return 54; /* Shift_R */ - } -#endif - return 42; - } else if (java_keycode == JAVA_KEYCODE_BIT_ALT) { /* alt key */ - if (key_location == JAVA_KEYLOCATION_RIGHT) { - virtio_keyboard_event(224); - } - return 56; - } else { - return -1; - } - } - - if (character == false) - { /* non-character keys */ - if (vk >= JAVA_KEY_F1 && vk <= JAVA_KEY_F20) { /* function keys */ - TRACE("function key\n"); - - vk += 255; - } else { /* special keys */ - TRACE("special key\n"); - - switch(vk) { - case JAVA_KEY_ARROW_UP : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - vk = KEY_UP; - break; - case JAVA_KEY_ARROW_DOWN : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - vk = KEY_DOWN; - break; - case JAVA_KEY_ARROW_LEFT : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - vk = KEY_LEFT; - break; - case JAVA_KEY_ARROW_RIGHT : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - vk = KEY_RIGHT; - break; - - case JAVA_KEY_PAGE_UP : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - return 73; - case JAVA_KEY_PAGE_DOWN : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - return 81; - case JAVA_KEY_HOME : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - return 71; - case JAVA_KEY_END : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - return 79; - case JAVA_KEY_INSERT : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - return 82; - - case JAVA_KEY_KEYPAD_MULTIPLY : - return 55; - case JAVA_KEY_KEYPAD_ADD : - return 78; - case JAVA_KEY_KEYPAD_SUBTRACT : - return 74; - case JAVA_KEY_KEYPAD_DECIMAL : - return 83; - case JAVA_KEY_KEYPAD_DIVIDE : - return 53; - case JAVA_KEY_KEYPAD_0 : - return 82; - case JAVA_KEY_KEYPAD_1 : - return 79; - case JAVA_KEY_KEYPAD_2 : - return 80; - case JAVA_KEY_KEYPAD_3 : - return 81; - case JAVA_KEY_KEYPAD_4 : - return 75; - case JAVA_KEY_KEYPAD_5 : - return 76; - case JAVA_KEY_KEYPAD_6 : - return 77; - case JAVA_KEY_KEYPAD_7 : - return 71; - case JAVA_KEY_KEYPAD_8 : - return 72; - case JAVA_KEY_KEYPAD_9 : - return 73; - case JAVA_KEY_KEYPAD_CR : /* KP_ENTER */ - virtio_keyboard_event(224); - return 28; - case JAVA_KEY_SCROLL_LOCK : - return 70; - case JAVA_KEY_PAUSE : - case JAVA_KEY_BREAK : - return 198; - case JAVA_KEY_PRINT_SCREEN : - //not support - return -1; - break; - default : - return -1; - break; - } - } - } - else - { /* character keys */ - switch(vk) { - case JAVA_KEY_DELETE : - if (key_location != JAVA_KEYLOCATION_KEYPAD) { - virtio_keyboard_event(224); - } - break; - default : - break; - } - } - - return vkkey2scancode[vk]; -} diff --git a/tizen/src/skin/maruskin_keymap.h b/tizen/src/skin/maruskin_keymap.h deleted file mode 100644 index 77beb6393b..0000000000 --- a/tizen/src/skin/maruskin_keymap.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * keymap - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 MARUSKIN_KEYMAP_H_ -#define MARUSKIN_KEYMAP_H_ - -#include "hw/virtio/maru_virtio_keyboard.h" - -/* keep it consistent with emulator-skin(swt) virtual keycode */ -#define JAVA_KEYCODE_BIT (1 << 24) -#define JAVA_KEYCODE_NO_FOCUS (1 << 19) -#define JAVA_KEYCODE_BIT_CTRL (1 << 18) -#define JAVA_KEYCODE_BIT_SHIFT (1 << 17) -#define JAVA_KEYCODE_BIT_ALT (1 << 16) - -//key location -#define JAVA_KEYLOCATION_KEYPAD (1 << 1) -#define JAVA_KEYLOCATION_LEFT (1 << 14) -#define JAVA_KEYLOCATION_RIGHT (1 << 17) - -#define JAVA_KEY_MASK 0xFFFF; - -enum JAVA_KEYCODE { - JAVA_KEY_ARROW_UP = 1, - JAVA_KEY_ARROW_DOWN, - JAVA_KEY_ARROW_LEFT, - JAVA_KEY_ARROW_RIGHT, - JAVA_KEY_PAGE_UP, - JAVA_KEY_PAGE_DOWN, - JAVA_KEY_HOME, - JAVA_KEY_END, - JAVA_KEY_INSERT, - JAVA_KEY_F1 = 10, - JAVA_KEY_ESC = 27, - JAVA_KEY_F20 = 29, - JAVA_KEY_KEYPAD_MULTIPLY = 42, - JAVA_KEY_KEYPAD_ADD = 43, - JAVA_KEY_KEYPAD_SUBTRACT = 45, - JAVA_KEY_KEYPAD_DECIMAL = 46, - JAVA_KEY_KEYPAD_DIVIDE = 47, - JAVA_KEY_KEYPAD_0 = 48, - JAVA_KEY_KEYPAD_1 = 49, - JAVA_KEY_KEYPAD_2 = 50, - JAVA_KEY_KEYPAD_3 = 51, - JAVA_KEY_KEYPAD_4 = 52, - JAVA_KEY_KEYPAD_5 = 53, - JAVA_KEY_KEYPAD_6 = 54, - JAVA_KEY_KEYPAD_7 = 55, - JAVA_KEY_KEYPAD_8 = 56, - JAVA_KEY_KEYPAD_9 = 57, - JAVA_KEY_KEYPAD_CR = 80, - JAVA_KEY_CAPS_LOCK = 82, - JAVA_KEY_NUM_LOCK, - JAVA_KEY_SCROLL_LOCK, - JAVA_KEY_PAUSE, - JAVA_KEY_BREAK, - JAVA_KEY_PRINT_SCREEN, - JAVA_KEY_DELETE = 127 -}; - -#define KEY_MAX 0777 - -#define KEY_F0 0410 - -#ifdef KEY_F -#undef KEY_F -#endif -#define KEY_F(n) (KEY_F0 + (n)) - -#define KEY_DOWN 0402 -#define KEY_UP 0403 -#define KEY_LEFT 0404 -#define KEY_RIGHT 0405 - -#define KEY_BTAB 0541 - -#define SHIFT 0 - -/* for Java skin*/ -static const int vkkey2scancode[KEY_MAX] = { - [0 ... (KEY_MAX - 1)] = -1, - - [JAVA_KEY_ESC] = 1, /* Escape */ - ['1'] = 2, - ['2'] = 3, - ['3'] = 4, - ['4'] = 5, - ['5'] = 6, - ['6'] = 7, - ['7'] = 8, - ['8'] = 9, - ['9'] = 10, - ['0'] = 11, - ['-'] = 12, - ['='] = 13, - [JAVA_KEY_DELETE] = 83, /* Delete */ - [0x008] = 14, /* Backspace */ - - ['\t'] = 15, /* Tab */ - ['q'] = 16, - ['w'] = 17, - ['e'] = 18, - ['r'] = 19, - ['t'] = 20, - ['y'] = 21, - ['u'] = 22, - ['i'] = 23, - ['o'] = 24, - ['p'] = 25, - ['['] = 26, - [']'] = 27, - ['\n'] = 28, /* Return */ - ['\r'] = 28, /* Return */ - - ['a'] = 30, - ['s'] = 31, - ['d'] = 32, - ['f'] = 33, - ['g'] = 34, - ['h'] = 35, - ['j'] = 36, - ['k'] = 37, - ['l'] = 38, - [';'] = 39, - ['\''] = 40, /* Single quote */ - ['`'] = 41, - ['\\'] = 43, /* Backslash */ - - ['z'] = 44, - ['x'] = 45, - ['c'] = 46, - ['v'] = 47, - ['b'] = 48, - ['n'] = 49, - ['m'] = 50, - [','] = 51, - ['.'] = 52, - ['/'] = 53, - - [' '] = 57, /* Space */ - - [KEY_F(1)] = 59, /* Function Key 1 */ - [KEY_F(2)] = 60, /* Function Key 2 */ - [KEY_F(3)] = 61, /* Function Key 3 */ - [KEY_F(4)] = 62, /* Function Key 4 */ - [KEY_F(5)] = 63, /* Function Key 5 */ - [KEY_F(6)] = 64, /* Function Key 6 */ - [KEY_F(7)] = 65, /* Function Key 7 */ - [KEY_F(8)] = 66, /* Function Key 8 */ - [KEY_F(9)] = 67, /* Function Key 9 */ - [KEY_F(10)] = 68, /* Function Key 10 */ - [KEY_F(11)] = 87, /* Function Key 11 */ - [KEY_F(12)] = 88, /* Function Key 12 */ - - [KEY_UP] = 72, /* Up Arrow */ - [KEY_LEFT] = 75, /* Left Arrow */ - [KEY_RIGHT] = 77, /* Right Arrow */ - [KEY_DOWN] = 80, /* Down Arrow */ - - ['!'] = 2 | SHIFT, - ['@'] = 3 | SHIFT, - ['#'] = 4 | SHIFT, - ['$'] = 5 | SHIFT, - ['%'] = 6 | SHIFT, - ['^'] = 7 | SHIFT, - ['&'] = 8 | SHIFT, - ['*'] = 9 | SHIFT, - ['('] = 10 | SHIFT, - [')'] = 11 | SHIFT, - ['_'] = 12 | SHIFT, - ['+'] = 13 | SHIFT, - - [KEY_BTAB] = 15 | SHIFT, /* Shift + Tab */ - ['Q'] = 16 | SHIFT, - ['W'] = 17 | SHIFT, - ['E'] = 18 | SHIFT, - ['R'] = 19 | SHIFT, - ['T'] = 20 | SHIFT, - ['Y'] = 21 | SHIFT, - ['U'] = 22 | SHIFT, - ['I'] = 23 | SHIFT, - ['O'] = 24 | SHIFT, - ['P'] = 25 | SHIFT, - ['{'] = 26 | SHIFT, - ['}'] = 27 | SHIFT, - - ['A'] = 30 | SHIFT, - ['S'] = 31 | SHIFT, - ['D'] = 32 | SHIFT, - ['F'] = 33 | SHIFT, - ['G'] = 34 | SHIFT, - ['H'] = 35 | SHIFT, - ['J'] = 36 | SHIFT, - ['K'] = 37 | SHIFT, - ['L'] = 38 | SHIFT, - [':'] = 39 | SHIFT, - ['"'] = 40 | SHIFT, - ['~'] = 41 | SHIFT, - ['|'] = 43 | SHIFT, - - ['Z'] = 44 | SHIFT, - ['X'] = 45 | SHIFT, - ['C'] = 46 | SHIFT, - ['V'] = 47 | SHIFT, - ['B'] = 48 | SHIFT, - ['N'] = 49 | SHIFT, - ['M'] = 50 | SHIFT, - ['<'] = 51 | SHIFT, - ['>'] = 52 | SHIFT, - ['?'] = 53 | SHIFT, -}; - -int javakeycode_to_scancode( - int event_type, int java_keycode, int state_mask, int key_location); - -#endif /* MARUSKIN_KEYMAP_H_ */ diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c deleted file mode 100644 index 10033ba576..0000000000 --- a/tizen/src/skin/maruskin_operation.c +++ /dev/null @@ -1,493 +0,0 @@ -/* - * operation for emulator skin - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 <unistd.h> -#include <stdio.h> -#include <pthread.h> - -#include "qemu/sockets.h" -#include "sysemu/sysemu.h" -#include "hw/sysbus.h" - -#include "maruskin_operation.h" -#include "hw/pci/maru_brightness.h" -#include "hw/virtio/maru_virtio_hwkey.h" -#include "hw/virtio/maru_virtio_touchscreen.h" -#include "hw/virtio/maru_virtio_sensor.h" -#include "display/maru_display.h" -#include "emulator.h" -#include "debug_ch.h" -#include "util/sdb.h" -#include "emul_state.h" -#include "maruskin_keymap.h" -#include "maruskin_server.h" -#include "display/maru_display.h" -#include "hw/maru_pm.h" -#include "util/device_hotplug.h" -#include "ecs/ecs.h" -#include "hw/virtio/maru_virtio_evdi.h" -#include "hw/virtio/maru_virtio_rotary.h" -#include "ui/input.h" - -#ifdef CONFIG_HAX -#include "target-i386/hax-i386.h" -#endif - -MULTI_DEBUG_CHANNEL(qemu, skin_op); - -#define CLOSE_POWER_KEY_INTERVAL 1200 /* milli-seconds */ -#define DATA_DELIMITER "#" /* in detail info data */ - -extern pthread_mutex_t mutex_screenshot; -extern pthread_cond_t cond_screenshot; - -void start_display(uint64 handle_id, - unsigned int display_width, unsigned int display_height, - double scale_factor, short rotation_type, bool blank_guide) -{ - INFO("start display : handle_id=%ld, display size=%dx%d, " - "scale factor=%f, rotation=%d, blank guide=%d\n", - (long) handle_id, display_width, display_height, - scale_factor, rotation_type, blank_guide); - - set_emul_win_scale(scale_factor); - maru_ds_surface_init(handle_id, - display_width, display_height, blank_guide); -} - -void do_grabbing_enable(bool on) -{ - INFO("skin grabbing enable : %d\n", on); - - maru_display_set_invalidate(on); -} - -#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) -{ - /* multi-touch checking */ - state_mask &= ~JAVA_KEYCODE_NO_FOCUS; - - if ((keycode == JAVA_KEYCODE_BIT_CTRL && state_mask == JAVA_KEYCODE_BIT_ALT) || - (keycode == JAVA_KEYCODE_BIT_ALT && state_mask == JAVA_KEYCODE_BIT_CTRL)) - { - if (KEY_PRESSED == event_type) { - set_multi_touch_enable(3); - INFO("enable multi-touch mode 3\n"); - } - } - else if ((keycode == JAVA_KEYCODE_BIT_CTRL && state_mask == JAVA_KEYCODE_BIT_SHIFT) || - (keycode == JAVA_KEYCODE_BIT_SHIFT && state_mask == JAVA_KEYCODE_BIT_CTRL)) - { - if (KEY_PRESSED == event_type) { - set_multi_touch_enable(2); - INFO("enable multi-touch mode 2\n"); - } - } - else if (keycode == JAVA_KEYCODE_BIT_CTRL || keycode == JAVA_KEYCODE_BIT_SHIFT) - { - if (KEY_PRESSED == event_type) { - set_multi_touch_enable(1); - INFO("enable multi-touch mode 1\n"); - } else if (KEY_RELEASED == event_type) { - if (state_mask == (JAVA_KEYCODE_BIT_CTRL | JAVA_KEYCODE_BIT_SHIFT)) { - set_multi_touch_enable(1); - INFO("enable multi-touch mode 2->1\n"); - } else { - set_multi_touch_enable(0); - INFO("disable multi-touch : %d\n", get_finger_cnt()); - } - } - } - else if (keycode == JAVA_KEYCODE_BIT_ALT) - { - if (KEY_RELEASED == event_type) { - if (state_mask == (JAVA_KEYCODE_BIT_CTRL | JAVA_KEYCODE_BIT_ALT)) { - set_multi_touch_enable(1); - INFO("enable multi-touch mode 3->1\n"); - } else { - set_multi_touch_enable(0); - INFO("disable multi-touch : %d\n", get_finger_cnt()); - } - } - } - else - { - if (get_multi_touch_enable() != 0) { - set_multi_touch_enable(0); - INFO("disable multi-touch : %d\n", get_finger_cnt()); - } - } - - maru_display_update(); -} -#endif - -void do_keyboard_key_event(int event_type, - int keycode, int state_mask, int key_location) -{ - int scancode = -1; - - TRACE("Keyboard Key : event_type=%d, keycode=%d, " - "state_mask=%d, key_location=%d\n", - event_type, keycode, state_mask, key_location); - -#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); - } -#endif - - scancode = javakeycode_to_scancode(event_type, keycode, state_mask, key_location); - - if (scancode == -1) { - INFO("cannot find scancode\n"); - return; - } - - if (KEY_PRESSED == event_type) { - TRACE("key pressed: %d\n", scancode); - virtio_keyboard_event(scancode); - } else if (KEY_RELEASED == event_type) { - TRACE("key released: %d\n", scancode); - virtio_keyboard_event(scancode | 0x80); - } -} - -void do_scale_event(double scale_factor) -{ - INFO("do_scale_event scale_factor : %lf\n", scale_factor); - - set_emul_win_scale(scale_factor); -} - -void do_rotation_event(int rotation_type) -{ - INFO("do_rotation_event rotation_type : %d\n", rotation_type); -#if 1 - char *rotation = NULL; - - static char rot_0 [] = {'2','3','6','2',',','-','1','4','0',',','-','8','4','7','0',',','9','9','9','9','6','1',',','4', 0}; - static char rot_90 [] = {'-','9','9','4',',','-','4','2','0','8',',','-','7','0','3','2','1','1',',','9','1','8','2','7','9',',','4', 0}; - static char rot_180 [] = {'1','6','2','2',',','5','6','5','8',',','9','9','9','9','4','5',',','8','6','2','6',',','4', 0}; - static char rot_270 [] = {'1','4','1','6','8',',','1','6','0','4','6',',','7','0','9','8','6','0',',','7','0','4','0','1','6',',','4', 0}; - - switch (rotation_type) { - case ROTATION_PORTRAIT: - rotation = rot_0; - break; - case ROTATION_LANDSCAPE: - rotation = rot_90; - break; - case ROTATION_REVERSE_PORTRAIT: - rotation = rot_180; - break; - case ROTATION_REVERSE_LANDSCAPE: - rotation = rot_270; - break; - default: - ERR("Unknown rotation type: %d \n", rotation_type); - break; - } - - if (rotation != NULL) { - set_sensor_rotation_vector(rotation, strlen(rotation)); - } -#endif - - int x = 0, y = 0, z = 0; - - switch (rotation_type) { - case ROTATION_PORTRAIT: - x = 100; - y = accel_min_max(980665); - z = 100; - break; - case ROTATION_LANDSCAPE: - x = accel_min_max(980665); - y = 100; - z = 100; - break; - case ROTATION_REVERSE_PORTRAIT: - x = 100; - y = accel_min_max(-980665); - z = 100; - break; - case ROTATION_REVERSE_LANDSCAPE: - x = accel_min_max(-980665); - y = 100; - z = 100; - break; - default: - break; - } - - req_set_sensor_accel(x, y, z); -} - -void save_screenshot(DisplaySurface *surface) -{ - pthread_mutex_lock(&mutex_screenshot); - - MaruScreenShot *screenshot = get_screenshot(); - if (screenshot != NULL) { - screenshot->ready = true; - - if (screenshot->request == true) { - memcpy(screenshot->pixels, - surface_data(surface), - surface_stride(surface) * - surface_height(surface)); - screenshot->request = false; - - pthread_cond_signal(&cond_screenshot); - } - } - - pthread_mutex_unlock(&mutex_screenshot); -} - -Framebuffer *request_screenshot(void) -{ - const int length = get_display_resolution_width() * - get_display_resolution_height() * 4; - INFO("screenshot data length : %d\n", length); - - if (0 >= length) { - return NULL; - } - - Framebuffer *framebuffer = (Framebuffer *)g_malloc0(sizeof(Framebuffer)); - if (framebuffer == NULL) { - ERR("failed to malloc for framebuffer\n"); - - return NULL; - } - - framebuffer->data = (unsigned char *)g_malloc0(length); - if (framebuffer->data == NULL) { - g_free(framebuffer); - ERR("failed to malloc for framebuffer data\n"); - - return NULL; - } - - /* If display has been turned off, return empty buffer. - Because the empty buffer is seen as a black. */ - if (!display_off) { - pthread_mutex_lock(&mutex_screenshot); - - MaruScreenShot* screenshot = get_screenshot(); - if (screenshot == NULL || screenshot->ready == false) { - WARN("screenshot is null\n"); - - memset(framebuffer->data, 0x00, length); - } else { - screenshot->pixels = framebuffer->data; - screenshot->request = true; - maru_display_update(); - - // TODO : do not wait on communication thread - pthread_cond_wait(&cond_screenshot, &mutex_screenshot); - } - - pthread_mutex_unlock(&mutex_screenshot); - } - - framebuffer->data_length = length; - - return framebuffer; -} - -GuestIp* get_guest_ip(void) -{ - GuestIp* guest_ip = g_malloc0(sizeof(GuestIp)); - if (!guest_ip) { - ERR( "Fail to malloc for GuestIp.\n" ); - return NULL; - } - char *ip = get_emul_guest_ip(); - guest_ip->data = ip; - guest_ip->data_length = strlen(ip); - - return guest_ip; -} - -DetailInfo* get_detail_info(int qemu_argc, char** qemu_argv) -{ - DetailInfo* detail_info = g_malloc0( sizeof(DetailInfo) ); - if ( !detail_info ) { - ERR( "Fail to malloc for DetailInfo.\n" ); - return NULL; - } - - int i = 0; - int total_len = 0; - int delimiter_len = strlen( DATA_DELIMITER ); - - /* collect QEMU information */ - for ( i = 0; i < qemu_argc; i++ ) { - total_len += strlen( qemu_argv[i] ); - total_len += delimiter_len; - } - -#ifdef CONFIG_WIN32 - /* collect HAXM information */ - const int HAX_LEN = 32; - char hax_error[HAX_LEN]; - memset( hax_error, 0, HAX_LEN ); - - int hax_err_len = 0; - hax_err_len = sprintf( hax_error + hax_err_len, "%s", "hax_error=" ); - - int error = 0; -// FIXME: ret_hax_init is no longer exist... - if ( !ret_hax_init ) { - if ( -ENOSPC == ret_hax_init ) { - error = 1; - } - } - hax_err_len += sprintf( hax_error + hax_err_len, "%s#", error ? "true" : "false" ); - total_len += (hax_err_len + 1); -#endif - - /* collect log path information */ -#define LOGPATH_TEXT "log_path=" - char* log_path = g_path_get_dirname(get_log_redirect_file()); - int log_path_len = strlen(LOGPATH_TEXT) + strlen(log_path) + delimiter_len; - total_len += (log_path_len + 1); - - /* memory allocation */ - char* info_data = g_malloc0( total_len + 1 ); - if ( !info_data ) { - g_free( detail_info ); - ERR( "Fail to malloc for info data.\n" ); - return NULL; - } - - - /* write informations */ - int len = 0; - total_len = 0; //recycle - - for ( i = 0; i < qemu_argc; i++ ) { - len = strlen( qemu_argv[i] ); - sprintf( info_data + total_len, "%s%s", qemu_argv[i], DATA_DELIMITER ); - total_len += len + delimiter_len; - } - -#ifdef CONFIG_WIN32 - snprintf( info_data + total_len, hax_err_len + 1, "%s#", hax_error ); - total_len += hax_err_len; -#endif - - snprintf( info_data + total_len, log_path_len + 1, "%s%s#", LOGPATH_TEXT, log_path ); - total_len += log_path_len; - - INFO( "################## detail info data ####################\n" ); - INFO( "%s\n", info_data ); - - detail_info->data = info_data; - detail_info->data_length = total_len; - - g_free(log_path); - - return detail_info; -} - -void free_detail_info(DetailInfo* detail_info) -{ - if (detail_info) { - if (detail_info->data) { - g_free(detail_info->data); - } - - g_free(detail_info); - } -} - -void do_open_shell(void) -{ - INFO("open shell\n"); - - /* do nothing */ -} - -void do_interpolation_enable(bool on) -{ - INFO("interpolation enable : %d\n", on); - - maru_display_set_interpolation(on); -} - -void do_ram_dump(void) -{ - // RAM dump feature is disabled now. - // TODO: Physical ram dump will be supported by QMP logic soon. - INFO("dump ram is disabled\n"); -} - - -void do_guestmemory_dump(void) -{ - INFO("dump guest memory!\n"); - - /* TODO: */ -} - -void request_close(void) -{ - INFO("request_close\n"); - - // TODO: convert to device emulation - do_hw_key_event(KEY_PRESSED, HARD_KEY_POWER); - -#ifdef CONFIG_WIN32 - Sleep(CLOSE_POWER_KEY_INTERVAL); -#else - usleep(CLOSE_POWER_KEY_INTERVAL * 1000); -#endif - - do_hw_key_event(KEY_RELEASED, HARD_KEY_POWER); - - maru_display_update(); -} - -void do_host_kbd_enable(bool on) -{ - LOG_INFO("host kbd enable : %d\n", on); - - if (on) { - do_hotplug(ATTACH_HOST_KEYBOARD, NULL, 0); - } else { - do_hotplug(DETACH_HOST_KEYBOARD, NULL, 0); - } -} diff --git a/tizen/src/skin/maruskin_operation.h b/tizen/src/skin/maruskin_operation.h deleted file mode 100644 index 2126e8370e..0000000000 --- a/tizen/src/skin/maruskin_operation.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * operation for emulator skin - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * Hyunjun Son - * - * 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 MARUSKIN_OPERATION_H_ -#define MARUSKIN_OPERATION_H_ - -#include "stdint.h" - -// HACK: for common operations -#include "util/ui_operations.h" - -extern int ret_hax_init; - -typedef struct Framebuffer { - unsigned char* data; - unsigned int data_length; -} Framebuffer; - -typedef struct DetailInfo { - char* data; - int data_length; -} DetailInfo; - -typedef struct GuestIp { - char* data; - int data_length; -} GuestIp; - -void start_display(uint64_t handle_id, - unsigned int display_width, unsigned int display_height, - double scale_factor, short rotation_type, bool blank_guide); - -void do_grabbing_enable(bool on); -void do_keyboard_key_event(int event_type, - int keycode, int state_mask, int key_location); -void do_scale_event(double scale_factor); -void do_rotation_event(int rotation_type); - -Framebuffer *request_screenshot(void); -DetailInfo *get_detail_info(int qemu_argc, char **qemu_argv); -GuestIp *get_guest_ip(void); -void free_detail_info(DetailInfo *detail_info); -void free_screenshot(Framebuffer *); - -void do_open_shell(void); -void do_interpolation_enable(bool on); -void do_ram_dump(void); -void do_guestmemory_dump(void); -void do_host_kbd_enable(bool on); - -void request_close(void); -#endif /* MARUSKIN_OPERATION_H_ */ diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c deleted file mode 100644 index f99773cef1..0000000000 --- a/tizen/src/skin/maruskin_server.c +++ /dev/null @@ -1,1489 +0,0 @@ -/* - * socket server for emulator skin - * - * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * HyunJun Son - * - * 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 <pthread.h> -#include "emulator.h" -#include "maruskin_server.h" -#include "maruskin_operation.h" -#include "display/maru_display.h" -#include "ecs/ecs.h" -#include "emul_state.h" -#include "util/exported_strings.h" - -#ifdef CONFIG_WIN32 -#include <windows.h> -#include <winsock2.h> -#include <ws2tcpip.h> - -#define SLEEP(x) Sleep(x) -#define SOCKET_CLOSE(sock) closesocket(sock) -#define SOCKET_ERR() WSAGetLastError() -#else -#include <arpa/inet.h> -#include <netinet/in.h> -#include <sys/socket.h> - -#define SLEEP(x) usleep(x * 1000) -#define SOCKET_CLOSE(sock) close(sock) -#define SOCKET_ERR() errno -#endif - -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(qemu, skinserver); - - -#define MAX_REQ_ID 0x7fffffff -#define RECV_BUF_SIZE 32 -#define RECV_HEADER_SIZE 12 - -#define SEND_HEADER_SIZE 10 -#define SEND_BIG_BUF_SIZE 1024 * 1024 * 2 -#define SEND_BUF_SIZE 512 - -#define HEART_BEAT_INTERVAL 1 -#define HEART_BEAT_FAIL_COUNT 10 -#define HEART_BEAT_EXPIRE_COUNT 10 - -#define PORT_RETRY_COUNT 50 - -#define HB_IGNORE "hb.ignore" -#define TEST_VM_SKINPORT "test.vm.skinport" -#define SKIN_CONFIG_PROP ".skinconfig.properties" - -extern char tizen_target_path[]; - -enum { - /* This values must match the Java definitions - in Skin process */ - - RECV_SKIN_OPENED = 1, - RECV_SKIN_GRABBED = 2, - - RECV_MOUSE_EVENT = 10, - RECV_KEYBOARD_KEY_EVENT = 11, - RECV_HW_KEY_EVENT = 12, - RECV_DISPLAY_STATE = 13, - RECV_OPEN_SHELL = 14, - RECV_HOST_KBD_STATE = 15, - RECV_SCREENSHOT_REQ = 16, - RECV_DETAIL_INFO_REQ = 17, - RECV_RAM_DUMP = 18, - RECV_GUESTMEMORY_DUMP = 19, - RECV_INTERPOLATION_STATE = 21, - RECV_ROTARY_EVENT = 30, - RECV_GUEST_IP_REQ = 40, - - RECV_RESPONSE_HEART_BEAT = 900, - RECV_RESPONSE_DRAW_FRAME = 901, - RECV_CLOSE_REQ = 998, - RECV_RESPONSE_SHUTDOWN = 999, -}; - -enum { - /* This values must match the Java definitions - in Skin process */ - - SEND_HEART_BEAT = 1, - SEND_SCREENSHOT_DATA = 2, - SEND_DETAIL_INFO_DATA = 3, - SEND_RAMDUMP_COMPLETED = 4, - SEND_BOOTING_PROGRESS = 5, - SEND_DISPLAY_POWER = 6, - SEND_HOST_KBD_STATE = 8, - SEND_MULTI_TOUCH_STATE = 9, - SEND_GUEST_IP = 10, - - SEND_SDBD_STARTED = 801, - SEND_DRAW_FRAME = 900, - SEND_DRAW_BLANK_GUIDE = 901, - SEND_EMUL_RESET = 998, - SEND_EMUL_SHUTDOWN = 999, -}; - -static int seq_req_id = 0; - -static int arg_skin_port = 0; -static uint16_t svr_port = 0; -static int server_sock = 0; -static int client_sock = 0; -static int stop_server = 0; -static int ready_server = 0; -static int ignore_heartbeat = 0; -static int is_force_close_client = 0; - -static int is_started_heartbeat = 0; -static int stop_heartbeat = 0; -static int recv_heartbeat_count = 0; - -int is_sdbd_initialized = 0; - -/* 0: not drawing, 1: drawing */ -int draw_display_state = 0; - -static QemuMutex mutex_send_data; -static QemuMutex mutex_recv_heartbeat_count; -QemuMutex mutex_draw_display; -pthread_mutex_t mutex_screenshot = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t cond_screenshot = PTHREAD_COND_INITIALIZER; - -static int skin_argc = 0; -static char** skin_argv = NULL; -static int qmu_argc = 0; -static char** qmu_argv = NULL; - -static void parse_skin_args(void); -static void parse_skinconfig_prop(void); -static void* run_skin_server(void* args); - -static int recv_n(int client_sock, char* read_buf, int recv_len); -static int send_n(int client_sock, unsigned char* data, int length, int big_data); - -static void make_header(int client_sock, - short send_cmd, int data_length, char* sendbuf, int print_log); -static int send_skin_header_only(int client_sock, - short send_cmd, int print_log); -static int send_skin_data(int client_sock, - short send_cmd, unsigned char* data, int length, int big_data); - - -static void* do_heart_beat(void* args); -static int start_heart_beat(void); -static void stop_heart_beat(void); - -static void shutdown_skin_server(void) -{ - INFO("shutdown_skin_server\n"); - - int close_server_socket = 0; - int success_send = 0; - - if (client_sock) { - INFO("send shutdown to skin.\n"); - if (0 > send_skin_header_only(client_sock, SEND_EMUL_SHUTDOWN, 1)) { - ERR("fail to send SEND_SHUTDOWN to skin.\n"); - close_server_socket = 1; - } else { - success_send = 1; - /* skin sent RECV_RESPONSE_SHUTDOWN */ - } - } - - if (success_send) { - int count = 0; - int max_sleep_count = 10; - - while (1) { - - if (max_sleep_count < count) { - close_server_socket = 1; - break; - } - - if (stop_server) { - INFO("skin client sent normal shutdown response.\n"); - break; - } else { - SLEEP(1); /* 1ms */ - - count++; - } - } - } - - pthread_cond_destroy(&cond_screenshot); - pthread_mutex_destroy(&mutex_screenshot); - - stop_server = 1; - is_force_close_client = 1; - - if (client_sock) { - SOCKET_CLOSE(client_sock); - - client_sock = 0; - } - - if (close_server_socket) { - INFO("skin client did not send normal shutdown response.\n"); - if (server_sock) { - SOCKET_CLOSE(server_sock); - - server_sock = 0; - } - } - - qemu_mutex_destroy(&mutex_send_data); - qemu_mutex_destroy(&mutex_recv_heartbeat_count); - qemu_mutex_destroy(&mutex_draw_display); -} - -static void skin_server_notify_exit(Notifier *notifier, void *data) { - shutdown_skin_server(); -} -static Notifier skin_server_exit = { .notify = skin_server_notify_exit }; - -int start_skin_server(int argc, char** argv, - int qemu_argc, char** qemu_argv) -{ - skin_argc = argc; - skin_argv = argv; - - parse_skinconfig_prop(); - - /* arguments have higher priority than '.skinconfig.properties' */ - parse_skin_args(); - - INFO("ignore_heartbeat : %d\n", ignore_heartbeat); - - qmu_argc = qemu_argc; - qmu_argv = qemu_argv; - - qemu_mutex_init(&mutex_send_data); - qemu_mutex_init(&mutex_recv_heartbeat_count); - qemu_mutex_init(&mutex_draw_display); - - QemuThread qemu_thread; - - qemu_thread_create(&qemu_thread, "skin-server", run_skin_server, - NULL, QEMU_THREAD_DETACHED); - - emulator_add_exit_notifier(&skin_server_exit); - - return 1; -} - -void notify_draw_frame(void) -{ -#if 0 - INFO("notify_draw_frame\n"); -#endif - - if (client_sock) { - if (0 > send_skin_header_only( - client_sock, SEND_DRAW_FRAME, 1)) { - - ERR("fail to send SEND_DRAW_FRAME to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_draw_blank_guide(void) -{ - INFO("notify_draw_blank_guide\n"); - - if (client_sock) { - if (0 > send_skin_header_only( - client_sock, SEND_DRAW_BLANK_GUIDE, 1)) { - - ERR("fail to send SEND_DRAW_BLANK_GUIDE to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_sdb_daemon_start(void) -{ - INFO("notify_sdb_daemon_start\n"); - - is_sdbd_initialized = 1; - if (client_sock) { - if (0 > send_skin_header_only( - client_sock, SEND_SDBD_STARTED, 1)) { - - ERR("fail to send SEND_SDBD_STARTED to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_ramdump_completed(void) -{ - INFO("ramdump completed!\n"); - - if (client_sock) { - if (0 > send_skin_header_only( - client_sock, SEND_RAMDUMP_COMPLETED, 1)) { - - ERR("fail to send SEND_RAMDUMP_COMPLETED to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_booting_progress(unsigned int layer, int progress_value) -{ -#define PROGRESS_DATA_LENGTH 5 - char progress_data[PROGRESS_DATA_LENGTH] = { 0, }; - - TRACE("notify_booting_progress\n"); - - snprintf(progress_data, - PROGRESS_DATA_LENGTH, "%d%03d", layer % 10, progress_value); - TRACE("booting...%s\%\n", progress_data); - - if (client_sock) { - if (0 > send_skin_data(client_sock, - SEND_BOOTING_PROGRESS, - (unsigned char *)progress_data, PROGRESS_DATA_LENGTH, 0)) { - - ERR("fail to send SEND_BOOTING_PROGRESS to skin\n"); - } - - SLEEP(1); /* 1ms */ - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_display_power(bool on) -{ -#define DISPLAY_POWER_DATA_LENGTH 2 - char power_data[DISPLAY_POWER_DATA_LENGTH] = { 0, }; - - if (on == false) { - snprintf(power_data, DISPLAY_POWER_DATA_LENGTH, "0"); - } else { - snprintf(power_data, DISPLAY_POWER_DATA_LENGTH, "1"); - } - - TRACE("notify display power : %s\n", power_data); - - if (client_sock) { - if (0 > send_skin_data(client_sock, - SEND_DISPLAY_POWER, - (unsigned char *)power_data, DISPLAY_POWER_DATA_LENGTH, 0)) { - - ERR("fail to send SEND_DISPLAY_POWER to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_host_kbd_state(bool on) -{ -#define HOSTKBD_DATA_LENGTH 2 - char kbd_state_data[HOSTKBD_DATA_LENGTH] = { 0, }; - - if (on == false) { - snprintf(kbd_state_data, HOSTKBD_DATA_LENGTH, "0"); - } else { - snprintf(kbd_state_data, HOSTKBD_DATA_LENGTH, "1"); - } - - TRACE("notify host kbd state : %s\n", kbd_state_data); - - if (client_sock) { - if (0 > send_skin_data(client_sock, - SEND_HOST_KBD_STATE, - (unsigned char *)kbd_state_data, HOSTKBD_DATA_LENGTH, 0)) { - - ERR("fail to send SEND_HOST_KBD_STATE to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_multi_touch_state(bool on) -{ -#define MULTITOUCH_DATA_LENGTH 2 - char mt_state_data[MULTITOUCH_DATA_LENGTH] = { 0, }; - - if (on == false) { - snprintf(mt_state_data, MULTITOUCH_DATA_LENGTH, "0"); - } else { - snprintf(mt_state_data, MULTITOUCH_DATA_LENGTH, "1"); - } - - TRACE("notify multi touch state : %s\n", mt_state_data); - - if (client_sock) { - if (0 > send_skin_data(client_sock, - SEND_MULTI_TOUCH_STATE, - (unsigned char *)mt_state_data, MULTITOUCH_DATA_LENGTH, 0)) { - - ERR("fail to send SEND_MULTI_TOUCH_STATE to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -void notify_emul_reset(void) -{ - INFO("notify_emul_reset\n"); - - if (client_sock) { - if (0 > send_skin_header_only( - client_sock, SEND_EMUL_RESET, 1)) { - - ERR("fail to send SEND_EMUL_RESET to skin\n"); - } - } else { - INFO("skin client socket is not connected yet\n"); - } -} - -int is_ready_skin_server(void) -{ - return ready_server; -} - -int get_skin_server_port(void) -{ - return svr_port; -} - -static void parse_skinconfig_prop(void) -{ - int target_path_len = strlen(tizen_target_path); - char skin_config_path[target_path_len + 32]; - - memset(skin_config_path, 0, target_path_len + 32); - strcpy(skin_config_path, tizen_target_path); -#ifdef CONFIG_WIN32 - strcat(skin_config_path, "\\"); -#else - strcat(skin_config_path, "/"); -#endif - strcat(skin_config_path, SKIN_CONFIG_PROP); - - FILE* fp = fopen(skin_config_path, "r"); - - if (!fp) { - INFO("There is no %s. skin_config_path:%s\n", - SKIN_CONFIG_PROP, skin_config_path); - return; - } - - fseek(fp, 0L, SEEK_END); - int buf_size = ftell(fp); - rewind(fp); - - if (0 >= buf_size) { - INFO("%s contents is empty.\n", SKIN_CONFIG_PROP); - fclose(fp); - return; - } - - char* buf = g_malloc0(buf_size + 1); - if (!buf) { - ERR("Failed to malloc for %s\n", SKIN_CONFIG_PROP); - fclose(fp); - return; - } - - int read_cnt = fread((void*) buf, 1, buf_size, fp); - if (buf_size > read_cnt) { - WARN("Failed to fread for %s\n", SKIN_CONFIG_PROP); - } - buf[read_cnt] = '\0'; - - fclose(fp); - - INFO("====== %s ======\n%s\n====================================\n", - SKIN_CONFIG_PROP, buf); - - char hb_ignore_prop[32] = { 0, }; - memset(hb_ignore_prop, 0, 32); - strcat(hb_ignore_prop, HB_IGNORE); - strcat(hb_ignore_prop, "=true"); - - char* line_str = strtok(buf, "\n"); - - while (1) { - if (line_str) { - TRACE("prop line_str : %s\n", line_str); - - if (0 == strcmp(line_str, hb_ignore_prop)) { - ignore_heartbeat = 1; - INFO("ignore heartbeat by %s\n", SKIN_CONFIG_PROP); - } - } else { - break; - } - - line_str = strtok(NULL, "\n"); - } - - g_free(buf); -} - -static void parse_skin_args(void) -{ -#define OPT_BOOLEAN_TRUE "true" -#define OPT_BOOLEAN_FALSE "false" - int i = 0; - - for ( ; i < skin_argc; i++) { - char* arg = NULL; - arg = strdup(skin_argv[i]); - - if (arg) { - char* key = strtok(arg, "="); - char* value = strtok(NULL, "="); - - INFO("skin parameter key : %s, value : %s\n", - key, value); - - if (0 == strcmp(HB_IGNORE, key)) { - if (0 == strcmp(OPT_BOOLEAN_TRUE, value)) { - ignore_heartbeat = 1; - } else if (0 == strcmp(OPT_BOOLEAN_FALSE, value)) { - ignore_heartbeat = 0; - } - } else if (0 == strcmp(TEST_VM_SKINPORT, key)) { - arg_skin_port = atoi(value); - if (arg_skin_port > 65535 || arg_skin_port < 0) { - INFO("invalid skin port argument : %d\n", arg_skin_port); - arg_skin_port = 0; - } - } - - free(arg); - } else { - ERR("fail to strdup.\n"); - } - } -} - -static void print_fail_log(void) -{ - ERR("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - ERR("! Fail to initialize for skin server operation. Shutdown QEMU !\n"); - ERR("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); -} - -static void* run_skin_server(void* args) -{ - struct sockaddr server_addr, client_addr; - socklen_t server_len, client_len; - int shutdown_qemu = 0; - - INFO("run skin server\n"); - - if (0 > (server_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))) { - ERR("create listen socket error\n"); - perror("create listen socket error : "); - - print_fail_log(); - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - - return NULL; - } - - memset(&server_addr, '\0', sizeof(server_addr)); - ((struct sockaddr_in *) &server_addr)->sin_family = AF_INET; - - memcpy( &((struct sockaddr_in *) &server_addr)->sin_addr, - "\177\000\000\001", 4 ); /* 127.0.0.1 */ - - ((struct sockaddr_in *) &server_addr)->sin_port = htons(arg_skin_port); - - server_len = sizeof(server_addr); - if (0 != bind(server_sock, &server_addr, server_len)) { - ERR("skin server bind error\n"); - perror("skin server bind error : "); - - if (server_sock) { - SOCKET_CLOSE(server_sock); - - server_sock = 0; - } - - print_fail_log(); - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - - return NULL; - } - - memset(&server_addr, '\0', sizeof(server_addr)); - if (getsockname(server_sock, - (struct sockaddr *) &server_addr, &server_len) != 0) { - ERR("failed to obtain the local name for a socket\n"); - } else { - svr_port = ntohs(((struct sockaddr_in *) &server_addr)->sin_port); - - INFO("success to bind port[%s:%d/tcp] for skin_server in host\n", - inet_ntoa(((struct sockaddr_in *) &server_addr)->sin_addr), - svr_port); - } - - if (0 > listen(server_sock, 4)) { - ERR("skin_server listen error\n"); - perror("skin_server listen error : "); - - if (server_sock) { - SOCKET_CLOSE(server_sock); - - server_sock = 0; - } - - print_fail_log(); - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - - return NULL; - } - - client_len = sizeof(client_addr); - - char recvbuf[RECV_BUF_SIZE]; - - INFO("skin server start...port : %d\n", svr_port); - - while (1) { - if (stop_server) { - INFO("close server socket normally.\n"); - break; - } - - if (client_sock != 0) { - SOCKET_CLOSE(client_sock); - } - - ready_server = 1; - - INFO("start accepting socket...\n"); - - if (!is_started_heartbeat) { - if (!start_heart_beat()) { - ERR("Fail to start heartbeat thread.\n"); - - shutdown_qemu = 1; - break; - } - } - - if (0 > (client_sock = accept( - server_sock, (struct sockaddr *) &client_addr, &client_len))) - { - ERR("skin_server accept error\n"); - perror("skin_server accept error : "); - - continue; - } - - INFO("accept client sock : %d\n", client_sock); - - while (1) { - if (stop_server) { - INFO("stop receiving current client socket.\n"); - break; - } - - stop_heartbeat = 0; - memset(&recvbuf, 0, RECV_BUF_SIZE); - - int read_cnt = recv_n(client_sock, recvbuf, RECV_HEADER_SIZE); - - if (0 > read_cnt) { - if (is_force_close_client) { - INFO("force close client socket.\n"); - is_force_close_client = 0; - } else { - ERR("skin_server read error (%d): %d\n", - SOCKET_ERR(), read_cnt); - perror("skin_server read error : "); - } - - break; - } else { - if (0 == read_cnt) { - ERR("read_cnt is 0.\n"); - break; - } - - int log_cnt; - char log_buf[512]; - memset(log_buf, 0, 512); - - log_cnt = sprintf(log_buf, "== RECV read_cnt:%d ", read_cnt); - - int uid = 0; - int req_id = 0; - short cmd = 0; - short length = 0; - - char* packet = recvbuf; - - memcpy(&uid, packet, sizeof(uid)); - packet += sizeof(uid); - memcpy(&req_id, packet, sizeof(req_id)); - packet += sizeof(req_id); - memcpy(&cmd, packet, sizeof(cmd)); - packet += sizeof(cmd); - memcpy(&length, packet, sizeof(length)); - - uid = ntohl(uid); - req_id = ntohl(req_id); - cmd = ntohs(cmd); - length = ntohs(length); - - log_cnt += sprintf(log_buf + log_cnt, - "uid:%d, req_id:%d, cmd:%d, length:%d ", uid, req_id, cmd, length); - - if (0 < length) { - if (RECV_BUF_SIZE < length) { - ERR("length is bigger than RECV_BUF_SIZE\n"); - continue; - } - - memset(&recvbuf, 0, length); - - int recv_cnt = recv_n(client_sock, recvbuf, length); - - log_cnt += sprintf(log_buf + log_cnt, "data read_cnt:%d ", recv_cnt); - - if (0 > recv_cnt) { - ERR("skin_server read data\n"); - perror("skin_server read data : "); - break; - } else if (0 == recv_cnt) { - ERR("data read_cnt is 0.\n"); - break; - } else if (recv_cnt != length) { - ERR("read_cnt is not equal to length.\n"); - break; - } - } - - switch (cmd) { - case RECV_SKIN_OPENED: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_SKIN_OPENED ==\n"); - INFO(log_buf); - - if (0 >= length) { - ERR("there is no data looking at 0 length."); - continue; - } - - /* keep it consistent with emulator-skin definition */ - uint64 handle_id = 0; - int display_width = 0; - int display_height = 0; - int scale = 0; - double scale_ratio = 0.0; - short rotation = 0; - short blank_guide = 0; - - char* p = recvbuf; - memcpy(&handle_id, p, sizeof(handle_id)); - p += sizeof(handle_id); - memcpy(&display_width, p, sizeof(display_width)); - p += sizeof(display_width); - memcpy(&display_height, p, sizeof(display_height)); - p += sizeof(display_height); - memcpy(&scale, p, sizeof(scale)); - p += sizeof(scale); - memcpy(&rotation, p, sizeof(rotation)); - p += sizeof(rotation); - memcpy(&blank_guide, p, sizeof(blank_guide)); - - int low_id = (int)handle_id; - int high_id = (int)(handle_id >> 32); - low_id = ntohl(high_id); - high_id = ntohl(low_id); - handle_id = high_id; - handle_id = (handle_id << 32) | low_id; - - display_width = ntohl(display_width); - display_height = ntohl(display_height); - scale = ntohl(scale); - scale_ratio = ((double) scale) / 100; - rotation = ntohs(rotation); - blank_guide = ntohs(blank_guide); - - set_emul_win_scale(scale_ratio); - - start_display(handle_id, - display_width, display_height, scale_ratio, rotation, - (blank_guide == 1) ? true : false); - - break; - } - case RECV_SKIN_GRABBED: { - char on = 0; - - log_cnt += sprintf(log_buf + log_cnt, "RECV_SKIN_GRABBED ==\n"); - TRACE(log_buf); - - if (length <= 0) { - INFO("there is no data looking at 0 length.\n"); - continue; - } - - memcpy(&on, recvbuf, sizeof(on)); - - if (on == 0) { - do_grabbing_enable(false); - } else { - do_grabbing_enable(true); - } - - break; - } - case RECV_MOUSE_EVENT: { - log_cnt += sprintf( log_buf + log_cnt, "RECV_MOUSE_EVENT ==\n" ); - TRACE( log_buf ); - - if ( 0 >= length ) { - ERR( "there is no data looking at 0 length." ); - continue; - } - - /* keep it consistent with emulator-skin definition */ - int button_type = 0; - int event_type = 0; - int host_x = 0; - int host_y = 0; - int guest_x = 0; - int guest_y = 0; - int z = 0; - - char* p = recvbuf; - memcpy( &button_type, p, sizeof( button_type ) ); - p += sizeof( button_type ); - memcpy( &event_type, p, sizeof( event_type ) ); - p += sizeof( event_type ); - memcpy( &host_x, p, sizeof( host_x ) ); - p += sizeof( host_x ); - memcpy( &host_y, p, sizeof( host_y ) ); - p += sizeof( host_y ); - memcpy( &guest_x, p, sizeof( guest_x ) ); - p += sizeof( guest_x ); - memcpy( &guest_y, p, sizeof( guest_y ) ); - p += sizeof( guest_y ); - memcpy( &z, p, sizeof( z ) ); - - button_type = ntohl( button_type ); - event_type = ntohl( event_type ); - host_x = ntohl( host_x ); - host_y = ntohl( host_y ); - guest_x = ntohl( guest_x ); - guest_y = ntohl( guest_y ); - z = ntohl( z ); - - do_mouse_event(button_type, event_type, - host_x, host_y, guest_x, guest_y, z); - break; - } - case RECV_KEYBOARD_KEY_EVENT: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_KEYBOARD_KEY_EVENT ==\n"); - TRACE(log_buf); - - if (0 >= length) { - ERR("there is no data looking at 0 length."); - continue; - } - - /* keep it consistent with emulator-skin definition */ - int event_type = 0; - int keycode = 0; - int state_mask = 0; - int key_location = 0; - - char* p = recvbuf; - memcpy(&event_type, p, sizeof(event_type)); - p += sizeof(event_type); - memcpy(&keycode, p, sizeof(keycode)); - p += sizeof(keycode); - memcpy(&state_mask, p, sizeof(state_mask)); - p += sizeof(state_mask); - memcpy(&key_location, p, sizeof(key_location)); - - event_type = ntohl(event_type); - keycode = ntohl(keycode); - state_mask = ntohl(state_mask); - key_location = ntohl(key_location); - - do_keyboard_key_event(event_type, keycode, state_mask, key_location); - break; - } - case RECV_HW_KEY_EVENT: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_HW_KEY_EVENT ==\n"); - TRACE(log_buf); - - if (0 >= length) { - ERR("there is no data looking at 0 length."); - continue; - } - - /* keep it consistent with emulator-skin definition */ - int event_type = 0; - int keycode = 0; - - char* p = recvbuf; - memcpy(&event_type, p, sizeof(event_type)); - p += sizeof(event_type); - memcpy(&keycode, p, sizeof(keycode)); - - event_type = ntohl(event_type); - keycode = ntohl(keycode); - - do_hw_key_event(event_type, keycode); - break; - } - case RECV_DISPLAY_STATE: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_DISPLAY_STATE ==\n"); - TRACE(log_buf); - - if (0 >= length) { - ERR("there is no data looking at 0 length."); - continue; - } - - /* keep it consistent with emulator-skin definition */ - int scale = 0; - double scale_ratio = 0.0; - short rotation_type = 0; - - char* p = recvbuf; - memcpy(&scale, p, sizeof(scale)); - p += sizeof(scale); - memcpy(&rotation_type, p, sizeof(rotation_type)); - - scale = ntohl(scale); - scale_ratio = ((double) scale) / 100; - rotation_type = ntohs(rotation_type); - - /* scaling */ - if (get_emul_win_scale() != scale_ratio) { - do_scale_event(scale_ratio); - } - - /* rotation */ - bool is_rotate = false; - if (get_emul_rotation() != rotation_type) { - set_emul_rotation(rotation_type); - is_rotate = true; - } - - maru_display_resize(); - - /* after display resizing */ - if (is_rotate == true) { - do_rotation_event(rotation_type); - } - - break; - } - case RECV_SCREENSHOT_REQ: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_SCREENSHOT_REQ ==\n"); - TRACE(log_buf); - - Framebuffer* framebuffer = request_screenshot(); - - if (framebuffer != NULL) { - send_skin_data(client_sock, SEND_SCREENSHOT_DATA, - framebuffer->data, framebuffer->data_length, 1); - - g_free(framebuffer->data); - g_free(framebuffer); - } else { - ERR("Fail to get screen shot data\n"); - } - - break; - } - case RECV_DETAIL_INFO_REQ: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_DETAIL_INFO_REQ ==\n"); - TRACE(log_buf); - - DetailInfo* detail_info = get_detail_info(qmu_argc, qmu_argv); - - if (detail_info) { - send_skin_data(client_sock, SEND_DETAIL_INFO_DATA, - (unsigned char*) detail_info->data, detail_info->data_length, 0); - free_detail_info(detail_info); - } else { - ERR("Fail to get detail info\n"); - } - - break; - } - case RECV_GUEST_IP_REQ: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_GUEST_IP_REQ ==\n"); - TRACE(log_buf); - - GuestIp* ip = get_guest_ip(); - INFO("ip: %s\n", (unsigned char*) ip->data); - if (ip) { - send_skin_data(client_sock, SEND_GUEST_IP, - (unsigned char*) ip->data, ip->data_length, 0); - } else { - ERR("Fail to get guest ip\n"); - } - - break; - } - case RECV_RAM_DUMP: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_RAM_DUMP ==\n"); - TRACE(log_buf); - - do_ram_dump(); - break; - } - case RECV_GUESTMEMORY_DUMP: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_GUESTMEMORY_DUMP ==\n"); - TRACE(log_buf); - - do_guestmemory_dump(); - break; - } - case RECV_RESPONSE_HEART_BEAT: { - qemu_mutex_lock(&mutex_recv_heartbeat_count); - recv_heartbeat_count = 0; - qemu_mutex_unlock(&mutex_recv_heartbeat_count); - - log_cnt += sprintf(log_buf + log_cnt, "RECV_RESPONSE_HEART_BEAT ==\n"); -#if 0 - TRACE(log_buf); -#endif - TRACE("recv HB req_id:%d\n", req_id); - - break; - } - case RECV_OPEN_SHELL: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_OPEN_SHELL ==\n"); - TRACE(log_buf); - - do_open_shell(); - break; - } - case RECV_HOST_KBD_STATE: { - char on = 0; - - log_cnt += sprintf(log_buf + log_cnt, "RECV_HOST_KBD_STATE ==\n"); - TRACE(log_buf); - - if (length <= 0) { - INFO("there is no data looking at 0 length.\n"); - continue; - } - - memcpy(&on, recvbuf, sizeof(on)); - - if (on == 0) { - do_host_kbd_enable(false); - } else { - do_host_kbd_enable(true); - } - - //send_host_keyboard_ntf((on == 0) ? 0 : 1); - break; - } - case RECV_INTERPOLATION_STATE: { - char on = 0; - - log_cnt += sprintf(log_buf + log_cnt, "RECV_INTERPOLATION_STATE ==\n"); - TRACE(log_buf); - - if (length <= 0) { - INFO("there is no data looking at 0 length.\n"); - continue; - } - - memcpy(&on, recvbuf, sizeof(on)); - - if (on == 0) { - do_interpolation_enable(false); - } else { - do_interpolation_enable(true); - } - - break; - } - case RECV_ROTARY_EVENT: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_ROTARY_EVENT ==\n"); - TRACE(log_buf); - - if (0 >= length) { - ERR("there is no data looking at 0 length."); - continue; - } - - /* keep it consistent with emulator-skin definition */ - int event_type = 0; - int delta = 0; - - char* p = recvbuf; - memcpy(&event_type, p, sizeof(event_type)); - p += sizeof(event_type); - memcpy(&delta, p, sizeof(delta)); - - event_type = ntohl(event_type); - delta = ntohl(delta); - - TRACE("rotary event: delta(%d), event_type(%d)\n", - delta, event_type); - do_rotary_event(delta, event_type); - - break; - } - case RECV_RESPONSE_DRAW_FRAME: { - qemu_mutex_lock(&mutex_draw_display); - draw_display_state = 0; /* framebuffer has been drawn */ - qemu_mutex_unlock(&mutex_draw_display); - - log_cnt += sprintf(log_buf + log_cnt, "RECV_RESPONSE_DRAW_FRAME ==\n"); -#if 0 - TRACE(log_buf); -#endif - break; - } - case RECV_CLOSE_REQ: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_CLOSE ==\n"); - TRACE(log_buf); - - request_close(); - break; - } - case RECV_RESPONSE_SHUTDOWN: { - log_cnt += sprintf(log_buf + log_cnt, "RECV_RESPONSE_SHUTDOWN ==\n"); - INFO(log_buf); - - stop_server = 1; - break; - } - default: { - log_cnt += sprintf(log_buf + log_cnt, "!!! unknown command : %d\n", cmd); - TRACE(log_buf); - - ERR("!!! unknown command : %d\n", cmd); - break; - } - } - } - - } /* end of while */ - } /* end of while */ - - stop_heart_beat(); - - /* clean up */ - if (server_sock) { - SOCKET_CLOSE(server_sock); - - server_sock = 0; - } - - if (shutdown_qemu) { - print_fail_log(); - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - } - - return NULL; -} - -static int recv_n(int sockfd, char* read_buf, int recv_len) -{ - int total_cnt = 0; - int recv_cnt = 0; - - while (1) { - recv_cnt = recv(sockfd, - (void*)(read_buf + recv_cnt), (recv_len - recv_cnt), 0); - - if (0 > recv_cnt) { - return recv_cnt; - } else if (0 == recv_cnt) { - if (total_cnt == recv_len) { - return total_cnt; - } else { - continue; - } - } else { - total_cnt += recv_cnt; - - if (total_cnt == recv_len) { - return total_cnt; - } else { - continue; - } - } - } - - return 0; -} - -static void make_header(int sockfd, - short send_cmd, int data_length, char* sendbuf, int print_log) -{ - memset(sendbuf, 0, SEND_HEADER_SIZE); - - int request_id = (MAX_REQ_ID == seq_req_id) ? 0 : ++seq_req_id; - if (print_log) { - TRACE("== SEND skin request_id:%d, send_cmd:%d ==\n", request_id, send_cmd); - } - request_id = htonl(request_id); - - short cmd = send_cmd; - cmd = htons(cmd); - - int length = data_length; - length = htonl(length); - - char* p = sendbuf; - memcpy(p, &request_id, sizeof(request_id)); - p += sizeof(request_id); - memcpy(p, &cmd, sizeof(cmd)); - p += sizeof(cmd); - memcpy(p, &length, sizeof(length)); -} - -static int send_n(int sockfd, - unsigned char* data, int length, int big_data) -{ - int send_cnt = 0; - int total_cnt = 0; - - int buf_size = (big_data != 0) ? - SEND_BIG_BUF_SIZE : SEND_BUF_SIZE; - - /* use malloc instead of general array definition - to avoid seg fault in 'alloca' in MinGW env, only using big buf size */ - char* databuf = (char*)g_malloc0(buf_size); - - if (big_data != 0) { - TRACE("big_data send_n start. length:%d\n", length); - } else { - TRACE("send_n start. length:%d\n", length); - } - - while (1) { - if (total_cnt == length) { - break; - } - - if (buf_size < (length - total_cnt)) { - send_cnt = buf_size; - } else { - send_cnt = (length - total_cnt); - } - - memset(databuf, 0, send_cnt); - memcpy(databuf, (char*) (data + total_cnt), send_cnt); - - send_cnt = send(sockfd, databuf, send_cnt, 0); - - if (0 > send_cnt) { - ERR("send_n error. error code:%d\n", send_cnt); - return send_cnt; - } else { - total_cnt += send_cnt; - } - } - - g_free(databuf); - - TRACE("send_n finished.\n"); - - return total_cnt; -} - -// TODO: call send_skin_data -char header1[SEND_HEADER_SIZE] = { 0, }; -static int send_skin_header_only(int sockfd, short send_cmd, int print_log) -{ - /* send */ - qemu_mutex_lock(&mutex_send_data); - - make_header(sockfd, send_cmd, 0, header1, print_log); - - int header_cnt = send(sockfd, header1, SEND_HEADER_SIZE, 0); - if (0 > header_cnt) { - ERR("failed to send header1\n"); - qemu_mutex_unlock(&mutex_send_data); - - return header_cnt; - } - - qemu_mutex_unlock(&mutex_send_data); - - TRACE("send header result : %d\n", header_cnt); - - return header_cnt; -} - -char header2[SEND_HEADER_SIZE] = { 0, }; -static int send_skin_data(int sockfd, - short send_cmd, unsigned char* data, int length, int big_data) -{ - if (data == NULL) { - ERR("send data is NULL.\n"); - return -1; - } - - /* send */ - qemu_mutex_lock(&mutex_send_data); - - make_header(sockfd, send_cmd, length, header2, 1); - - int header_cnt = send(sockfd, header2, SEND_HEADER_SIZE, 0); - if (0 > header_cnt) { - ERR("failed to send header2\n"); - qemu_mutex_unlock(&mutex_send_data); - - return header_cnt; - } - - int data_cnt = send_n(sockfd, data, length, big_data); - - qemu_mutex_unlock(&mutex_send_data); - - TRACE("send data result : %d\n", data_cnt); - - return data_cnt; -} - -static void* do_heart_beat(void* args) -{ - is_started_heartbeat = 1; - - int send_fail_count = 0; - int shutdown = 0; - - unsigned int booting_handicap_cnt = 0; - const unsigned int hb_interval = HEART_BEAT_INTERVAL * 1000; - - while (1) { - if (booting_handicap_cnt < 5) { - booting_handicap_cnt++; - - SLEEP(hb_interval * 10); /* 10sec */ - } else { - SLEEP(hb_interval); /* 1sec */ - } - - if (stop_heartbeat) { - INFO("[HB] stop heart beat.\n"); - break; - } - - if (client_sock) { - TRACE("send HB\n"); - - if (0 > send_skin_header_only(client_sock, SEND_HEART_BEAT, 0)) { - send_fail_count++; - } else { - send_fail_count = 0; - } - } else { - /* fail to get socket in accepting or client is not yet accepted */ - send_fail_count++; - INFO("[HB] client socket is not ready yet.\n"); - - SLEEP(hb_interval); /* 1sec */ - } - - if ((HEART_BEAT_FAIL_COUNT + 1) < send_fail_count) { - ERR("[HB] fail to send heart beat to skin. fail count : %d\n", - HEART_BEAT_FAIL_COUNT); - - shutdown = 1; - break; - } - - qemu_mutex_lock(&mutex_recv_heartbeat_count); - - recv_heartbeat_count++; - if (1 < recv_heartbeat_count) { - INFO("[HB] recv_heartbeat_count : %d\n", recv_heartbeat_count); - } - - qemu_mutex_unlock(&mutex_recv_heartbeat_count); - - if (HEART_BEAT_EXPIRE_COUNT < recv_heartbeat_count) { - ERR("received heart beat count is expired\n"); - - shutdown = 1; - break; - } - } - - if (shutdown != 0) { - INFO("[HB] shutdown skin_server by heart beat thread\n"); - - is_force_close_client = 1; - - if (client_sock) { - SOCKET_CLOSE(client_sock); - - client_sock = 0; - } - - stop_server = 1; - - if (server_sock) { - SOCKET_CLOSE(server_sock); - - server_sock = 0; - } - - ERR("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - ERR("!!! Fail to operate with heartbeat from skin client. Shutdown QEMU !!!\n"); - ERR("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - - error_report(EMULATOR_HAS_STOPPED "\n"); - qemu_system_graceful_shutdown_request(TIMEOUT_FOR_SHUTDOWN); - } - - return NULL; -} - -static int start_heart_beat(void) -{ - if (is_started_heartbeat) { - return 1; - } - - if (ignore_heartbeat) { - return 1; - } else { - QemuThread thread_id_heartbeat; - qemu_thread_create(&thread_id_heartbeat, "skin-hb", do_heart_beat, - NULL, QEMU_THREAD_DETACHED); - - return 1; - } -} - -static void stop_heart_beat(void) -{ - INFO("stop the heart beat signal\n"); - - stop_heartbeat = 1; -} diff --git a/tizen/src/skin/maruskin_server.h b/tizen/src/skin/maruskin_server.h deleted file mode 100644 index 5d0a4c1bf1..0000000000 --- a/tizen/src/skin/maruskin_server.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * socket server for emulator skin - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim <giwoong.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * Hyunjun Son - * - * 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 MARUSKIN_SERVER_H_ -#define MARUSKIN_SERVER_H_ - -extern int is_sdbd_initialized; - -int start_skin_server(int argc, char** argv, int qemu_argc, char** qemu_argv); - -void notify_draw_frame(void); -void notify_draw_blank_guide(void); -void notify_sdb_daemon_start(void); -void notify_ramdump_completed(void); -void notify_booting_progress(unsigned int layer, int progress_value); -void notify_display_power(bool on); -void notify_host_kbd_state(bool on); -void notify_multi_touch_state(bool on); -void notify_emul_reset(void); - -int is_ready_skin_server(void); -int get_skin_server_port(void); - -#endif /* MARUSKIN_SERVER_H_ */ diff --git a/tizen/src/util/error_handler.c b/tizen/src/util/error_handler.c index e749c6b9bf..1d9eddad1c 100644 --- a/tizen/src/util/error_handler.c +++ b/tizen/src/util/error_handler.c @@ -45,16 +45,11 @@ #include "error_handler.h" #include "emulator_common.h" #include "emulator.h" -#include "skin/maruskin_client.h" #include "debug_ch.h" MULTI_DEBUG_CHANNEL(qemu, backtrace); -#ifdef CONFIG_JAVA_UI -#include "skin/maruskin_client.h" -#endif - #ifdef CONFIG_QT #include "qt5_error_report.h" #endif @@ -304,8 +299,6 @@ static void report(const char *fmt, va_list ap) if (message[message_len - 1] == '\n') { #if defined(CONFIG_QT) start_qt5_msgbox(CRITICAL_ICON, message); -#elif defined(CONFIG_JAVA_UI) - start_simple_client(message); #endif message[0] = '\0'; diff --git a/tizen/src/util/exported_strings.h b/tizen/src/util/exported_strings.h index 2ae889032f..0a1defa419 100644 --- a/tizen/src/util/exported_strings.h +++ b/tizen/src/util/exported_strings.h @@ -38,7 +38,6 @@ #define FAILED_TO_LOAD_BIOS "Failed to load a bios file in bios path that mentioned on document." #define FAILED_TO_LOAD_DISK "Failed to load disk file from the following path." #define CHECK_FILE_VALID " Check if the file is corrupted or missing.\n\n" -#define FAILED_TO_INITIALIZE_SKIN "Skin process cannot be initialized. Skin server is not ready." #define FAILED_TO_INSTALL_EXTRAPACKAGE_1 "Extra package installation is failed.\n" #define FAILED_TO_INSTALL_EXTRAPACKAGE_2 " must be installed MANUALLY!" #define EMULATOR_HAS_STOPPED "Emulator has stopped working.\nA problem caused the program to stop working correctly." diff --git a/tizen/src/util/net_helper.c b/tizen/src/util/net_helper.c index 4a0454b111..1f65afc833 100644 --- a/tizen/src/util/net_helper.c +++ b/tizen/src/util/net_helper.c @@ -46,10 +46,6 @@ DECLARE_DEBUG_CHANNEL(sdb); -#ifdef CONFIG_JAVA_UI -#include "skin/maruskin_server.h" -#endif - #define BUF_SIZE 64 int emul_vm_base_socket; @@ -449,9 +445,6 @@ static void command_handler(char* readbuf, struct sockaddr_in* client_addr) LOG_TRACE("----------------------------------------\n"); LOG_TRACE("command:%s\n", command); if (strcmp(command, "2\n" ) == 0) { -#ifdef CONFIG_JAVA_UI - notify_sdb_daemon_start(); -#endif sdb_daemon_is_initialized = true; } else if (strcmp(command, "5\n") == 0) { register_sdb_server(readbuf, client_addr); diff --git a/tizen/src/util/ui_operations.c b/tizen/src/util/ui_operations.c index 8964d6482a..2973ac78ad 100644 --- a/tizen/src/util/ui_operations.c +++ b/tizen/src/util/ui_operations.c @@ -42,11 +42,6 @@ #include "hw/pci/maru_brightness.h" #include "util/device_hotplug.h" -#if defined(CONFIG_JAVA_UI) && !defined(CONFIG_USE_SHM) -#include "display/maru_finger.h" -#include "display/maru_display.h" -#endif - DECLARE_DEBUG_CHANNEL(op_stub); #define RESUME_KEY_SEND_INTERVAL 500 /* milli-seconds */ @@ -101,19 +96,6 @@ 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_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) { - update_finger_point(z, origin_x, origin_y, x, y); - } else if (event_type == MOUSE_UP) { - remove_finger_point(z); - } - - maru_display_update(); - } -#endif - /* single touch */ switch(event_type) { case MOUSE_DOWN: |