[Title] added new qemu arg (-max-touch-point [int])
authorgiwoong.kim <giwoong.kim@samsung.com>
Tue, 3 Apr 2012 02:15:32 +0000 (11:15 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Tue, 3 Apr 2012 03:10:08 +0000 (12:10 +0900)
[Type]
[Module] Emulator
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

qemu-options.hx
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/maru_finger.c
tizen/src/skin/maruskin_operation.c
vl.c

index 2ec5722..94eba0a 100644 (file)
@@ -2630,3 +2630,12 @@ HXCOMM This is the last statement. Insert new options before this line!
 STEXI
 @end table
 ETEXI
+
+DEF("max-touch-point", HAS_ARG, QEMU_OPTION_max_touch_point, \
+    "-max-touch-point [count]\n"
+    "                define maximum number of touch point\n",
+    QEMU_ARCH_ALL)
+STEXI
+@item -max-touch-point @var{max_count}
+Use @var{max_count} as Integer
+ETEXI
index f05846b..285c39a 100644 (file)
@@ -91,6 +91,23 @@ int get_emul_sdl_bpp(void)
     return _emul_info.sdl_bpp;
 }
 
+/* maximum number of touch point */
+void set_emul_max_touch_point(int cnt)
+{
+    if (cnt <= 0) {
+        cnt = 1;
+    }
+    _emul_info.max_touch_point = cnt;
+}
+
+int get_emul_max_touch_point(void)
+{
+    if (_emul_info.max_touch_point <= 0) {
+        set_emul_max_touch_point(1);
+    }
+    return _emul_info.max_touch_point;
+}
+
 /* emulator window scale */
 void set_emul_win_scale(double scale_factor)
 {
index 405a151..8cc561a 100644 (file)
@@ -75,6 +75,7 @@ typedef  struct EmulatorConfigInfo {
     int lcd_size_h;
     int guest_dpi; //not used yet
     int sdl_bpp;
+    int max_touch_point;
     //TODO:
 } EmulatorConfigInfo;
 
@@ -93,6 +94,7 @@ typedef struct EmulatorConfigState {
 void set_emul_lcd_size(int width, int height);
 void set_emul_win_scale(double scale);
 void set_emul_sdl_bpp(int bpp);
+void set_emul_max_touch_point(int cnt);
 void set_emulator_condition(int state);
 void set_emul_rotation(short rotation_type);
 void set_emul_caps_lock_state(int state);
@@ -103,6 +105,7 @@ int get_emul_lcd_width(void);
 int get_emul_lcd_height(void);
 double get_emul_win_scale(void);
 int get_emul_sdl_bpp(void);
+int get_emul_max_touch_point(void);
 int get_emulator_condition(void);
 short get_emul_rotation(void);
 MultiTouchState *get_emul_multi_touch_state(void);
index 282f74d..fabb8d4 100644 (file)
@@ -159,7 +159,14 @@ void init_multi_touch_state(void)
     INFO("multi-touch state initialization\n");
 
     mts->multitouch_enable = 0;
-    mts->finger_cnt_max = MAX_FINGER_CNT; //temp
+
+    mts->finger_cnt_max = get_emul_max_touch_point();
+    if (mts->finger_cnt_max > MAX_FINGER_CNT) {
+        mts->finger_cnt_max = MAX_FINGER_CNT; //TODO:
+        set_emul_max_touch_point(mts->finger_cnt_max);
+    }
+    INFO("maxTouchPoint=%d\n", get_emul_max_touch_point());
+
     mts->finger_cnt = 0;
 
     if (mts->finger_slot != NULL) {
index 11f97ce..0c70b64 100644 (file)
@@ -87,7 +87,7 @@ void do_key_event( int event_type, int keycode )
     TRACE( "key_event event_type:%d, keycode:%d\n", event_type, keycode );
 
     //is multi-touch mode ?
-    if (keycode == JAVA_KEYCODE_BIT_CTRL) {
+    if (keycode == JAVA_KEYCODE_BIT_CTRL && get_emul_max_touch_point() > 1) {
         if (KEY_PRESSED == event_type) {
             get_emul_multi_touch_state()->multitouch_enable = 1;
             INFO("multi-touch enabled\n");
diff --git a/vl.c b/vl.c
index 6310667..c91ab59 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -181,6 +181,7 @@ int qemu_main(int argc, char **argv, char **envp);
 #ifdef CONFIG_MARU
 #include "tizen/src/maru_sdl.h"
 #include "tizen/src/option.h"
+#include "tizen/src/emul_state.h"
 #endif
 
 //#define DEBUG_NET
@@ -3164,6 +3165,15 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_disable_hax:
                 hax_disabled = 1;
                 break;
+#ifdef CONFIG_MARU
+            case QEMU_OPTION_max_touch_point:
+                {
+                    int cnt = atoi(optarg);
+                    fprintf(stderr, "maxTouchPoint:%d\n", cnt);
+                    set_emul_max_touch_point(cnt);
+                }
+                break;
+#endif
             default:
                 os_parse_cmd_args(popt->index, optarg);
             }