changeset 5209:af515f1eeb5d

Android: Use lens multitouch and gestures support.
author tb115823 <Tomas.Brandalik@oracle.com>
date Mon, 30 Sep 2013 15:55:52 +0200
parents 0148423079ac
children a984a34eca51
files modules/graphics/src/android/java/com/oracle/dalvik/FXActivity.java modules/graphics/src/main/native-glass/lens/android/android.c modules/graphics/src/main/native-glass/lens/android/android.h modules/graphics/src/main/native-glass/lens/android/com_oracle_dalvik_FXActivity.h modules/graphics/src/main/native-glass/lens/android/com_oracle_dalvik_FXActivity_InternalSurfaceView.h modules/graphics/src/main/native-glass/lens/input/android/androidLens.c modules/graphics/src/main/native-glass/lens/input/android/androidLens.h
diffstat 7 files changed, 290 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/android/java/com/oracle/dalvik/FXActivity.java	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/FXActivity.java	Mon Sep 30 15:55:52 2013 +0200
@@ -181,11 +181,48 @@
         public InternalSurfaceView(Context context) {
             super(context);
             setFocusableInTouchMode(true);
-        }
+        }        
 
+        private static final int ACTION_POINTER_STILL = -1;
+        
         @Override
-        public boolean dispatchTouchEvent(MotionEvent event) {
-            onTouchEventNative(event.getAction(), (int) event.getX(), (int) event.getY());
+        public boolean dispatchTouchEvent(MotionEvent event) {      
+            int action = event.getAction();
+            int actionCode = action & MotionEvent.ACTION_MASK;
+            int pcount = event.getPointerCount();
+            int[] actions = new int[pcount];
+            int[] ids = new int[pcount];
+            int[] touchXs = new int[pcount];
+            int[] touchYs = new int[pcount];
+
+            if (pcount > 1) {                      
+                //multitouch
+                if (actionCode == MotionEvent.ACTION_POINTER_DOWN ||
+                    actionCode == MotionEvent.ACTION_POINTER_UP) {
+
+                    int pointerIndex = event.getActionIndex();
+                    for (int i = 0;i <pcount; i++) {
+                        actions[i] = pointerIndex == i ? actionCode : ACTION_POINTER_STILL;
+                        ids[i] = event.getPointerId(i);
+                        touchXs[i] = (int)event.getX(i);
+                        touchYs[i] = (int)event.getY(i);                        
+                    }                    
+                } else if (actionCode == MotionEvent.ACTION_MOVE) {
+                    for (int i = 0;i <pcount; i++) {
+                        touchXs[i] = (int)event.getX(i);
+                        touchYs[i] = (int)event.getY(i);                    
+                        actions[i] = MotionEvent.ACTION_MOVE;
+                        ids[i] = event.getPointerId(i);                        
+                    }                    
+                }                 
+            } else {
+                //single touch
+                actions[0] = actionCode;
+                ids[0] = event.getPointerId(0);
+                touchXs[0] = (int)event.getX();
+                touchYs[0] = (int)event.getY();                
+            }                 
+            onMultiTouchEventNative(pcount, actions, ids, touchXs, touchYs);
             return true;
         }
 
@@ -194,8 +231,10 @@
             onKeyEventNative(event.getAction(), event.getKeyCode(), event.getCharacters());
             return true;
         }
-
-        private native void onTouchEventNative(int action, int absx, int absy);
+        
+        private native void onMultiTouchEventNative(int count, int[] actions, 
+                int[] ids, int[] touchXs, int[] touchYs);
+        
 
         private native void onKeyEventNative(int action, int keycode, String characters);
 
--- a/modules/graphics/src/main/native-glass/lens/android/android.c	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/main/native-glass/lens/android/android.c	Mon Sep 30 15:55:52 2013 +0200
@@ -41,6 +41,7 @@
 #define RGB_888   3
 #define RGB_565   4
 
+#define TOUCH_ACTION_STILL         -1
 #define TOUCH_ACTION_DOWN           0
 #define TOUCH_ACTION_UP             1
 #define TOUCH_ACTION_MOVE           2
@@ -80,6 +81,13 @@
         int isTouch,
         int touchId);
 
+static void (*_notifyMultiTouchEvent) (
+        int count,
+        int *states,
+        int *ids,
+        int *xs,
+        int *ys);
+
 static void (*_notifyButtonEvent)(
         int pressed,
         int button,
@@ -164,6 +172,7 @@
     }
     _notifyWindowEvent_resize = GET_SYMBOL(env, libglass, "notifyWindowEvent_resize");
     _notifyTouchEvent = GET_SYMBOL(env, libglass, "notifyTouchEvent");
+    _notifyMultiTouchEvent = GET_SYMBOL(env, libglass, "notifyMultiTouchEvent");
     _notifyMotionEvent = GET_SYMBOL(env, libglass, "notifyMotionEvent");
     _notifyButtonEvent = GET_SYMBOL(env, libglass, "notifyButtonEvent");
     _notifyKeyEvent = GET_SYMBOL(env, libglass, "notifyKeyEvent");
@@ -213,32 +222,11 @@
 
 /*
  * Class:     com_oracle_dalvik_FXActivity_InternalSurfaceView
- * Method:    onTouchEventNative
- * Signature: (III)V
- */
-JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_00024InternalSurfaceView_onTouchEventNative
-(JNIEnv *ignore, jobject view, jint action, jint absx, jint absy) {
-    LOGV(TAG, "Touch event: [%s, x: %i, y: %i]\n", describe_touch_action(action), absx, absy);
-
-    int fxstate = to_jfx_touch_action(action);
-    if (!fxstate) {
-        LOGE(TAG, "Can't handle this state yet. Ignoring. (Probably multitouch)");
-        return;
-    }
-    if (fxstate == com_sun_glass_events_TouchEvent_TOUCH_MOVED) {
-        (*_notifyMotionEvent)(absx, absy, 1, 1);
-    } else {
-        (*_notifyTouchEvent)(fxstate, 1, 1, absx, absy);
-    }
-}
-
-/*
- * Class:     com_oracle_dalvik_FXActivity_InternalSurfaceView
  * Method:    onKeyEventNative
  * Signature: (II)V
  */
 JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_00024InternalSurfaceView_onKeyEventNative
-(JNIEnv *ignore, jobject view, jint action, jint keyCode) {
+(JNIEnv *ignore, jobject view, jint action, jint keyCode, jstring characters) {
     
     LOGV(TAG, "Key event: [action: %s, keyCode: %i]\n", describe_key_action(action), keyCode);
     int event_type = to_jfx_key_action(action);
@@ -249,6 +237,34 @@
     }
 }
 
+JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_00024InternalSurfaceView_onMultiTouchEventNative
+  (JNIEnv *env, jobject jview, jint jpcount, jintArray jactions, jintArray jids,
+        jintArray jtouchXs, jintArray jtouchYs) {
+    if (!jpcount) {
+        LOGE(TAG, "MultiTouchEvent with pointer count = 0 is illegal!");
+        return;
+    }
+    int actions_len, ids_len, touchXs_len, touchYs_len;
+    int *actions = getIntArray(env, &actions_len, jactions);    
+    int *ids = getIntArray(env, &ids_len, jids);
+    int *touchXs = getIntArray(env, &touchXs_len, jtouchXs);
+    int *touchYs = getIntArray(env, &touchYs_len, jtouchYs);
+    for(int i=0;i<jpcount;i++) {
+        actions[i] = to_jfx_touch_action(actions[i]);
+    }
+    (*_notifyMultiTouchEvent)(jpcount, actions, ids, touchXs, touchYs);
+    
+    (*env)->ReleaseIntArrayElements(env, jactions, actions, 0);
+    (*env)->ReleaseIntArrayElements(env, jids, ids, 0);
+    (*env)->ReleaseIntArrayElements(env, jtouchXs, touchXs, 0);
+    (*env)->ReleaseIntArrayElements(env, jtouchYs, touchYs, 0);
+}
+
+int *getIntArray(JNIEnv *env, int *len, jintArray arr) {
+    *len = (*env)->GetArrayLength(env, arr);
+    return (*env)->GetIntArrayElements(env, arr, 0);
+}
+
 ANativeWindow *ANDROID_getNativeWindow() {
     return window;
 }
@@ -310,13 +326,17 @@
 int to_jfx_touch_action(int state) {
     switch (state) {
         case TOUCH_ACTION_DOWN:
+        case TOUCH_ACTION_POINTER_DOWN:    
             return com_sun_glass_events_TouchEvent_TOUCH_PRESSED;
         case TOUCH_ACTION_UP:
+        case TOUCH_ACTION_POINTER_UP:    
             return com_sun_glass_events_TouchEvent_TOUCH_RELEASED;
         case TOUCH_ACTION_MOVE:
             return com_sun_glass_events_TouchEvent_TOUCH_MOVED;
         case TOUCH_ACTION_CANCEL:
-            return com_sun_glass_events_TouchEvent_TOUCH_RELEASED;
+            return com_sun_glass_events_TouchEvent_TOUCH_RELEASED;                    
+        case TOUCH_ACTION_STILL:
+            return com_sun_glass_events_TouchEvent_TOUCH_STILL;
         default:
             return 0;
     }
@@ -360,9 +380,10 @@
             return "TOUCH_ACTION_POINTER_DOWN";
         case TOUCH_ACTION_POINTER_UP:
             return "TOUCH_ACTION_POINTER_UP";
+        case TOUCH_ACTION_STILL:
+            return "TOUCH_ACTION_STILL";
         default:
             return "TOUCH_ACTION_UNKNOWN";
-
     }
 }
 
--- a/modules/graphics/src/main/native-glass/lens/android/android.h	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/main/native-glass/lens/android/android.h	Mon Sep 30 15:55:52 2013 +0200
@@ -90,6 +90,8 @@
 
 int32_t translate_to_linux_keycode(int32_t);
 
+int *getIntArray(JNIEnv *,int *, jintArray);
+
 ANativeWindow *ANDROID_getNativeWindow();
 
 void ANDROID_showIME();
--- a/modules/graphics/src/main/native-glass/lens/android/com_oracle_dalvik_FXActivity.h	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/main/native-glass/lens/android/com_oracle_dalvik_FXActivity.h	Mon Sep 30 15:55:52 2013 +0200
@@ -22,30 +22,66 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
 #include <jni.h>
+/* Header for class com_oracle_dalvik_FXActivity */
 
 #ifndef _Included_com_oracle_dalvik_FXActivity
 #define _Included_com_oracle_dalvik_FXActivity
 #ifdef __cplusplus
 extern "C" {
 #endif
-
-/*
- * Class:     com_oracle_dalvik_FXActivity
- * Method:    initContext
- * Signature: (Lcom/oracle/dalvik/FXActivity;)V
- */
-JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_initContext
-  (JNIEnv *, jobject, jobject);
-
-/*
- * Class:     com_oracle_dalvik_FXActivity
- * Method:    initGlassSymbols
- * Signature: (Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_initGlassSymbols
-  (JNIEnv *, jobject, jstring);
-
+#undef com_oracle_dalvik_FXActivity_MODE_PRIVATE
+#define com_oracle_dalvik_FXActivity_MODE_PRIVATE 0L
+#undef com_oracle_dalvik_FXActivity_MODE_WORLD_READABLE
+#define com_oracle_dalvik_FXActivity_MODE_WORLD_READABLE 1L
+#undef com_oracle_dalvik_FXActivity_MODE_WORLD_WRITEABLE
+#define com_oracle_dalvik_FXActivity_MODE_WORLD_WRITEABLE 2L
+#undef com_oracle_dalvik_FXActivity_MODE_APPEND
+#define com_oracle_dalvik_FXActivity_MODE_APPEND 32768L
+#undef com_oracle_dalvik_FXActivity_MODE_MULTI_PROCESS
+#define com_oracle_dalvik_FXActivity_MODE_MULTI_PROCESS 4L
+#undef com_oracle_dalvik_FXActivity_MODE_ENABLE_WRITE_AHEAD_LOGGING
+#define com_oracle_dalvik_FXActivity_MODE_ENABLE_WRITE_AHEAD_LOGGING 8L
+#undef com_oracle_dalvik_FXActivity_BIND_AUTO_CREATE
+#define com_oracle_dalvik_FXActivity_BIND_AUTO_CREATE 1L
+#undef com_oracle_dalvik_FXActivity_BIND_DEBUG_UNBIND
+#define com_oracle_dalvik_FXActivity_BIND_DEBUG_UNBIND 2L
+#undef com_oracle_dalvik_FXActivity_BIND_NOT_FOREGROUND
+#define com_oracle_dalvik_FXActivity_BIND_NOT_FOREGROUND 4L
+#undef com_oracle_dalvik_FXActivity_BIND_ABOVE_CLIENT
+#define com_oracle_dalvik_FXActivity_BIND_ABOVE_CLIENT 8L
+#undef com_oracle_dalvik_FXActivity_BIND_ALLOW_OOM_MANAGEMENT
+#define com_oracle_dalvik_FXActivity_BIND_ALLOW_OOM_MANAGEMENT 16L
+#undef com_oracle_dalvik_FXActivity_BIND_WAIVE_PRIORITY
+#define com_oracle_dalvik_FXActivity_BIND_WAIVE_PRIORITY 32L
+#undef com_oracle_dalvik_FXActivity_BIND_IMPORTANT
+#define com_oracle_dalvik_FXActivity_BIND_IMPORTANT 64L
+#undef com_oracle_dalvik_FXActivity_BIND_ADJUST_WITH_ACTIVITY
+#define com_oracle_dalvik_FXActivity_BIND_ADJUST_WITH_ACTIVITY 128L
+#undef com_oracle_dalvik_FXActivity_CONTEXT_INCLUDE_CODE
+#define com_oracle_dalvik_FXActivity_CONTEXT_INCLUDE_CODE 1L
+#undef com_oracle_dalvik_FXActivity_CONTEXT_IGNORE_SECURITY
+#define com_oracle_dalvik_FXActivity_CONTEXT_IGNORE_SECURITY 2L
+#undef com_oracle_dalvik_FXActivity_CONTEXT_RESTRICTED
+#define com_oracle_dalvik_FXActivity_CONTEXT_RESTRICTED 4L
+#undef com_oracle_dalvik_FXActivity_RESULT_CANCELED
+#define com_oracle_dalvik_FXActivity_RESULT_CANCELED 0L
+#undef com_oracle_dalvik_FXActivity_RESULT_OK
+#define com_oracle_dalvik_FXActivity_RESULT_OK -1L
+#undef com_oracle_dalvik_FXActivity_RESULT_FIRST_USER
+#define com_oracle_dalvik_FXActivity_RESULT_FIRST_USER 1L
+#undef com_oracle_dalvik_FXActivity_DEFAULT_KEYS_DISABLE
+#define com_oracle_dalvik_FXActivity_DEFAULT_KEYS_DISABLE 0L
+#undef com_oracle_dalvik_FXActivity_DEFAULT_KEYS_DIALER
+#define com_oracle_dalvik_FXActivity_DEFAULT_KEYS_DIALER 1L
+#undef com_oracle_dalvik_FXActivity_DEFAULT_KEYS_SHORTCUT
+#define com_oracle_dalvik_FXActivity_DEFAULT_KEYS_SHORTCUT 2L
+#undef com_oracle_dalvik_FXActivity_DEFAULT_KEYS_SEARCH_LOCAL
+#define com_oracle_dalvik_FXActivity_DEFAULT_KEYS_SEARCH_LOCAL 3L
+#undef com_oracle_dalvik_FXActivity_DEFAULT_KEYS_SEARCH_GLOBAL
+#define com_oracle_dalvik_FXActivity_DEFAULT_KEYS_SEARCH_GLOBAL 4L
 /*
  * Class:     com_oracle_dalvik_FXActivity
  * Method:    _surfaceChanged
--- a/modules/graphics/src/main/native-glass/lens/android/com_oracle_dalvik_FXActivity_InternalSurfaceView.h	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/main/native-glass/lens/android/com_oracle_dalvik_FXActivity_InternalSurfaceView.h	Mon Sep 30 15:55:52 2013 +0200
@@ -22,29 +22,141 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
 #include <jni.h>
+/* Header for class com_oracle_dalvik_FXActivity_InternalSurfaceView */
 
 #ifndef _Included_com_oracle_dalvik_FXActivity_InternalSurfaceView
 #define _Included_com_oracle_dalvik_FXActivity_InternalSurfaceView
 #ifdef __cplusplus
 extern "C" {
 #endif
-
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_NO_ID
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_NO_ID -1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_VISIBLE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_VISIBLE 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_INVISIBLE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_INVISIBLE 4L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_GONE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_GONE 8L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_DRAWING_CACHE_QUALITY_LOW
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_DRAWING_CACHE_QUALITY_LOW 524288L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_DRAWING_CACHE_QUALITY_HIGH
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_DRAWING_CACHE_QUALITY_HIGH 1048576L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_DRAWING_CACHE_QUALITY_AUTO
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_DRAWING_CACHE_QUALITY_AUTO 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_INSIDE_OVERLAY
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_INSIDE_OVERLAY 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_INSIDE_INSET
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_INSIDE_INSET 16777216L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_OUTSIDE_OVERLAY
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_OUTSIDE_INSET
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBARS_OUTSIDE_INSET 50331648L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_KEEP_SCREEN_ON
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_KEEP_SCREEN_ON 67108864L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SOUND_EFFECTS_ENABLED
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SOUND_EFFECTS_ENABLED 134217728L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_HAPTIC_FEEDBACK_ENABLED
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_HAPTIC_FEEDBACK_ENABLED 268435456L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUSABLES_ALL
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUSABLES_ALL 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUSABLES_TOUCH_MODE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUSABLES_TOUCH_MODE 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_BACKWARD
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_BACKWARD 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_FORWARD
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_FORWARD 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_LEFT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_LEFT 17L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_UP
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_UP 33L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_RIGHT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_RIGHT 66L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_DOWN
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FOCUS_DOWN 130L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_SIZE_MASK
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_SIZE_MASK 16777215L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_STATE_MASK
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_STATE_MASK -16777216L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_HEIGHT_STATE_SHIFT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_HEIGHT_STATE_SHIFT 16L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_STATE_TOO_SMALL
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_MEASURED_STATE_TOO_SMALL 16777216L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_TEXT_ALIGNMENT_INHERIT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_TEXT_ALIGNMENT_INHERIT 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_TEXT_ALIGNMENT_RESOLVED_DEFAULT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_TEXT_ALIGNMENT_RESOLVED_DEFAULT 131072L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_IMPORTANT_FOR_ACCESSIBILITY_AUTO
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_IMPORTANT_FOR_ACCESSIBILITY_AUTO 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_IMPORTANT_FOR_ACCESSIBILITY_YES
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_IMPORTANT_FOR_ACCESSIBILITY_YES 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_IMPORTANT_FOR_ACCESSIBILITY_NO
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_IMPORTANT_FOR_ACCESSIBILITY_NO 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_OVER_SCROLL_ALWAYS
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_OVER_SCROLL_ALWAYS 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_OVER_SCROLL_IF_CONTENT_SCROLLS
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_OVER_SCROLL_IF_CONTENT_SCROLLS 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_OVER_SCROLL_NEVER
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_OVER_SCROLL_NEVER 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_VISIBLE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_VISIBLE 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LOW_PROFILE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LOW_PROFILE 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_HIDE_NAVIGATION
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_HIDE_NAVIGATION 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_FULLSCREEN
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_FULLSCREEN 4L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LAYOUT_STABLE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LAYOUT_STABLE 256L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 512L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 1024L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_STATUS_BAR_HIDDEN
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_STATUS_BAR_HIDDEN 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_STATUS_BAR_VISIBLE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_STATUS_BAR_VISIBLE 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_LAYOUT_FLAGS
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SYSTEM_UI_LAYOUT_FLAGS 1536L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FIND_VIEWS_WITH_TEXT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FIND_VIEWS_WITH_TEXT 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_FIND_VIEWS_WITH_CONTENT_DESCRIPTION
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_FIND_VIEWS_WITH_CONTENT_DESCRIPTION 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCREEN_STATE_OFF
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCREEN_STATE_OFF 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCREEN_STATE_ON
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCREEN_STATE_ON 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBAR_POSITION_DEFAULT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBAR_POSITION_DEFAULT 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBAR_POSITION_LEFT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBAR_POSITION_LEFT 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBAR_POSITION_RIGHT
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_SCROLLBAR_POSITION_RIGHT 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_LAYER_TYPE_NONE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_LAYER_TYPE_NONE 0L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_LAYER_TYPE_SOFTWARE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_LAYER_TYPE_SOFTWARE 1L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_LAYER_TYPE_HARDWARE
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_LAYER_TYPE_HARDWARE 2L
+#undef com_oracle_dalvik_FXActivity_InternalSurfaceView_ACTION_POINTER_STILL
+#define com_oracle_dalvik_FXActivity_InternalSurfaceView_ACTION_POINTER_STILL -1L
 /*
  * Class:     com_oracle_dalvik_FXActivity_InternalSurfaceView
- * Method:    onTouchEventNative
- * Signature: (III)V
+ * Method:    onMultiTouchEventNative
+ * Signature: (I[I[I[I[I)V
  */
-JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_00024InternalSurfaceView_onTouchEventNative
-  (JNIEnv *, jobject, jint, jint, jint);
+JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_00024InternalSurfaceView_onMultiTouchEventNative
+  (JNIEnv *, jobject, jint, jintArray, jintArray, jintArray, jintArray);
 
 /*
  * Class:     com_oracle_dalvik_FXActivity_InternalSurfaceView
  * Method:    onKeyEventNative
- * Signature: (II)V
+ * Signature: (IILjava/lang/String;)V
  */
 JNIEXPORT void JNICALL Java_com_oracle_dalvik_FXActivity_00024InternalSurfaceView_onKeyEventNative
-  (JNIEnv *, jobject, jint, jint);
+  (JNIEnv *, jobject, jint, jint, jstring);
 
 #ifdef __cplusplus
 }
--- a/modules/graphics/src/main/native-glass/lens/input/android/androidLens.c	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/main/native-glass/lens/input/android/androidLens.c	Mon Sep 30 15:55:52 2013 +0200
@@ -105,6 +105,26 @@
    DETACH_JNI_THREAD();
 }
 
+void notifyMultiTouchEvent(
+        int count,
+        int *states,
+        int *ids,
+        int *xs,
+        int *ys) {
+    
+    ATTACH_JNI_THREAD();
+    jlong jids[count];
+    
+    for(int i=0;i<count;i++) jids[i] = ids[i];
+    lens_wm_notifyMultiTouchEvent(env,
+           count,
+           states,
+           jids,
+           xs,
+           ys);
+    DETACH_JNI_THREAD();
+}
+
 void notifyMotionEvent(
         int mousePosX,
         int mousePosY,
--- a/modules/graphics/src/main/native-glass/lens/input/android/androidLens.h	Mon Sep 30 14:09:01 2013 +0200
+++ b/modules/graphics/src/main/native-glass/lens/input/android/androidLens.h	Mon Sep 30 15:55:52 2013 +0200
@@ -48,6 +48,13 @@
         int  xabs,
         int  yabs);
 
+    void notifyMultiTouchEvent(
+        int count,
+        int *states,
+        int *ids,
+        int *xs,
+        int *ys);
+    
     void notifyMotionEvent(
         int mousePosX,
         int mousePosY,