### Eclipse Workspace Patch 1.0 #P org.eclipse.swt Index: Eclipse SWT PI/win32/library/build.bat =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/build.bat,v retrieving revision 1.36 diff -u -r1.36 build.bat --- Eclipse SWT PI/win32/library/build.bat 31 May 2010 17:05:24 -0000 1.36 +++ Eclipse SWT PI/win32/library/build.bat 13 Dec 2010 23:59:04 -0000 @@ -11,8 +11,8 @@ @echo off -IF x.%SWT_BUILDDIR%==x. set SWT_BUILDDIR=S:\swt-builddir -IF x.%MSSDK%==x. set MSSDK="%SWT_BUILDDIR%\MSSDKs\Windows Server 2003 SP1 SDK" +IF x.%SWT_BUILDDIR%==x. set SWT_BUILDDIR=C:\Program Files\ +IF x.%MSSDK%==x. set MSSDK="c:\Program Files\Microsoft Platform SDK" IF x.%1==x.x86 GOTO X86 IF x.%1==x.x86_64 GOTO X86_64 @@ -20,10 +20,9 @@ :X86 IF x.%OUTPUT_DIR%==x. set OUTPUT_DIR=..\..\..\org.eclipse.swt.win32.win32.x86 -IF x.%JAVA_HOME%==x. set JAVA_HOME=%SWT_BUILDDIR%\ibm-java2-sdk-50-win-i386 IF x.%BUILD_XULRUNNER%==x.true GOTO XULRUNNER -call "%SWT_BUILDDIR%\MSVCs\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat" call %MSSDK%\setenv /XP32 /RETAIL +call "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat" IF x.%1==x.x86 shift GOTO MAKE @@ -40,7 +39,7 @@ call %MSSDK%\setenv /X64 /RETAIL IF x.%OUTPUT_DIR%==x. set OUTPUT_DIR=..\..\..\org.eclipse.swt.win32.win32.x86_64 -IF x.%JAVA_HOME%==x. set JAVA_HOME=%SWT_BUILDDIR%\ibm-sdk50-x86_64 +IF x."%JAVA_HOME%"==x. set JAVA_HOME=%SWT_BUILDDIR%\ibm-sdk50-x86_64 set CFLAGS=-DJNI64 shift GOTO MAKE Index: Eclipse SWT PI/win32/library/make_win32.mak =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak,v retrieving revision 1.57 diff -u -r1.57 make_win32.mak --- Eclipse SWT PI/win32/library/make_win32.mak 31 May 2010 16:44:05 -0000 1.57 +++ Eclipse SWT PI/win32/library/make_win32.mak 13 Dec 2010 23:59:04 -0000 @@ -34,7 +34,7 @@ AWT_PREFIX = swt-awt AWT_LIB = $(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll -AWT_LIBS = "$(JAVA_HOME)\jre\bin\jawt.lib" +AWT_LIBS = "$(JAVA_HOME)\lib\jawt.lib" AWT_OBJS = swt_awt.obj WGL_PREFIX = swt-wgl Index: Eclipse SWT PI/win32/library/os.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c,v retrieving revision 1.182 diff -u -r1.182 os.c --- Eclipse SWT PI/win32/library/os.c 30 Mar 2010 21:27:46 -0000 1.182 +++ Eclipse SWT PI/win32/library/os.c 13 Dec 2010 23:59:11 -0000 @@ -823,6 +823,26 @@ } #endif +#ifndef NO_CloseGestureInfoHandle +JNIEXPORT jintLong JNICALL OS_NATIVE(CloseGestureInfoHandle) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, CloseGestureInfoHandle_FUNC); +/* + rc = (jintLong)CloseGestureInfoHandle((HGESTUREINFO)arg0); +*/ + { + LOAD_FUNCTION(fp, CloseGestureInfoHandle) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(HGESTUREINFO))fp)((HGESTUREINFO)arg0); + } + } + OS_NATIVE_EXIT(env, that, CloseGestureInfoHandle_FUNC); + return rc; +} +#endif + #ifndef NO_CloseHandle JNIEXPORT jboolean JNICALL OS_NATIVE(CloseHandle) (JNIEnv *env, jclass that, jintLong arg0) @@ -855,6 +875,26 @@ } #endif +#ifndef NO_CloseTouchInputHandle +JNIEXPORT jboolean JNICALL OS_NATIVE(CloseTouchInputHandle) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, CloseTouchInputHandle_FUNC); +/* + rc = (jboolean)CloseTouchInputHandle((HTOUCHINPUT)arg0); +*/ + { + LOAD_FUNCTION(fp, CloseTouchInputHandle) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(HTOUCHINPUT))fp)((HTOUCHINPUT)arg0); + } + } + OS_NATIVE_EXIT(env, that, CloseTouchInputHandle_FUNC); + return rc; +} +#endif + #ifndef NO_CoCreateInstance JNIEXPORT jint JNICALL OS_NATIVE(CoCreateInstance) (JNIEnv *env, jclass that, jbyteArray arg0, jintLong arg1, jint arg2, jbyteArray arg3, jintLongArray arg4) @@ -3099,6 +3139,30 @@ } #endif +#ifndef NO_FLICK_1DATA_1sizeof +JNIEXPORT jint JNICALL OS_NATIVE(FLICK_1DATA_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, FLICK_1DATA_1sizeof_FUNC); + rc = (jint)FLICK_DATA_sizeof(); + OS_NATIVE_EXIT(env, that, FLICK_1DATA_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_FLICK_1POINT_1sizeof +JNIEXPORT jint JNICALL OS_NATIVE(FLICK_1POINT_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, FLICK_1POINT_1sizeof_FUNC); + rc = (jint)FLICK_POINT_sizeof(); + OS_NATIVE_EXIT(env, that, FLICK_1POINT_1sizeof_FUNC); + return rc; +} +#endif + #ifndef NO_FillPath JNIEXPORT jboolean JNICALL OS_NATIVE(FillPath) (JNIEnv *env, jclass that, jintLong arg0) @@ -3220,6 +3284,30 @@ } #endif +#ifndef NO_GESTURECONFIG_1sizeof +JNIEXPORT jint JNICALL OS_NATIVE(GESTURECONFIG_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, GESTURECONFIG_1sizeof_FUNC); + rc = (jint)GESTURECONFIG_sizeof(); + OS_NATIVE_EXIT(env, that, GESTURECONFIG_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_GESTUREINFO_1sizeof +JNIEXPORT jint JNICALL OS_NATIVE(GESTUREINFO_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, GESTUREINFO_1sizeof_FUNC); + rc = (jint)GESTUREINFO_sizeof(); + OS_NATIVE_EXIT(env, that, GESTUREINFO_1sizeof_FUNC); + return rc; +} +#endif + #ifndef NO_GET_1WHEEL_1DELTA_1WPARAM JNIEXPORT jint JNICALL OS_NATIVE(GET_1WHEEL_1DELTA_1WPARAM) (JNIEnv *env, jclass that, jintLong arg0) @@ -3256,6 +3344,18 @@ } #endif +#ifndef NO_GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT +JNIEXPORT jdouble JNICALL OS_NATIVE(GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT) + (JNIEnv *env, jclass that, jlong arg0) +{ + jdouble rc = 0; + OS_NATIVE_ENTER(env, that, GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT_FUNC); + rc = (jdouble)GID_ROTATE_ANGLE_FROM_ARGUMENT(arg0); + OS_NATIVE_EXIT(env, that, GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT_FUNC); + return rc; +} +#endif + #ifndef NO_GRADIENT_1RECT_1sizeof JNIEXPORT jint JNICALL OS_NATIVE(GRADIENT_1RECT_1sizeof) (JNIEnv *env, jclass that) @@ -4052,6 +4152,30 @@ } #endif +#ifndef NO_GetGestureInfo +JNIEXPORT jboolean JNICALL OS_NATIVE(GetGestureInfo) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + GESTUREINFO _arg1, *lparg1=NULL; + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, GetGestureInfo_FUNC); + if (arg1) if ((lparg1 = getGESTUREINFOFields(env, arg1, &_arg1)) == NULL) goto fail; +/* + rc = (jboolean)GetGestureInfo((HGESTUREINFO)arg0, (PGESTUREINFO)lparg1); +*/ + { + LOAD_FUNCTION(fp, GetGestureInfo) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(HGESTUREINFO, PGESTUREINFO))fp)((HGESTUREINFO)arg0, (PGESTUREINFO)lparg1); + } + } +fail: + if (arg1 && lparg1) setGESTUREINFOFields(env, arg1, lparg1); + OS_NATIVE_EXIT(env, that, GetGestureInfo_FUNC); + return rc; +} +#endif + #ifndef NO_GetGlyphIndicesW JNIEXPORT jint JNICALL OS_NATIVE(GetGlyphIndicesW) (JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jshortArray arg3, jint arg4) @@ -5969,6 +6093,26 @@ } #endif +#ifndef NO_GetTouchInputInfo +JNIEXPORT jboolean JNICALL OS_NATIVE(GetTouchInputInfo) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLong arg2, jint arg3) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, GetTouchInputInfo_FUNC); +/* + rc = (jboolean)GetTouchInputInfo((HTOUCHINPUT)arg0, (UINT)arg1, (PTOUCHINPUT)arg2, arg3); +*/ + { + LOAD_FUNCTION(fp, GetTouchInputInfo) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(HTOUCHINPUT, UINT, PTOUCHINPUT, jint))fp)((HTOUCHINPUT)arg0, (UINT)arg1, (PTOUCHINPUT)arg2, arg3); + } + } + OS_NATIVE_EXIT(env, that, GetTouchInputInfo_FUNC); + return rc; +} +#endif + #ifndef NO_GetUpdateRect JNIEXPORT jboolean JNICALL OS_NATIVE(GetUpdateRect) (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jboolean arg2) @@ -7676,6 +7820,18 @@ } #endif +#ifndef NO_LODWORD +JNIEXPORT jint JNICALL OS_NATIVE(LODWORD) + (JNIEnv *env, jclass that, jlong arg0) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, LODWORD_FUNC); + rc = (jint)LODWORD(arg0); + OS_NATIVE_EXIT(env, that, LODWORD_FUNC); + return rc; +} +#endif + #ifndef NO_LOGBRUSH_1sizeof JNIEXPORT jint JNICALL OS_NATIVE(LOGBRUSH_1sizeof) (JNIEnv *env, jclass that) @@ -8553,6 +8709,30 @@ } #endif +#if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_GESTURECONFIG_2I) && defined(JNI64)) +#ifndef JNI64 +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2) +#else +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__JLorg_eclipse_swt_internal_win32_GESTURECONFIG_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2) +#endif +{ + GESTURECONFIG _arg1, *lparg1=NULL; +#ifndef JNI64 + OS_NATIVE_ENTER(env, that, MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I_FUNC); +#else + OS_NATIVE_ENTER(env, that, MoveMemory__JLorg_eclipse_swt_internal_win32_GESTURECONFIG_2I_FUNC); +#endif + if (arg1) if ((lparg1 = getGESTURECONFIGFields(env, arg1, &_arg1)) == NULL) goto fail; + MoveMemory((PVOID)arg0, (CONST VOID *)lparg1, arg2); +fail: +#ifndef JNI64 + OS_NATIVE_EXIT(env, that, MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I_FUNC); +#else + OS_NATIVE_EXIT(env, that, MoveMemory__JLorg_eclipse_swt_internal_win32_GESTURECONFIG_2I_FUNC); +#endif +} +#endif + #if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2) @@ -9586,6 +9766,62 @@ } #endif +#if (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II) && !defined(JNI64)) || (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3JI) && defined(JNI64)) +#ifndef JNI64 +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II)(JNIEnv *env, jclass that, jobject arg0, jintLongArray arg1, jint arg2) +#else +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3JI)(JNIEnv *env, jclass that, jobject arg0, jintLongArray arg1, jint arg2) +#endif +{ + FLICK_DATA _arg0, *lparg0=NULL; + jintLong *lparg1=NULL; +#ifndef JNI64 + OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II_FUNC); +#else + OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3JI_FUNC); +#endif + if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail; + if (arg1) if ((lparg1 = (*env)->GetIntLongArrayElements(env, arg1, NULL)) == NULL) goto fail; + MoveMemory((PVOID)lparg0, (CONST VOID *)lparg1, arg2); +fail: + if (arg1 && lparg1) (*env)->ReleaseIntLongArrayElements(env, arg1, lparg1, JNI_ABORT); + if (arg0 && lparg0) setFLICK_DATAFields(env, arg0, lparg0); +#ifndef JNI64 + OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II_FUNC); +#else + OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3JI_FUNC); +#endif +} +#endif + +#if (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II) && !defined(JNI64)) || (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3JI) && defined(JNI64)) +#ifndef JNI64 +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II)(JNIEnv *env, jclass that, jobject arg0, jintLongArray arg1, jint arg2) +#else +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3JI)(JNIEnv *env, jclass that, jobject arg0, jintLongArray arg1, jint arg2) +#endif +{ + FLICK_POINT _arg0, *lparg0=NULL; + jintLong *lparg1=NULL; +#ifndef JNI64 + OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II_FUNC); +#else + OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3JI_FUNC); +#endif + if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail; + if (arg1) if ((lparg1 = (*env)->GetIntLongArrayElements(env, arg1, NULL)) == NULL) goto fail; + MoveMemory((PVOID)lparg0, (CONST VOID *)lparg1, arg2); +fail: + if (arg1 && lparg1) (*env)->ReleaseIntLongArrayElements(env, arg1, lparg1, JNI_ABORT); + if (arg0 && lparg0) setFLICK_POINTFields(env, arg0, lparg0); +#ifndef JNI64 + OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II_FUNC); +#else + OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3JI_FUNC); +#endif +} +#endif + #if (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2II) && !defined(JNI64)) || (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2JI) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jint arg2) @@ -10595,6 +10831,31 @@ } #endif +#if (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II) && !defined(JNI64)) || (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2JI) && defined(JNI64)) +#ifndef JNI64 +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jint arg2) +#else +JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2JI)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jint arg2) +#endif +{ + TOUCHINPUT _arg0, *lparg0=NULL; +#ifndef JNI64 + OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II_FUNC); +#else + OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2JI_FUNC); +#endif + if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail; + MoveMemory((PVOID)lparg0, (CONST VOID *)arg1, arg2); +fail: + if (arg0 && lparg0) setTOUCHINPUTFields(env, arg0, lparg0); +#ifndef JNI64 + OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II_FUNC); +#else + OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2JI_FUNC); +#endif +} +#endif + #if (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2II) && !defined(JNI64)) || (!defined(NO_MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2JI) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jint arg2) @@ -12494,6 +12755,26 @@ } #endif +#ifndef NO_RegisterTouchWindow +JNIEXPORT jboolean JNICALL OS_NATIVE(RegisterTouchWindow) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, RegisterTouchWindow_FUNC); +/* + rc = (jboolean)RegisterTouchWindow((HWND)arg0, (ULONG)arg1); +*/ + { + LOAD_FUNCTION(fp, RegisterTouchWindow) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(HWND, ULONG))fp)((HWND)arg0, (ULONG)arg1); + } + } + OS_NATIVE_EXIT(env, that, RegisterTouchWindow_FUNC); + return rc; +} +#endif + #ifndef NO_RegisterWindowMessageA JNIEXPORT jint JNICALL OS_NATIVE(RegisterWindowMessageA) (JNIEnv *env, jclass that, jbyteArray arg0) @@ -15650,6 +15931,26 @@ } #endif +#ifndef NO_SetGestureConfig +JNIEXPORT jboolean JNICALL OS_NATIVE(SetGestureConfig) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jintLong arg3, jint arg4) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, SetGestureConfig_FUNC); +/* + rc = (jboolean)SetGestureConfig((HWND)arg0, arg1, arg2, (PGESTURECONFIG)arg3, arg4); +*/ + { + LOAD_FUNCTION(fp, SetGestureConfig) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(HWND, jint, jint, PGESTURECONFIG, jint))fp)((HWND)arg0, arg1, arg2, (PGESTURECONFIG)arg3, arg4); + } + } + OS_NATIVE_EXIT(env, that, SetGestureConfig_FUNC); + return rc; +} +#endif + #ifndef NO_SetGraphicsMode JNIEXPORT jint JNICALL OS_NATIVE(SetGraphicsMode) (JNIEnv *env, jclass that, jintLong arg0, jint arg1) @@ -16727,6 +17028,30 @@ } #endif +#ifndef NO_TOUCHINPUT_1sizeof +JNIEXPORT jint JNICALL OS_NATIVE(TOUCHINPUT_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, TOUCHINPUT_1sizeof_FUNC); + rc = (jint)TOUCHINPUT_sizeof(); + OS_NATIVE_EXIT(env, that, TOUCHINPUT_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_TOUCH_1COORD_1TO_1PIXEL +JNIEXPORT jlong JNICALL OS_NATIVE(TOUCH_1COORD_1TO_1PIXEL) + (JNIEnv *env, jclass that, jlong arg0) +{ + jlong rc = 0; + OS_NATIVE_ENTER(env, that, TOUCH_1COORD_1TO_1PIXEL_FUNC); + rc = (jlong)TOUCH_COORD_TO_PIXEL(arg0); + OS_NATIVE_EXIT(env, that, TOUCH_1COORD_1TO_1PIXEL_FUNC); + return rc; +} +#endif + #ifndef NO_TRACKMOUSEEVENT_1sizeof JNIEXPORT jint JNICALL OS_NATIVE(TRACKMOUSEEVENT_1sizeof) (JNIEnv *env, jclass that) @@ -17077,6 +17402,26 @@ } #endif +#ifndef NO_UnregisterTouchWindow +JNIEXPORT jboolean JNICALL OS_NATIVE(UnregisterTouchWindow) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, UnregisterTouchWindow_FUNC); +/* + rc = (jboolean)UnregisterTouchWindow(arg0); +*/ + { + LOAD_FUNCTION(fp, UnregisterTouchWindow) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } + OS_NATIVE_EXIT(env, that, UnregisterTouchWindow_FUNC); + return rc; +} +#endif + #ifndef NO_UpdateLayeredWindow JNIEXPORT jboolean JNICALL OS_NATIVE(UpdateLayeredWindow) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2, jobject arg3, jintLong arg4, jobject arg5, jint arg6, jobject arg7, jint arg8) Index: Eclipse SWT PI/win32/library/os.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h,v retrieving revision 1.133 diff -u -r1.133 os.h --- Eclipse SWT PI/win32/library/os.h 31 May 2010 16:44:05 -0000 1.133 +++ Eclipse SWT PI/win32/library/os.h 13 Dec 2010 23:59:11 -0000 @@ -673,10 +673,135 @@ #endif /* _WIN32_IE <= 0x0600 */ #endif /* _WIN32_WCE */ +#ifndef FLICKDIRECTION +typedef enum FLICKDIRECTION +{ + FLICKDIRECTION_MIN = 0, + FLICKDIRECTION_RIGHT = 0, + FLICKDIRECTION_UPRIGHT = 1, + FLICKDIRECTION_UP = 2, + FLICKDIRECTION_UPLEFT = 3, + FLICKDIRECTION_LEFT = 4, + FLICKDIRECTION_DOWNLEFT = 5, + FLICKDIRECTION_DOWN = 6, + FLICKDIRECTION_DOWNRIGHT = 7, + FLICKDIRECTION_INVALID = 8, +}FLICKDIRECTION; +#endif + +#ifndef FLICK_POINT +typedef struct FLICK_POINT +{ + INT x:16; + INT y:16; +}FLICK_POINT; +#endif + +#ifndef FLICKACTION_COMMANDCODE +typedef enum FLICKACTION_COMMANDCODE +{ + FLICKACTION_COMMANDCODE_NULL = 0, + FLICKACTION_COMMANDCODE_SCROLL = 1, + FLICKACTION_COMMANDCODE_APPCOMMAND = 2, + FLICKACTION_COMMANDCODE_CUSTOMKEY = 3, + FLICKACTION_COMMANDCODE_KEYMODIFIER = 4, +}FLICKACTION_COMMANDCODE; +#endif + +#ifndef FLICK_DATA +typedef struct FLICK_DATA +{ + FLICKACTION_COMMANDCODE iFlickActionCommandCode:5; + FLICKDIRECTION iFlickDirection:3; + BOOL fControlModifier:1; + BOOL fMenuModifier:1; + BOOL fAltGRModifier:1; + BOOL fWinModifier:1; + BOOL fShiftModifier:1; + INT iReserved:2; + BOOL fOnInkingSurface:1; + INT iActionArgument:16; +}FLICK_DATA; +#endif + +#if(WINVER < 0x0601) +/* + * Touch input handle + */ +DECLARE_HANDLE(HTOUCHINPUT); + +typedef struct tagTOUCHINPUT { + LONG x; + LONG y; + HANDLE hSource; + DWORD dwID; + DWORD dwFlags; + DWORD dwMask; + DWORD dwTime; + ULONG_PTR dwExtraInfo; + DWORD cxContact; + DWORD cyContact; +} TOUCHINPUT, *PTOUCHINPUT; +typedef TOUCHINPUT const * PCTOUCHINPUT; + +/* + * Conversion of touch input coordinates to pixels + */ +#define TOUCH_COORD_TO_PIXEL(l) ((l) / 100) + +/* + * Gesture information handle + */ +DECLARE_HANDLE(HGESTUREINFO); + +typedef struct tagGESTUREINFO { + UINT cbSize; // size, in bytes, of this structure (including variable length Args field) + DWORD dwFlags; // see GF_* flags + DWORD dwID; // gesture ID, see GID_* defines + HWND hwndTarget; // handle to window targeted by this gesture + POINTS ptsLocation; // current location of this gesture + DWORD dwInstanceID; // internally used + DWORD dwSequenceID; // internally used + ULONGLONG ullArguments; // arguments for gestures whose arguments fit in 8 BYTES + UINT cbExtraArgs; // size, in bytes, of extra arguments, if any, that accompany this gesture +} GESTUREINFO, *PGESTUREINFO; +typedef GESTUREINFO const * PCGESTUREINFO; + +typedef struct tagGESTURENOTIFYSTRUCT { + UINT cbSize; // size, in bytes, of this structure + DWORD dwFlags; // unused + HWND hwndTarget; // handle to window targeted by the gesture + POINTS ptsLocation; // starting location + DWORD dwInstanceID; // internally used +} GESTURENOTIFYSTRUCT, *PGESTURENOTIFYSTRUCT; + +/* + * Gesture argument helpers + * - Angle should be a double in the range of -2pi to +2pi + * - Argument should be an unsigned 16-bit value + */ +#define GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_) ((USHORT)((((_arg_) + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65535.0)) +#define GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_) ((((double)(_arg_) / 65535.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265) + +typedef struct tagGESTURECONFIG { + DWORD dwID; // gesture ID + DWORD dwWant; // settings related to gesture ID that are to be turned on + DWORD dwBlock; // settings related to gesture ID that are to be turned off +} GESTURECONFIG, *PGESTURECONFIG; +#endif /* WINVER >= 0x0601 */ + #ifndef GET_WHEEL_DELTA_WPARAM #define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam)) #endif +#ifndef LODWORD +#define LODWORD(l) ((DWORD)((DWORDLONG)(l))) +#endif + +#ifndef HIDWORD +#define HIDWORD(l) ((DWORD)(((DWORDLONG)(l)>>32)&0xFFFFFFFF)) +#endif + #include "os_custom.h" #endif /* INC_os_H */ Index: Eclipse SWT PI/win32/library/os_custom.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h,v retrieving revision 1.49 diff -u -r1.49 os_custom.h --- Eclipse SWT PI/win32/library/os_custom.h 31 May 2010 16:44:05 -0000 1.49 +++ Eclipse SWT PI/win32/library/os_custom.h 13 Dec 2010 23:59:11 -0000 @@ -26,7 +26,9 @@ #define BufferedPaintUnInit_LIB "uxtheme.dll" #define BufferedPaintSetAlpha_LIB "uxtheme.dll" #define BeginBufferedPaint_LIB "uxtheme.dll" +#define CloseGestureInfoHandle_LIB "user32.dll" #define CloseThemeData_LIB "uxtheme.dll" +#define CloseTouchInputHandle_LIB "user32.dll" #define CoInternetIsFeatureEnabled_LIB "urlmon.dll" #define CoInternetSetFeatureEnabled_LIB "urlmon.dll" #define CreateActCtxW_LIB "kernel32.dll" @@ -38,6 +40,7 @@ #define DrawThemeText_LIB "uxtheme.dll" #define DwmEnableBlurBehindWindow_LIB "dwmapi.dll" #define DwmExtendFrameIntoClientArea_LIB "dwmapi.dll" +#define GetGestureInfo_LIB "user32.dll" #define GetThemeInt_LIB "uxtheme.dll" #define GetThemeMargins_LIB "uxtheme.dll" #define GetThemeBackgroundContentRect_LIB "uxtheme.dll" @@ -47,6 +50,7 @@ #define GetThemeMetric_LIB "uxtheme.dll" #define GetThemeRect_LIB "uxtheme.dll" #define GetThemeSysSize_LIB "uxtheme.dll" +#define GetTouchInputInfo_LIB "user32.dll" #define HitTestThemeBackground_LIB "uxtheme.dll" #define EndBufferedPaint_LIB "uxtheme.dll" #define EnumDisplayMonitors_LIB "user32.dll" @@ -72,7 +76,9 @@ #define OpenThemeData_LIB "uxtheme.dll" #define PrintWindow_LIB "user32.dll" #define PSPropertyKeyFromString_LIB "propsys.dll" +#define RegisterTouchWindow_LIB "user32.dll" #define SetCurrentProcessExplicitAppUserModelID_LIB "shell32.dll" +#define SetGestureConfig_LIB "user32.dll" #define SetLayeredWindowAttributes_LIB "user32.dll" #define SetLayout_LIB "gdi32.dll" #define SetMenuInfo_LIB "user32.dll" @@ -81,4 +87,5 @@ #define SHCreateItemFromRelativeName_LIB "shell32.dll" #define SHCreateItemInKnownFolder_LIB "shell32.dll" #define TransparentBlt_LIB "msimg32.dll" +#define UnregisterTouchWindow_LIB "user32.dll" #define UpdateLayeredWindow_LIB "user32.dll" Index: Eclipse SWT PI/win32/library/os_stats.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c,v retrieving revision 1.135 diff -u -r1.135 os_stats.c --- Eclipse SWT PI/win32/library/os_stats.c 30 Mar 2010 21:03:08 -0000 1.135 +++ Eclipse SWT PI/win32/library/os_stats.c 13 Dec 2010 23:59:11 -0000 @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1009; -int OS_nativeFunctionCallCount[1009]; +int OS_nativeFunctionCount = 1028; +int OS_nativeFunctionCallCount[1028]; char * OS_nativeFunctionNames[] = { "ACCEL_1sizeof", "ACTCTX_1sizeof", @@ -69,8 +69,10 @@ "ClientToScreen", "CloseClipboard", "CloseEnhMetaFile", + "CloseGestureInfoHandle", "CloseHandle", "CloseThemeData", + "CloseTouchInputHandle", "CoCreateInstance", "CoInternetIsFeatureEnabled", "CoInternetSetFeatureEnabled", @@ -222,6 +224,8 @@ "ExtractIconExA", "ExtractIconExW", "FILETIME_1sizeof", + "FLICK_1DATA_1sizeof", + "FLICK_1POINT_1sizeof", "FillPath", "FillRect", "FindWindowA", @@ -230,9 +234,12 @@ "FormatMessageW", "FreeLibrary", "GCP_1RESULTS_1sizeof", + "GESTURECONFIG_1sizeof", + "GESTUREINFO_1sizeof", "GET_1WHEEL_1DELTA_1WPARAM", "GET_1X_1LPARAM", "GET_1Y_1LPARAM", + "GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT", "GRADIENT_1RECT_1sizeof", "GUITHREADINFO_1sizeof", "GdiSetBatchLimit", @@ -280,6 +287,7 @@ "GetFontLanguageInfo", "GetForegroundWindow", "GetGUIThreadInfo", + "GetGestureInfo", "GetGlyphIndicesW", "GetGraphicsMode", "GetIconInfo", @@ -439,6 +447,7 @@ "GetTickCount", "GetTimeFormatA", "GetTimeFormatW", + "GetTouchInputInfo", "GetUpdateRect", "GetUpdateRgn", "GetVersionExA__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOA_2", @@ -577,6 +586,7 @@ "KEYBDINPUT_1sizeof", "KillTimer", "LITEM_1sizeof", + "LODWORD", "LOGBRUSH_1sizeof", "LOGFONTA_1sizeof", "LOGFONTW_1sizeof", @@ -679,6 +689,11 @@ "MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I", #endif #ifndef JNI64 + "MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I", +#else + "MoveMemory__JLorg_eclipse_swt_internal_win32_GESTURECONFIG_2I", +#endif +#ifndef JNI64 "MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I", #else "MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I", @@ -865,6 +880,16 @@ "MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2JI", #endif #ifndef JNI64 + "MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II", +#else + "MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3JI", +#endif +#ifndef JNI64 + "MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II", +#else + "MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3JI", +#endif +#ifndef JNI64 "MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2II", #else "MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2JI", @@ -1061,6 +1086,11 @@ "MoveMemory__Lorg_eclipse_swt_internal_win32_TEXTMETRICW_2JI", #endif #ifndef JNI64 + "MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II", +#else + "MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2JI", +#endif +#ifndef JNI64 "MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2II", #else "MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2JI", @@ -1225,6 +1255,7 @@ "RegisterClassW", "RegisterClipboardFormatA", "RegisterClipboardFormatW", + "RegisterTouchWindow", "RegisterWindowMessageA", "RegisterWindowMessageW", "ReleaseCapture", @@ -1652,6 +1683,7 @@ "SetErrorMode", "SetFocus", "SetForegroundWindow", + "SetGestureConfig", "SetGraphicsMode", "SetLayeredWindowAttributes", "SetLayout", @@ -1727,6 +1759,8 @@ "TF_1DA_1COLOR_1sizeof", "TF_1DISPLAYATTRIBUTE_1sizeof", "TOOLINFO_1sizeof", + "TOUCHINPUT_1sizeof", + "TOUCH_1COORD_1TO_1PIXEL", "TRACKMOUSEEVENT_1sizeof", "TRIVERTEX_1sizeof", "TVHITTESTINFO_1sizeof", @@ -1751,6 +1785,7 @@ "UnmapViewOfFile", "UnregisterClassA", "UnregisterClassW", + "UnregisterTouchWindow", "UpdateLayeredWindow", "UpdateWindow", "ValidateRect", Index: Eclipse SWT PI/win32/library/os_stats.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h,v retrieving revision 1.135 diff -u -r1.135 os_stats.h --- Eclipse SWT PI/win32/library/os_stats.h 30 Mar 2010 21:03:08 -0000 1.135 +++ Eclipse SWT PI/win32/library/os_stats.h 13 Dec 2010 23:59:12 -0000 @@ -77,8 +77,10 @@ ClientToScreen_FUNC, CloseClipboard_FUNC, CloseEnhMetaFile_FUNC, + CloseGestureInfoHandle_FUNC, CloseHandle_FUNC, CloseThemeData_FUNC, + CloseTouchInputHandle_FUNC, CoCreateInstance_FUNC, CoInternetIsFeatureEnabled_FUNC, CoInternetSetFeatureEnabled_FUNC, @@ -230,6 +232,8 @@ ExtractIconExA_FUNC, ExtractIconExW_FUNC, FILETIME_1sizeof_FUNC, + FLICK_1DATA_1sizeof_FUNC, + FLICK_1POINT_1sizeof_FUNC, FillPath_FUNC, FillRect_FUNC, FindWindowA_FUNC, @@ -238,9 +242,12 @@ FormatMessageW_FUNC, FreeLibrary_FUNC, GCP_1RESULTS_1sizeof_FUNC, + GESTURECONFIG_1sizeof_FUNC, + GESTUREINFO_1sizeof_FUNC, GET_1WHEEL_1DELTA_1WPARAM_FUNC, GET_1X_1LPARAM_FUNC, GET_1Y_1LPARAM_FUNC, + GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT_FUNC, GRADIENT_1RECT_1sizeof_FUNC, GUITHREADINFO_1sizeof_FUNC, GdiSetBatchLimit_FUNC, @@ -288,6 +295,7 @@ GetFontLanguageInfo_FUNC, GetForegroundWindow_FUNC, GetGUIThreadInfo_FUNC, + GetGestureInfo_FUNC, GetGlyphIndicesW_FUNC, GetGraphicsMode_FUNC, GetIconInfo_FUNC, @@ -447,6 +455,7 @@ GetTickCount_FUNC, GetTimeFormatA_FUNC, GetTimeFormatW_FUNC, + GetTouchInputInfo_FUNC, GetUpdateRect_FUNC, GetUpdateRgn_FUNC, GetVersionExA__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOA_2_FUNC, @@ -585,6 +594,7 @@ KEYBDINPUT_1sizeof_FUNC, KillTimer_FUNC, LITEM_1sizeof_FUNC, + LODWORD_FUNC, LOGBRUSH_1sizeof_FUNC, LOGFONTA_1sizeof_FUNC, LOGFONTW_1sizeof_FUNC, @@ -687,6 +697,11 @@ MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I_FUNC, #endif #ifndef JNI64 + MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I_FUNC, +#else + MoveMemory__JLorg_eclipse_swt_internal_win32_GESTURECONFIG_2I_FUNC, +#endif +#ifndef JNI64 MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC, #else MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC, @@ -873,6 +888,16 @@ MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2JI_FUNC, #endif #ifndef JNI64 + MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II_FUNC, +#else + MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3JI_FUNC, +#endif +#ifndef JNI64 + MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II_FUNC, +#else + MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3JI_FUNC, +#endif +#ifndef JNI64 MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2II_FUNC, #else MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2JI_FUNC, @@ -1069,6 +1094,11 @@ MoveMemory__Lorg_eclipse_swt_internal_win32_TEXTMETRICW_2JI_FUNC, #endif #ifndef JNI64 + MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II_FUNC, +#else + MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2JI_FUNC, +#endif +#ifndef JNI64 MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2II_FUNC, #else MoveMemory__Lorg_eclipse_swt_internal_win32_TVITEM_2JI_FUNC, @@ -1233,6 +1263,7 @@ RegisterClassW_FUNC, RegisterClipboardFormatA_FUNC, RegisterClipboardFormatW_FUNC, + RegisterTouchWindow_FUNC, RegisterWindowMessageA_FUNC, RegisterWindowMessageW_FUNC, ReleaseCapture_FUNC, @@ -1660,6 +1691,7 @@ SetErrorMode_FUNC, SetFocus_FUNC, SetForegroundWindow_FUNC, + SetGestureConfig_FUNC, SetGraphicsMode_FUNC, SetLayeredWindowAttributes_FUNC, SetLayout_FUNC, @@ -1735,6 +1767,8 @@ TF_1DA_1COLOR_1sizeof_FUNC, TF_1DISPLAYATTRIBUTE_1sizeof_FUNC, TOOLINFO_1sizeof_FUNC, + TOUCHINPUT_1sizeof_FUNC, + TOUCH_1COORD_1TO_1PIXEL_FUNC, TRACKMOUSEEVENT_1sizeof_FUNC, TRIVERTEX_1sizeof_FUNC, TVHITTESTINFO_1sizeof_FUNC, @@ -1759,6 +1793,7 @@ UnmapViewOfFile_FUNC, UnregisterClassA_FUNC, UnregisterClassW_FUNC, + UnregisterTouchWindow_FUNC, UpdateLayeredWindow_FUNC, UpdateWindow_FUNC, ValidateRect_FUNC, Index: Eclipse SWT PI/win32/library/os_structs.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c,v retrieving revision 1.81 diff -u -r1.81 os_structs.c --- Eclipse SWT PI/win32/library/os_structs.c 25 Feb 2010 20:37:14 -0000 1.81 +++ Eclipse SWT PI/win32/library/os_structs.c 13 Dec 2010 23:59:17 -0000 @@ -1721,6 +1721,98 @@ } #endif +#ifndef NO_FLICK_DATA +typedef struct FLICK_DATA_FID_CACHE { + int cached; + jclass clazz; + jfieldID iFlickActionCommandCode, iFlickDirection, fControlModifier, fMenuModifier, fAltGRModifier, fWinModifier, fShiftModifier, iReserved, fOnInkingSurface, iActionArgument; +} FLICK_DATA_FID_CACHE; + +FLICK_DATA_FID_CACHE FLICK_DATAFc; + +void cacheFLICK_DATAFields(JNIEnv *env, jobject lpObject) +{ + if (FLICK_DATAFc.cached) return; + FLICK_DATAFc.clazz = (*env)->GetObjectClass(env, lpObject); + FLICK_DATAFc.iFlickActionCommandCode = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "iFlickActionCommandCode", "I"); + FLICK_DATAFc.iFlickDirection = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "iFlickDirection", "I"); + FLICK_DATAFc.fControlModifier = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "fControlModifier", "Z"); + FLICK_DATAFc.fMenuModifier = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "fMenuModifier", "Z"); + FLICK_DATAFc.fAltGRModifier = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "fAltGRModifier", "Z"); + FLICK_DATAFc.fWinModifier = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "fWinModifier", "Z"); + FLICK_DATAFc.fShiftModifier = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "fShiftModifier", "Z"); + FLICK_DATAFc.iReserved = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "iReserved", "I"); + FLICK_DATAFc.fOnInkingSurface = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "fOnInkingSurface", "Z"); + FLICK_DATAFc.iActionArgument = (*env)->GetFieldID(env, FLICK_DATAFc.clazz, "iActionArgument", "I"); + FLICK_DATAFc.cached = 1; +} + +FLICK_DATA *getFLICK_DATAFields(JNIEnv *env, jobject lpObject, FLICK_DATA *lpStruct) +{ + if (!FLICK_DATAFc.cached) cacheFLICK_DATAFields(env, lpObject); + lpStruct->iFlickActionCommandCode = (*env)->GetIntField(env, lpObject, FLICK_DATAFc.iFlickActionCommandCode); + lpStruct->iFlickDirection = (*env)->GetIntField(env, lpObject, FLICK_DATAFc.iFlickDirection); + lpStruct->fControlModifier = (*env)->GetBooleanField(env, lpObject, FLICK_DATAFc.fControlModifier); + lpStruct->fMenuModifier = (*env)->GetBooleanField(env, lpObject, FLICK_DATAFc.fMenuModifier); + lpStruct->fAltGRModifier = (*env)->GetBooleanField(env, lpObject, FLICK_DATAFc.fAltGRModifier); + lpStruct->fWinModifier = (*env)->GetBooleanField(env, lpObject, FLICK_DATAFc.fWinModifier); + lpStruct->fShiftModifier = (*env)->GetBooleanField(env, lpObject, FLICK_DATAFc.fShiftModifier); + lpStruct->iReserved = (*env)->GetIntField(env, lpObject, FLICK_DATAFc.iReserved); + lpStruct->fOnInkingSurface = (*env)->GetBooleanField(env, lpObject, FLICK_DATAFc.fOnInkingSurface); + lpStruct->iActionArgument = (*env)->GetIntField(env, lpObject, FLICK_DATAFc.iActionArgument); + return lpStruct; +} + +void setFLICK_DATAFields(JNIEnv *env, jobject lpObject, FLICK_DATA *lpStruct) +{ + if (!FLICK_DATAFc.cached) cacheFLICK_DATAFields(env, lpObject); + (*env)->SetIntField(env, lpObject, FLICK_DATAFc.iFlickActionCommandCode, (jint)lpStruct->iFlickActionCommandCode); + (*env)->SetIntField(env, lpObject, FLICK_DATAFc.iFlickDirection, (jint)lpStruct->iFlickDirection); + (*env)->SetBooleanField(env, lpObject, FLICK_DATAFc.fControlModifier, (jboolean)lpStruct->fControlModifier); + (*env)->SetBooleanField(env, lpObject, FLICK_DATAFc.fMenuModifier, (jboolean)lpStruct->fMenuModifier); + (*env)->SetBooleanField(env, lpObject, FLICK_DATAFc.fAltGRModifier, (jboolean)lpStruct->fAltGRModifier); + (*env)->SetBooleanField(env, lpObject, FLICK_DATAFc.fWinModifier, (jboolean)lpStruct->fWinModifier); + (*env)->SetBooleanField(env, lpObject, FLICK_DATAFc.fShiftModifier, (jboolean)lpStruct->fShiftModifier); + (*env)->SetIntField(env, lpObject, FLICK_DATAFc.iReserved, (jint)lpStruct->iReserved); + (*env)->SetBooleanField(env, lpObject, FLICK_DATAFc.fOnInkingSurface, (jboolean)lpStruct->fOnInkingSurface); + (*env)->SetIntField(env, lpObject, FLICK_DATAFc.iActionArgument, (jint)lpStruct->iActionArgument); +} +#endif + +#ifndef NO_FLICK_POINT +typedef struct FLICK_POINT_FID_CACHE { + int cached; + jclass clazz; + jfieldID x, y; +} FLICK_POINT_FID_CACHE; + +FLICK_POINT_FID_CACHE FLICK_POINTFc; + +void cacheFLICK_POINTFields(JNIEnv *env, jobject lpObject) +{ + if (FLICK_POINTFc.cached) return; + FLICK_POINTFc.clazz = (*env)->GetObjectClass(env, lpObject); + FLICK_POINTFc.x = (*env)->GetFieldID(env, FLICK_POINTFc.clazz, "x", "I"); + FLICK_POINTFc.y = (*env)->GetFieldID(env, FLICK_POINTFc.clazz, "y", "I"); + FLICK_POINTFc.cached = 1; +} + +FLICK_POINT *getFLICK_POINTFields(JNIEnv *env, jobject lpObject, FLICK_POINT *lpStruct) +{ + if (!FLICK_POINTFc.cached) cacheFLICK_POINTFields(env, lpObject); + lpStruct->x = (*env)->GetIntField(env, lpObject, FLICK_POINTFc.x); + lpStruct->y = (*env)->GetIntField(env, lpObject, FLICK_POINTFc.y); + return lpStruct; +} + +void setFLICK_POINTFields(JNIEnv *env, jobject lpObject, FLICK_POINT *lpStruct) +{ + if (!FLICK_POINTFc.cached) cacheFLICK_POINTFields(env, lpObject); + (*env)->SetIntField(env, lpObject, FLICK_POINTFc.x, (jint)lpStruct->x); + (*env)->SetIntField(env, lpObject, FLICK_POINTFc.y, (jint)lpStruct->y); +} +#endif + #ifndef NO_GCP_RESULTS typedef struct GCP_RESULTS_FID_CACHE { int cached; @@ -1776,6 +1868,101 @@ } #endif +#ifndef NO_GESTURECONFIG +typedef struct GESTURECONFIG_FID_CACHE { + int cached; + jclass clazz; + jfieldID dwID, dwWant, dwBlock; +} GESTURECONFIG_FID_CACHE; + +GESTURECONFIG_FID_CACHE GESTURECONFIGFc; + +void cacheGESTURECONFIGFields(JNIEnv *env, jobject lpObject) +{ + if (GESTURECONFIGFc.cached) return; + GESTURECONFIGFc.clazz = (*env)->GetObjectClass(env, lpObject); + GESTURECONFIGFc.dwID = (*env)->GetFieldID(env, GESTURECONFIGFc.clazz, "dwID", "I"); + GESTURECONFIGFc.dwWant = (*env)->GetFieldID(env, GESTURECONFIGFc.clazz, "dwWant", "I"); + GESTURECONFIGFc.dwBlock = (*env)->GetFieldID(env, GESTURECONFIGFc.clazz, "dwBlock", "I"); + GESTURECONFIGFc.cached = 1; +} + +GESTURECONFIG *getGESTURECONFIGFields(JNIEnv *env, jobject lpObject, GESTURECONFIG *lpStruct) +{ + if (!GESTURECONFIGFc.cached) cacheGESTURECONFIGFields(env, lpObject); + lpStruct->dwID = (*env)->GetIntField(env, lpObject, GESTURECONFIGFc.dwID); + lpStruct->dwWant = (*env)->GetIntField(env, lpObject, GESTURECONFIGFc.dwWant); + lpStruct->dwBlock = (*env)->GetIntField(env, lpObject, GESTURECONFIGFc.dwBlock); + return lpStruct; +} + +void setGESTURECONFIGFields(JNIEnv *env, jobject lpObject, GESTURECONFIG *lpStruct) +{ + if (!GESTURECONFIGFc.cached) cacheGESTURECONFIGFields(env, lpObject); + (*env)->SetIntField(env, lpObject, GESTURECONFIGFc.dwID, (jint)lpStruct->dwID); + (*env)->SetIntField(env, lpObject, GESTURECONFIGFc.dwWant, (jint)lpStruct->dwWant); + (*env)->SetIntField(env, lpObject, GESTURECONFIGFc.dwBlock, (jint)lpStruct->dwBlock); +} +#endif + +#ifndef NO_GESTUREINFO +typedef struct GESTUREINFO_FID_CACHE { + int cached; + jclass clazz; + jfieldID cbSize, dwFlags, dwID, hwndTarget, x, y, dwInstanceID, dwSequenceID, ullArguments, cbExtraArgs; +} GESTUREINFO_FID_CACHE; + +GESTUREINFO_FID_CACHE GESTUREINFOFc; + +void cacheGESTUREINFOFields(JNIEnv *env, jobject lpObject) +{ + if (GESTUREINFOFc.cached) return; + GESTUREINFOFc.clazz = (*env)->GetObjectClass(env, lpObject); + GESTUREINFOFc.cbSize = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "cbSize", "I"); + GESTUREINFOFc.dwFlags = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "dwFlags", "I"); + GESTUREINFOFc.dwID = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "dwID", "I"); + GESTUREINFOFc.hwndTarget = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "hwndTarget", I_J); + GESTUREINFOFc.x = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "x", "S"); + GESTUREINFOFc.y = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "y", "S"); + GESTUREINFOFc.dwInstanceID = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "dwInstanceID", "I"); + GESTUREINFOFc.dwSequenceID = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "dwSequenceID", "I"); + GESTUREINFOFc.ullArguments = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "ullArguments", "J"); + GESTUREINFOFc.cbExtraArgs = (*env)->GetFieldID(env, GESTUREINFOFc.clazz, "cbExtraArgs", "I"); + GESTUREINFOFc.cached = 1; +} + +GESTUREINFO *getGESTUREINFOFields(JNIEnv *env, jobject lpObject, GESTUREINFO *lpStruct) +{ + if (!GESTUREINFOFc.cached) cacheGESTUREINFOFields(env, lpObject); + lpStruct->cbSize = (*env)->GetIntField(env, lpObject, GESTUREINFOFc.cbSize); + lpStruct->dwFlags = (*env)->GetIntField(env, lpObject, GESTUREINFOFc.dwFlags); + lpStruct->dwID = (*env)->GetIntField(env, lpObject, GESTUREINFOFc.dwID); + lpStruct->hwndTarget = (HWND)(*env)->GetIntLongField(env, lpObject, GESTUREINFOFc.hwndTarget); + lpStruct->ptsLocation.x = (*env)->GetShortField(env, lpObject, GESTUREINFOFc.x); + lpStruct->ptsLocation.y = (*env)->GetShortField(env, lpObject, GESTUREINFOFc.y); + lpStruct->dwInstanceID = (*env)->GetIntField(env, lpObject, GESTUREINFOFc.dwInstanceID); + lpStruct->dwSequenceID = (*env)->GetIntField(env, lpObject, GESTUREINFOFc.dwSequenceID); + lpStruct->ullArguments = (*env)->GetLongField(env, lpObject, GESTUREINFOFc.ullArguments); + lpStruct->cbExtraArgs = (*env)->GetIntField(env, lpObject, GESTUREINFOFc.cbExtraArgs); + return lpStruct; +} + +void setGESTUREINFOFields(JNIEnv *env, jobject lpObject, GESTUREINFO *lpStruct) +{ + if (!GESTUREINFOFc.cached) cacheGESTUREINFOFields(env, lpObject); + (*env)->SetIntField(env, lpObject, GESTUREINFOFc.cbSize, (jint)lpStruct->cbSize); + (*env)->SetIntField(env, lpObject, GESTUREINFOFc.dwFlags, (jint)lpStruct->dwFlags); + (*env)->SetIntField(env, lpObject, GESTUREINFOFc.dwID, (jint)lpStruct->dwID); + (*env)->SetIntLongField(env, lpObject, GESTUREINFOFc.hwndTarget, (jintLong)lpStruct->hwndTarget); + (*env)->SetShortField(env, lpObject, GESTUREINFOFc.x, (jshort)lpStruct->ptsLocation.x); + (*env)->SetShortField(env, lpObject, GESTUREINFOFc.y, (jshort)lpStruct->ptsLocation.y); + (*env)->SetIntField(env, lpObject, GESTUREINFOFc.dwInstanceID, (jint)lpStruct->dwInstanceID); + (*env)->SetIntField(env, lpObject, GESTUREINFOFc.dwSequenceID, (jint)lpStruct->dwSequenceID); + (*env)->SetLongField(env, lpObject, GESTUREINFOFc.ullArguments, (jlong)lpStruct->ullArguments); + (*env)->SetIntField(env, lpObject, GESTUREINFOFc.cbExtraArgs, (jint)lpStruct->cbExtraArgs); +} +#endif + #ifndef NO_GRADIENT_RECT typedef struct GRADIENT_RECT_FID_CACHE { int cached; @@ -8282,6 +8469,64 @@ } #endif +#ifndef NO_TOUCHINPUT +typedef struct TOUCHINPUT_FID_CACHE { + int cached; + jclass clazz; + jfieldID x, y, hSource, dwID, dwFlags, dwMask, dwTime, dwExtraInfo, cxContact, cyContact; +} TOUCHINPUT_FID_CACHE; + +TOUCHINPUT_FID_CACHE TOUCHINPUTFc; + +void cacheTOUCHINPUTFields(JNIEnv *env, jobject lpObject) +{ + if (TOUCHINPUTFc.cached) return; + TOUCHINPUTFc.clazz = (*env)->GetObjectClass(env, lpObject); + TOUCHINPUTFc.x = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "x", I_J); + TOUCHINPUTFc.y = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "y", I_J); + TOUCHINPUTFc.hSource = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "hSource", I_J); + TOUCHINPUTFc.dwID = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "dwID", "I"); + TOUCHINPUTFc.dwFlags = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "dwFlags", "I"); + TOUCHINPUTFc.dwMask = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "dwMask", "I"); + TOUCHINPUTFc.dwTime = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "dwTime", "I"); + TOUCHINPUTFc.dwExtraInfo = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "dwExtraInfo", I_J); + TOUCHINPUTFc.cxContact = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "cxContact", "I"); + TOUCHINPUTFc.cyContact = (*env)->GetFieldID(env, TOUCHINPUTFc.clazz, "cyContact", "I"); + TOUCHINPUTFc.cached = 1; +} + +TOUCHINPUT *getTOUCHINPUTFields(JNIEnv *env, jobject lpObject, TOUCHINPUT *lpStruct) +{ + if (!TOUCHINPUTFc.cached) cacheTOUCHINPUTFields(env, lpObject); + lpStruct->x = (*env)->GetIntLongField(env, lpObject, TOUCHINPUTFc.x); + lpStruct->y = (*env)->GetIntLongField(env, lpObject, TOUCHINPUTFc.y); + lpStruct->hSource = (HWND)(*env)->GetIntLongField(env, lpObject, TOUCHINPUTFc.hSource); + lpStruct->dwID = (*env)->GetIntField(env, lpObject, TOUCHINPUTFc.dwID); + lpStruct->dwFlags = (*env)->GetIntField(env, lpObject, TOUCHINPUTFc.dwFlags); + lpStruct->dwMask = (*env)->GetIntField(env, lpObject, TOUCHINPUTFc.dwMask); + lpStruct->dwTime = (*env)->GetIntField(env, lpObject, TOUCHINPUTFc.dwTime); + lpStruct->dwExtraInfo = (*env)->GetIntLongField(env, lpObject, TOUCHINPUTFc.dwExtraInfo); + lpStruct->cxContact = (*env)->GetIntField(env, lpObject, TOUCHINPUTFc.cxContact); + lpStruct->cyContact = (*env)->GetIntField(env, lpObject, TOUCHINPUTFc.cyContact); + return lpStruct; +} + +void setTOUCHINPUTFields(JNIEnv *env, jobject lpObject, TOUCHINPUT *lpStruct) +{ + if (!TOUCHINPUTFc.cached) cacheTOUCHINPUTFields(env, lpObject); + (*env)->SetIntLongField(env, lpObject, TOUCHINPUTFc.x, (jintLong)lpStruct->x); + (*env)->SetIntLongField(env, lpObject, TOUCHINPUTFc.y, (jintLong)lpStruct->y); + (*env)->SetIntLongField(env, lpObject, TOUCHINPUTFc.hSource, (jintLong)lpStruct->hSource); + (*env)->SetIntField(env, lpObject, TOUCHINPUTFc.dwID, (jint)lpStruct->dwID); + (*env)->SetIntField(env, lpObject, TOUCHINPUTFc.dwFlags, (jint)lpStruct->dwFlags); + (*env)->SetIntField(env, lpObject, TOUCHINPUTFc.dwMask, (jint)lpStruct->dwMask); + (*env)->SetIntField(env, lpObject, TOUCHINPUTFc.dwTime, (jint)lpStruct->dwTime); + (*env)->SetIntLongField(env, lpObject, TOUCHINPUTFc.dwExtraInfo, (jintLong)lpStruct->dwExtraInfo); + (*env)->SetIntField(env, lpObject, TOUCHINPUTFc.cxContact, (jint)lpStruct->cxContact); + (*env)->SetIntField(env, lpObject, TOUCHINPUTFc.cyContact, (jint)lpStruct->cyContact); +} +#endif + #ifndef NO_TRACKMOUSEEVENT typedef struct TRACKMOUSEEVENT_FID_CACHE { int cached; Index: Eclipse SWT PI/win32/library/os_structs.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h,v retrieving revision 1.66 diff -u -r1.66 os_structs.h --- Eclipse SWT PI/win32/library/os_structs.h 25 Feb 2010 20:37:16 -0000 1.66 +++ Eclipse SWT PI/win32/library/os_structs.h 13 Dec 2010 23:59:18 -0000 @@ -359,6 +359,30 @@ #define FILETIME_sizeof() 0 #endif +#ifndef NO_FLICK_DATA +void cacheFLICK_DATAFields(JNIEnv *env, jobject lpObject); +FLICK_DATA *getFLICK_DATAFields(JNIEnv *env, jobject lpObject, FLICK_DATA *lpStruct); +void setFLICK_DATAFields(JNIEnv *env, jobject lpObject, FLICK_DATA *lpStruct); +#define FLICK_DATA_sizeof() sizeof(FLICK_DATA) +#else +#define cacheFLICK_DATAFields(a,b) +#define getFLICK_DATAFields(a,b,c) NULL +#define setFLICK_DATAFields(a,b,c) +#define FLICK_DATA_sizeof() 0 +#endif + +#ifndef NO_FLICK_POINT +void cacheFLICK_POINTFields(JNIEnv *env, jobject lpObject); +FLICK_POINT *getFLICK_POINTFields(JNIEnv *env, jobject lpObject, FLICK_POINT *lpStruct); +void setFLICK_POINTFields(JNIEnv *env, jobject lpObject, FLICK_POINT *lpStruct); +#define FLICK_POINT_sizeof() sizeof(FLICK_POINT) +#else +#define cacheFLICK_POINTFields(a,b) +#define getFLICK_POINTFields(a,b,c) NULL +#define setFLICK_POINTFields(a,b,c) +#define FLICK_POINT_sizeof() 0 +#endif + #ifndef NO_GCP_RESULTS void cacheGCP_RESULTSFields(JNIEnv *env, jobject lpObject); GCP_RESULTS *getGCP_RESULTSFields(JNIEnv *env, jobject lpObject, GCP_RESULTS *lpStruct); @@ -371,6 +395,30 @@ #define GCP_RESULTS_sizeof() 0 #endif +#ifndef NO_GESTURECONFIG +void cacheGESTURECONFIGFields(JNIEnv *env, jobject lpObject); +GESTURECONFIG *getGESTURECONFIGFields(JNIEnv *env, jobject lpObject, GESTURECONFIG *lpStruct); +void setGESTURECONFIGFields(JNIEnv *env, jobject lpObject, GESTURECONFIG *lpStruct); +#define GESTURECONFIG_sizeof() sizeof(GESTURECONFIG) +#else +#define cacheGESTURECONFIGFields(a,b) +#define getGESTURECONFIGFields(a,b,c) NULL +#define setGESTURECONFIGFields(a,b,c) +#define GESTURECONFIG_sizeof() 0 +#endif + +#ifndef NO_GESTUREINFO +void cacheGESTUREINFOFields(JNIEnv *env, jobject lpObject); +GESTUREINFO *getGESTUREINFOFields(JNIEnv *env, jobject lpObject, GESTUREINFO *lpStruct); +void setGESTUREINFOFields(JNIEnv *env, jobject lpObject, GESTUREINFO *lpStruct); +#define GESTUREINFO_sizeof() sizeof(GESTUREINFO) +#else +#define cacheGESTUREINFOFields(a,b) +#define getGESTUREINFOFields(a,b,c) NULL +#define setGESTUREINFOFields(a,b,c) +#define GESTUREINFO_sizeof() 0 +#endif + #ifndef NO_GRADIENT_RECT void cacheGRADIENT_RECTFields(JNIEnv *env, jobject lpObject); GRADIENT_RECT *getGRADIENT_RECTFields(JNIEnv *env, jobject lpObject, GRADIENT_RECT *lpStruct); @@ -1727,6 +1775,18 @@ #define TOOLINFO_sizeof() 0 #endif +#ifndef NO_TOUCHINPUT +void cacheTOUCHINPUTFields(JNIEnv *env, jobject lpObject); +TOUCHINPUT *getTOUCHINPUTFields(JNIEnv *env, jobject lpObject, TOUCHINPUT *lpStruct); +void setTOUCHINPUTFields(JNIEnv *env, jobject lpObject, TOUCHINPUT *lpStruct); +#define TOUCHINPUT_sizeof() sizeof(TOUCHINPUT) +#else +#define cacheTOUCHINPUTFields(a,b) +#define getTOUCHINPUTFields(a,b,c) NULL +#define setTOUCHINPUTFields(a,b,c) +#define TOUCHINPUT_sizeof() 0 +#endif + #ifndef NO_TRACKMOUSEEVENT void cacheTRACKMOUSEEVENTFields(JNIEnv *env, jobject lpObject); TRACKMOUSEEVENT *getTRACKMOUSEEVENTFields(JNIEnv *env, jobject lpObject, TRACKMOUSEEVENT *lpStruct); Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java =================================================================== RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,16 @@ +package org.eclipse.swt.internal.win32; + +public class FLICK_DATA { + public int iFlickActionCommandCode; + /* @field iFlickDirection cast = (unsigned int) */ + public int iFlickDirection; + public boolean fControlModifier; + public boolean fMenuModifier; + public boolean fAltGRModifier; + public boolean fWinModifier; + public boolean fShiftModifier; + public int iReserved; + public boolean fOnInkingSurface; + public int iActionArgument; + public static final int sizeof = OS.FLICK_DATA_sizeof(); +} Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java =================================================================== RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,7 @@ +package org.eclipse.swt.internal.win32; + +public class FLICK_POINT { + public int x; + public int y; + public static final int sizeof = OS.FLICK_POINT_sizeof(); +} Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java =================================================================== RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,8 @@ +package org.eclipse.swt.internal.win32; + +public class GESTURECONFIG { + public int dwID; // gesture ID + public int dwWant; // settings related to gesture ID that are to be turned on + public int dwBlock; // settings related to gesture ID that are to be turned off + public static final int sizeof = OS.GESTURECONFIG_sizeof (); +} Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java =================================================================== RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,19 @@ +package org.eclipse.swt.internal.win32; + +public class GESTUREINFO { + public int cbSize; + public int dwFlags; + public int dwID; + /** @field cast=(HWND) */ + public int /*long*/ hwndTarget; + // POINTS ptsLocation + /** @field accessor=ptsLocation.x */ + public short x; + /** @field accessor=ptsLocation.y */ + public short y; + public int dwInstanceID; + public int dwSequenceID; + public long ullArguments; + public int cbExtraArgs; + public static final int sizeof = OS.GESTUREINFO_sizeof (); +} Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java,v retrieving revision 1.445 diff -u -r1.445 OS.java --- Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java 6 Dec 2010 20:21:34 -0000 1.445 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java 13 Dec 2010 23:59:23 -0000 @@ -679,6 +679,15 @@ public static final int FILE_ATTRIBUTE_DIRECTORY = 0x00000010; public static final int FILE_ATTRIBUTE_NORMAL = 0x00000080; public static final int FILE_MAP_READ = 4; + public static final int FLICKDIRECTION_RIGHT = 0; + public static final int FLICKDIRECTION_UPRIGHT = 1; + public static final int FLICKDIRECTION_UP = 2; + public static final int FLICKDIRECTION_UPLEFT = 3; + public static final int FLICKDIRECTION_LEFT = 4; + public static final int FLICKDIRECTION_DOWNLEFT = 5; + public static final int FLICKDIRECTION_DOWN = 6; + public static final int FLICKDIRECTION_DOWNRIGHT = 7; + public static final int FLICKDIRECTION_INVALID = 8; public static final int FNERR_INVALIDFILENAME = 0x3002; public static final int FNERR_BUFFERTOOSMALL = 0x3003; public static final int FOF_SILENT = 0x0004; @@ -705,7 +714,17 @@ public static final int GCS_CURSORPOS = 0x0080; public static final int GDT_VALID = 0; public static final int GET_FEATURE_FROM_PROCESS = 0x2; + public static final int GF_BEGIN = 1; + public static final int GF_INERTIA = 2; + public static final int GF_END = 4; public static final int GGI_MARK_NONEXISTING_GLYPHS = 1; + public static final int GID_BEGIN = 1; + public static final int GID_END = 2; + public static final int GID_ZOOM = 3; + public static final int GID_PAN = 4; + public static final int GID_ROTATE = 5; + public static final int GID_TWOFINGERTAP = 6; + public static final int GID_PRESSANDTAP = 7; public static final int GLPS_CLOSED = 1; public static final int GLPS_OPENED = 2; public static final int GM_ADVANCED = 2; @@ -1204,6 +1223,8 @@ public static final int MWMO_INPUTAVAILABLE = 0x4; public static final int MWT_LEFTMULTIPLY = 2; public static final int NI_COMPOSITIONSTR = 0x15; + public static final int NID_READY = 0x80; + public static final int NID_MULTI_INPUT = 0x40; public static final int NIF_ICON = 0x00000002; public static final int NIF_INFO = 0x00000010; public static final int NIF_MESSAGE = 0x00000001; @@ -1518,6 +1539,8 @@ public static final int SM_CMOUSEBUTTONS = 43; public static final int SM_CYSCREEN = 0x1; public static final int SM_CYVSCROLL = 0x14; + public static final int SM_DIGITIZER = 94; + public static final int SM_MAXIMUMTOUCHES= 95; // public static final int SM_DBCSENABLED = 0x2A; // public static final int SM_IMMENABLED = 0x52; public static final int SPI_GETFONTSMOOTHINGTYPE = 0x200A; @@ -1738,6 +1761,13 @@ public static final int TME_QUERY = 0x40000000; public static final int TMPF_VECTOR = 0x2; public static final int TMT_CONTENTMARGINS = 3602; + public static final int TOUCHEVENTF_MOVE = 0x0001; + public static final int TOUCHEVENTF_DOWN = 0x0002; + public static final int TOUCHEVENTF_UP = 0x0004; + public static final int TOUCHEVENTF_INRANGE = 0x0008; + public static final int TOUCHEVENTF_PRIMARY = 0x0010; + public static final int TOUCHEVENTF_NOCOALESCE = 0x0020; + public static final int TOUCHEVENTF_PALM = 0x0080; public static final String TOOLBARCLASSNAME = "ToolbarWindow32"; //$NON-NLS-1$ public static final String TOOLTIPS_CLASS = "tooltips_class32"; //$NON-NLS-1$ public static final int TP_BUTTON = 1; @@ -2066,6 +2096,7 @@ public static final int WM_ENDSESSION = 0x16; public static final int WM_ENTERIDLE = 0x121; public static final int WM_ERASEBKGND = 0x14; + public static final int WM_GESTURE = 0x0119; public static final int WM_GETDLGCODE = 0x87; public static final int WM_GETFONT = 0x31; // public static final int WM_GETICON = 0x7f; @@ -2138,8 +2169,10 @@ public static final int WM_SYSCOMMAND = 0x112; public static final int WM_SYSKEYDOWN = 0x104; public static final int WM_SYSKEYUP = 0x105; + public static final int WM_TABLET_FLICK = 0x02C0 + 11; public static final int WM_TIMER = 0x113; public static final int WM_THEMECHANGED = 0x031a; + public static final int WM_TOUCH = 0x240; public static final int WM_UNDO = 0x304; public static final int WM_UPDATEUISTATE = 0x0128; public static final int WM_USER = 0x400; @@ -2219,7 +2252,11 @@ public static final native int EXTLOGFONTW_sizeof (); public static final native int EXTLOGPEN_sizeof (); public static final native int FILETIME_sizeof (); +public static final native int FLICK_DATA_sizeof (); +public static final native int FLICK_POINT_sizeof (); public static final native int GCP_RESULTS_sizeof (); +public static final native int GESTURECONFIG_sizeof (); +public static final native int GESTUREINFO_sizeof (); public static final native int GRADIENT_RECT_sizeof (); public static final native int GUITHREADINFO_sizeof (); public static final native int HDITEM_sizeof (); @@ -2328,6 +2365,7 @@ public static final native int TF_DA_COLOR_sizeof (); public static final native int TF_DISPLAYATTRIBUTE_sizeof (); public static final native int TOOLINFO_sizeof (); +public static final native int TOUCHINPUT_sizeof(); public static final native int TRACKMOUSEEVENT_sizeof (); public static final native int TRIVERTEX_sizeof (); public static final native int TVHITTESTINFO_sizeof (); @@ -3522,6 +3560,11 @@ public static final native boolean CloseClipboard (); /** @param hdc cast=(HDC) */ public static final native int /*long*/ CloseEnhMetaFile (int /*long*/ hdc); +/** + * @method flags=dynamic + * @param hGesture cast=(HGESTUREINFO) + */ +public static final native int /*long*/ CloseGestureInfoHandle (int /*long*/ hGesture); /** @param hObject cast=(HANDLE) */ public static final native boolean CloseHandle (int /*long*/ hObject); /** @@ -3530,6 +3573,11 @@ */ public static final native int CloseThemeData (int /*long*/ hTheme); /** + * @method flags=dynamic + * @param hTouchInput cast=(HTOUCHINPUT) + */ +public static final native boolean CloseTouchInputHandle(int /*long*/ hTouchInput); +/** * @param rclsid cast=(REFCLSID) * @param pUnkOuter cast=(LPUNKNOWN) * @param riid cast=(REFIID) @@ -4163,6 +4211,12 @@ /** @param hdc cast=(HDC) */ public static final native int GetFontLanguageInfo (int /*long*/ hdc); public static final native int /*long*/ GetForegroundWindow (); +/** + * @method flags=dynamic + * @param hGestureInfo cast=(HGESTUREINFO) + * @param pGestureInfo cast=(PGESTUREINFO) + */ +public static final native boolean GetGestureInfo(int /*long*/ hGestureInfo, GESTUREINFO pGestureInfo); /** @param hdc cast=(HDC) */ public static final native int GetGraphicsMode (int /*long*/ hdc); /** @@ -4513,6 +4567,13 @@ */ public static final native int GetTimeFormatA(int Locale, int dwFlags, SYSTEMTIME lpTime, byte [] lpFormat, byte [] lpTimeStr, int cchTime); /** + * @method flags=dynamic + * @param hTouchInput cast=(HTOUCHINPUT) + * @param cInputs cast=(UINT) + * @param pTouchInputs cast=(PTOUCHINPUT) + */ +public static final native boolean GetTouchInputInfo(int /*long*/ hTouchInput, int cInputs, int /*long*/ pTouchInputs, int cbSize); +/** * @param hWnd cast=(HWND) * @param lpRect cast=(LPRECT) * @param bErase cast=(BOOL) @@ -4581,6 +4642,7 @@ * @param lpXform cast=(LPXFORM) */ public static final native boolean GetWorldTransform (int /*long*/ hdc, float[] lpXform); +public static final native double GID_ROTATE_ANGLE_FROM_ARGUMENT(long dwArgument); /** @param lpString cast=(LPCWSTR) */ public static final native int GlobalAddAtomW (char [] lpString); /** @param lpString cast=(LPCTSTR) */ @@ -4922,6 +4984,7 @@ public static final native int /*long*/ LocalFree (int /*long*/ hMem); /** @param hWndLock cast=(HWND) */ public static final native boolean LockWindowUpdate (int /*long*/ hWndLock); +public static final native int LODWORD (long l); public static final native int LOWORD (int /*long*/ l); /** @param hdc cast=(HDC) */ public static final native boolean LPtoDP (int /*long*/ hdc, POINT lpPoints, int nCount); @@ -5152,6 +5215,16 @@ public static final native void MoveMemory (EXTLOGPEN Destination, int /*long*/ Source, int Length); /** * @param Destination cast=(PVOID),flags=no_in + * @param Source cast=(CONST VOID *),flags=no_out + */ +public static final native void MoveMemory (FLICK_DATA Destination, int /*long*/ [] Source, int Length); +/** + * @param Destination cast=(PVOID),flags=no_in + * @param Source cast=(CONST VOID *),flags=no_out + */ +public static final native void MoveMemory (FLICK_POINT Destination, int /*long*/ [] Source, int Length); +/** + * @param Destination cast=(PVOID),flags=no_in * @param Source cast=(CONST VOID *) */ public static final native void MoveMemory (HDITEM Destination, int /*long*/ Source, int Length); @@ -5370,6 +5443,11 @@ * @param Destination cast=(PVOID),flags=no_in * @param Source cast=(CONST VOID *) */ +public static final native void MoveMemory (TOUCHINPUT Destination, int /*long*/ Source, int Length); +/** + * @param Destination cast=(PVOID),flags=no_in + * @param Source cast=(CONST VOID *) + */ public static final native void MoveMemory (TVITEM Destination, int /*long*/ Source, int Length); /** * @param Destination cast=(PVOID),flags=no_in @@ -5437,6 +5515,11 @@ */ public static final native void MoveMemory (int /*long*/ Destination, MOUSEINPUT Source, int Length); /** + * @param Destination cast=(PVOID) + * @param Source cast=(CONST VOID *),flags=no_out + */ +public static final native void MoveMemory (int /*long*/ Destination, GESTURECONFIG Source, int Length); +/** * @param hdc cast=(HDC) * @param lPoint cast=(LPPOINT) */ @@ -5581,6 +5664,12 @@ /** @param lpWndClass cast=(LPWNDCLASSW) */ public static final native int RegisterClassW (WNDCLASS lpWndClass); public static final native int RegisterClassA (WNDCLASS lpWndClass); +/** + * @method flags=dynamic + * @param hWnd cast=(HWND) + * @param ulFlags cast=(ULONG) + */ +public static final native boolean RegisterTouchWindow(int /*long*/ hWnd, int ulFlags); /** @param lpString cast=(LPWSTR) */ public static final native int RegisterWindowMessageW (char [] lpString); /** @param lpString cast=(LPTSTR) */ @@ -6291,6 +6380,12 @@ public static final native int /*long*/ SetFocus (int /*long*/ hWnd); /** @param hWnd cast=(HWND) */ public static final native boolean SetForegroundWindow (int /*long*/ hWnd); +/** + * @method flags=dynamic + * @param hwnd cast=(HWND) + * @param pGestureConfig cast=(PGESTURECONFIG) + */ +public static final native boolean SetGestureConfig(int /*long*/ hwnd, int dwReserved, int cIDs, int /*long*/ pGestureConfig, int cbSize); /** @param hdc cast=(HDC) */ public static final native int SetGraphicsMode (int /*long*/ hdc, int iMode); /** @@ -6551,6 +6646,7 @@ * @param pwszBuff cast=(LPWSTR) */ public static final native int ToUnicode (int wVirtKey, int wScanCode, byte [] lpKeyState, char [] pwszBuff, int cchBuff, int wFlags); +public static final native long TOUCH_COORD_TO_PIXEL(long touchCoord); /** * @param hwndTV cast=(HWND) * @param hitem cast=(HTREEITEM) @@ -6611,6 +6707,11 @@ * @param crKey cast=(COLORREF) */ public static final native boolean UpdateLayeredWindow (int /*long*/ hwnd, int /*long*/ hdcDst, POINT pptDst, SIZE psize, int /*long*/ hdcSrc, POINT pptSrc, int crKey, BLENDFUNCTION pblend, int dwFlags); +/** + * @method flags=dynamic + * @param hWnd cast=(HWND) + */ +public static final native boolean UnregisterTouchWindow (int /*long*/ hwnd); /** @param hWnd cast=(HWND) */ public static final native boolean UpdateWindow (int /*long*/ hWnd); /** @param hWnd cast=(HWND) */ Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java =================================================================== RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.win32; + +public class TOUCHINPUT { + public int /*long*/ x; + public int /*long*/ y; + /** @field cast=(HWND) */ + public int /*long*/ hSource; + public int dwID; + public int dwFlags; + public int dwMask; + public int dwTime; + public int /*long*/ dwExtraInfo; + public int cxContact; + public int cyContact; + public static final int sizeof = OS.TOUCHINPUT_sizeof(); +} Index: Eclipse SWT/common/org/eclipse/swt/SWT.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java,v retrieving revision 1.200 diff -u -r1.200 SWT.java --- Eclipse SWT/common/org/eclipse/swt/SWT.java 13 Oct 2010 18:07:22 -0000 1.200 +++ Eclipse SWT/common/org/eclipse/swt/SWT.java 13 Dec 2010 23:59:25 -0000 @@ -715,6 +715,69 @@ */ public static final int OpenDocument = 46; + /** + * The touch event type (value is 46). + * + *

+ * This event is sent when SWT receives notification that a document + * should be opened. + *

+ * + * @see org.eclipse.swt.widgets.Display#addListener + * @see org.eclipse.swt.widgets.Event + * + * @since 3.7 + */ + //public static final int Touch = 47; + + /** + * The begin gesture event type (value is 51). + * + *

+ * This event is sent when SWT receives notification + * that a continuous gesture is about to begin. + *

+ * + * @see org.eclipse.swt.widgets.Display#addListener + * @see org.eclipse.swt.widgets.Event + * + * @since 3.7 + */ + public static final int BeginGesture = 51; + + /** + * The gesture event type (value is 52). + * + *

+ * This event is sent when a gesture has been performed. + *

+ * + * @see org.eclipse.swt.widgets.Display#addListener + * @see org.eclipse.swt.widgets.Event + * @see org.eclipse.swt.widgets.SWT#GESTURE_MAGNIFY + * @see org.eclipse.swt.widgets.SWT#GESTURE_PAN + * @see org.eclipse.swt.widgets.SWT#GESTURE_ROTATE + * @see org.eclipse.swt.widgets.SWT#GESTURE_SWIPE + * + * @since 3.7 + */ + public static final int Gesture = 52; + + /** + * The end gesture event type (value is 53). + * + *

+ * This event is sent when SWT receives notification that a document + * should be opened. + *

+ * + * @see org.eclipse.swt.widgets.Display#addListener + * @see org.eclipse.swt.widgets.Event + * + * @since 3.7 + */ + public static final int EndGesture = 53; + /* Event Details */ /** @@ -897,6 +960,51 @@ * (value is 1<<9). */ public static final int TRAVERSE_PAGE_NEXT = 1 << 9; + + /** + * Gesture event detail field value indicating that + * no additional information is available about the gesture. + * This will happen on a GestureBegin or GestureEnd event. + * + * @since 3.7 + */ + public static final int GESTURE_NONE = 0; + + /** + * Gesture event detail field value indicating that a + * rotation gesture has happened. Only the rotation field + * of the event is valid. + * + * @since 3.7 + */ + public static final int GESTURE_ROTATE = 1 << 1; + + /** + * Gesture event detail field value indicating that a + * swipe gesture has happened. Only the xDirection + * and yDirection fields of the event are valid. + * + * @since 3.7 + */ + public static final int GESTURE_SWIPE = 1 << 2; + + /** + * Gesture event detail field value indicating that a + * magnification gesture has happened. Only the magnification + * field of the event is valid. + * + * @since 3.7 + */ + public static final int GESTURE_MAGNIFY = 1 << 3; + + /** + * Gesture event detail field value indicating that a + * panning (two-finger scroll) gesture has happened. Only the + * xDirection and yDirection fields of the event are valid. + * + * @since 3.7 + */ + public static final int GESTURE_PAN = 1 << 4; /** * A constant indicating that widgets have changed. Index: Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java =================================================================== RCS file: Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java diff -N Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.events; + + +/** + * This adapter class provides default implementations for the + * methods described by the GestureListener interface. + *

+ * Classes that wish to deal with GestureEvents can + * extend this class and override only the methods which they are + * interested in. + *

+ * + * @see GestureListener + * @see GestureEvent + * @see Sample code and further information + * @since 3.7 + */ +public abstract class GestureAdapter implements GestureListener { + +/** + * Sent when a gesture is first recognized by the operating system. + * + * @param e an event containing information about the gesture + */ + public void gestureBegan(GestureEvent e) {} + +/** + * Sent when a recognized gesture has occurred. + * + * @param e an event containing information about the gesture. + */ + public void gesturePerformed(GestureEvent e) {} + +/** + * Sent when a recognized gesture ends. + * + * @param e an event containing information about the gesture. + */ + public void gestureEnded(GestureEvent e) {} + +} Index: Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java =================================================================== RCS file: Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java diff -N Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,137 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.events; + + +import org.eclipse.swt.widgets.*; + +/** + * Instances of this class are sent as a result of + * a touch-based gesture being generated by the user. + *

+ *

+ * + * @see GestureListener + * @see Sample code and further information + */ + +public class GestureEvent extends TypedEvent { + + /** + * the state of the keyboard modifier keys and mouse masks + * at the time the event was generated. + * + * @see org.eclipse.swt.SWT#MODIFIER_MASK + * @see org.eclipse.swt.SWT#BUTTON_MASK + */ + public int stateMask; + + /** + * The gesture type. + *

+ * + * The value of the detail field determines which fields of the + * GestureEvent contain valid data. + */ + public int detail; + + /** + * the widget-relative, x coordinate of the pointer + * at the time the gesture occurred + * + * This field is valid for all detail types. + */ + public int x; + + /** + * the widget-relative, y coordinate of the pointer + * at the time the occurred occurred + * + * This field is valid for all detail types. + */ + public int y; + + /** + * Number of degrees rotated on the track pad. + * + * This field is valid when the detail field is set to GESTURE_ROTATE. + */ + public double rotation; + + /** + * If non-zero, a positive value indicates a swipe to the right, + * and a negative value indicates a swipe to the left. + * + * This field is valid when the detail field is set to GESTURE_SWIPE. + */ + public int xDirection; + + /** + * If non-zero, a positive value indicates a swipe up, + * and a negative value indicates a swipe down. + * + * This field is valid when the detail field is set to GESTURE_SWIPE. + */ + public int yDirection; + + /** + * Change in magnification. This value should be added to the current + * scaling of an item to get the new scale factor. + * + * This field is valid when the detail field is set to GESTURE_MAGNIFY. + */ + public double magnification; + + static final long serialVersionUID = -8348741538373572182L; + +/** + * Constructs a new instance of this class based on the + * information in the given untyped event. + * + * @param e the untyped event containing the information + */ +public GestureEvent(Event e) { + super(e); + this.stateMask = e.stateMask; + this.x = e.x; + this.y = e.y; + this.detail = e.detail; + this.rotation = e.rotation; + this.xDirection = e.xDirection; + this.yDirection = e.yDirection; + this.magnification = e.magnification; +} + +/** + * Returns a string containing a concise, human-readable + * description of the receiver. + * + * @return a string representation of the event + */ +public String toString() { + String string = super.toString (); + return string.substring (0, string.length() - 1) // remove trailing '}' + + " stateMask=" + stateMask + + " detail=" + detail + + " x=" + x + + " y=" + y + + " rotation=" + rotation + + " xDirection=" + xDirection + + " yDirection=" + yDirection + + " magnification=" + magnification + + "}"; +} +} Index: Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java =================================================================== RCS file: Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java diff -N Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.events; + + +import org.eclipse.swt.internal.*; + +/** + * Classes which implement this interface provide methods + * that deal with the events that are generated as gestures + * are triggered when the user interacts with a touch pad or + * touch screen. + *

+ * After creating an instance of a class that implements + * this interface it can be added to a control using the + * addGestureListener method and removed using + * the removeGestureListener method. When a + * gesture is invoked, the appropriate method will be invoked. + *

+ * + * @see TouchAdapter + * @see TouchEvent + * @since 3.7 + */ +public interface GestureListener extends SWTEventListener { + +/** + * Sent when a gesture is first recognized by the operating system. + * + * @param e an event containing information about the gesture + */ +public void gestureBegan(GestureEvent e); + +/** + * Sent when a recognized gesture has occurred. + * + * @param e an event containing information about the gesture. + * See the constants for GESTURE_ in SWT. + */ +public void gesturePerformed(GestureEvent e); + +/** + * Sent when a recognized gesture ends. + * + * @param e an event containing information about the gesture. + */ +public void gestureEnded(GestureEvent e); + +} Index: Eclipse SWT/common/org/eclipse/swt/widgets/Event.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Event.java,v retrieving revision 1.39 diff -u -r1.39 Event.java --- Eclipse SWT/common/org/eclipse/swt/widgets/Event.java 31 May 2010 16:44:09 -0000 1.39 +++ Eclipse SWT/common/org/eclipse/swt/widgets/Event.java 13 Dec 2010 23:59:26 -0000 @@ -11,6 +11,7 @@ package org.eclipse.swt.widgets; +import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; /** @@ -215,6 +216,40 @@ */ public Object data; + /** + * An array of the touch states for the current touch event. + * @since 3.7 + */ + public TouchState[] touches; + + /** + * If nonzero, a positive value indicates a swipe to the right, + * and a negative value indicates a swipe to the left. + * @since 3.7 + */ + public int xDirection; + + /** + * If nonzero, a positive value indicates a swipe in the up direction, + * and a negative value indicates a swipe in the down direction. + * @since 3.7 + */ + public int yDirection; + + /** + * Change in magnification. This value should be added to the current + * scaling of an item to get the new scale factor. + * @since 3.7 + */ + public double magnification; + + /** + * Number of degrees rotated on the track pad. + * @since 3.7 + */ + public double rotation; + + /** * Gets the bounds. * Index: Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java,v retrieving revision 1.25 diff -u -r1.25 TypedListener.java --- Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java 31 May 2010 16:44:09 -0000 1.25 +++ Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java 13 Dec 2010 23:59:26 -0000 @@ -249,6 +249,18 @@ e.doit = event.doit; break; } + case SWT.BeginGesture: { + ((GestureListener)eventListener).gestureBegan(new GestureEvent(e)); + break; + } + case SWT.Gesture: { + ((GestureListener)eventListener).gesturePerformed(new GestureEvent(e)); + break; + } + case SWT.EndGesture: { + ((GestureListener)eventListener).gestureEnded(new GestureEvent(e)); + break; + } case SWT.Verify: { /* Fields set by Text, RichText */ VerifyEvent event = new VerifyEvent (e); Index: Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java,v retrieving revision 1.383 diff -u -r1.383 Control.java --- Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java 21 Oct 2010 15:03:16 -0000 1.383 +++ Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java 13 Dec 2010 23:59:28 -0000 @@ -10,13 +10,12 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - -import org.eclipse.swt.internal.gdip.*; -import org.eclipse.swt.internal.win32.*; -import org.eclipse.swt.graphics.*; import org.eclipse.swt.*; -import org.eclipse.swt.events.*; import org.eclipse.swt.accessibility.*; +import org.eclipse.swt.events.*; +import org.eclipse.swt.graphics.*; +import org.eclipse.swt.internal.gdip.*; +import org.eclipse.swt.internal.win32.*; /** * Control is the abstract superclass of all windowed user interface classes. @@ -44,6 +43,8 @@ */ public abstract class Control extends Widget implements Drawable { + static final int GESTURE_COUNT = 5; + /** * the handle to the OS resource * (Warning: This field is platform dependent) @@ -211,6 +212,34 @@ * @see HelpListener * @see #removeHelpListener */ +public void addGestureListener (GestureListener listener) { + checkWidget(); + if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); + TypedListener typedListener = new TypedListener (listener); + addListener (SWT.BeginGesture, typedListener); + addListener (SWT.Gesture, typedListener); + addListener (SWT.EndGesture, typedListener); +} + +/** + * Adds the listener to the collection of listeners who will + * be notified when help events are generated for the control, + * by sending it one of the messages defined in the + * HelpListener interface. + * + * @param listener the listener which should be notified + * + * @exception IllegalArgumentException + * @exception SWTException + * + * @see HelpListener + * @see #removeHelpListener + */ public void addHelpListener (HelpListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); @@ -640,6 +669,23 @@ OS.ImmAssociateContext (handle, hIMC); OS.ImmReleaseContext (hwndParent, hIMC); } + + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 1)) { + int /*long*/ pConfigs = OS.malloc(GESTURE_COUNT * GESTURECONFIG.sizeof); + + if (pConfigs != 0) { + GESTURECONFIG config = new GESTURECONFIG(); + for (int i = 0; i < GESTURE_COUNT; i++) { + config.dwID = i + OS.GID_ZOOM; + config.dwWant = 1; + config.dwBlock = 0; + OS.MoveMemory(pConfigs + i * GESTURECONFIG.sizeof, config, GESTURECONFIG.sizeof); + } + + OS.SetGestureConfig(handle, 0, GESTURE_COUNT, pConfigs, GESTURECONFIG.sizeof); + OS.free(pConfigs); + } + } } void createWidget () { @@ -2377,6 +2423,15 @@ eventTable.unhook (SWT.FocusOut, listener); } +public void removeGestureListener (GestureListener listener) { + checkWidget(); + if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); + if (eventTable == null) return; + eventTable.unhook(SWT.BeginGesture, listener); + eventTable.unhook(SWT.Gesture, listener); + eventTable.unhook(SWT.EndGesture, listener); +} + /** * Removes the listener from the collection of listeners who will * be notified when the help events are generated for the control. @@ -4180,6 +4235,7 @@ case OS.WM_ENDSESSION: result = WM_ENDSESSION (wParam, lParam); break; case OS.WM_ENTERIDLE: result = WM_ENTERIDLE (wParam, lParam); break; case OS.WM_ERASEBKGND: result = WM_ERASEBKGND (wParam, lParam); break; + case OS.WM_GESTURE: result = WM_GESTURE (wParam, lParam); break; case OS.WM_GETDLGCODE: result = WM_GETDLGCODE (wParam, lParam); break; case OS.WM_GETFONT: result = WM_GETFONT (wParam, lParam); break; case OS.WM_GETOBJECT: result = WM_GETOBJECT (wParam, lParam); break; @@ -4242,6 +4298,7 @@ case OS.WM_SYSCOMMAND: result = WM_SYSCOMMAND (wParam, lParam); break; case OS.WM_SYSKEYDOWN: result = WM_SYSKEYDOWN (wParam, lParam); break; case OS.WM_SYSKEYUP: result = WM_SYSKEYUP (wParam, lParam); break; + case OS.WM_TABLET_FLICK: result = WM_TABLET_FLICK (wParam, lParam); break; case OS.WM_TIMER: result = WM_TIMER (wParam, lParam); break; case OS.WM_UNDO: result = WM_UNDO (wParam, lParam); break; case OS.WM_UPDATEUISTATE: result = WM_UPDATEUISTATE (wParam, lParam); break; @@ -4358,6 +4415,10 @@ return null; } +LRESULT WM_GESTURE (int /*long*/ wParam, int /*long*/ lParam) { + return wmGesture(handle, wParam, lParam); +} + LRESULT WM_GETDLGCODE (int /*long*/ wParam, int /*long*/ lParam) { return null; } @@ -4951,6 +5012,10 @@ return wmSysKeyUp (handle, wParam, lParam); } +LRESULT WM_TABLET_FLICK (int /*long*/ wParam, int /*long*/ lParam) { + return wmTabletFlick (handle, wParam, lParam); +} + LRESULT WM_TIMER (int /*long*/ wParam, int /*long*/ lParam) { return null; } Index: Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java,v retrieving revision 1.350 diff -u -r1.350 Display.java --- Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java 21 Oct 2010 15:03:16 -0000 1.350 +++ Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java 13 Dec 2010 23:59:30 -0000 @@ -246,6 +246,11 @@ boolean accelKeyHit, mnemonicKeyHit; boolean lockActiveWindow, captureChanged, xMouse; + /* Gesture state */ + double magStartDistance, lastDistance; + double rotationAngle; + int lastX, lastY; + /* Tool Tips */ int nextToolTipId; @@ -2783,6 +2788,22 @@ OS.ReleaseDC (0, hDC); } +/** + * Returns true if a touch-aware input device is attached to the system, + * enabled, and ready for use. + * + * @since 3.7 + */ +public boolean isTouchEnabled() { + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 1)) { + int value = OS.GetSystemMetrics(OS.SM_DIGITIZER); + if ((value & (OS.NID_READY | OS.NID_MULTI_INPUT)) != 0) { + return true; + } + } + return false; +} + boolean isXMouseActive () { /* * NOTE: X-Mouse is active when bit 1 of the UserPreferencesMask is set. Index: Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java,v retrieving revision 1.156 diff -u -r1.156 Widget.java --- Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java 31 May 2010 16:44:10 -0000 1.156 +++ Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java 13 Dec 2010 23:59:30 -0000 @@ -1080,6 +1080,86 @@ } } +boolean sendGestureEvent (GESTUREINFO gi, boolean send) { + Event event = new Event (); + int type = 0; + POINT screenLoc = new POINT(); + screenLoc.x = gi.x; + screenLoc.y = gi.y; + OS.ScreenToClient(gi.hwndTarget, screenLoc); + event.x = screenLoc.x; + event.y = screenLoc.y; + + switch (gi.dwID){ + case OS.GID_BEGIN: + type = SWT.BeginGesture; + break; + case OS.GID_END: + type = SWT.EndGesture; + break; + case OS.GID_ZOOM: + type = SWT.Gesture; + event.detail = SWT.GESTURE_MAGNIFY; + int fingerDistance = OS.LODWORD(gi.ullArguments); + if ((gi.dwFlags & OS.GF_BEGIN) != 0) { + display.magStartDistance = display.lastDistance = fingerDistance; + } + + // gi.ullArguments is the distance between the fingers. Scale factor is relative + // to that original value. + if (fingerDistance == display.lastDistance) return false; + event.magnification = fingerDistance / display.magStartDistance; + display.lastDistance = fingerDistance; + break; + case OS.GID_PAN: + type = SWT.Gesture; + event.detail = SWT.GESTURE_PAN; + if ((gi.dwFlags & OS.GF_BEGIN) != 0) { + display.lastX = screenLoc.x; + display.lastY = screenLoc.y; + } + + if (display.lastX == screenLoc.x && display.lastY == screenLoc.y) return false; + + event.xDirection = screenLoc.x - display.lastX; + event.yDirection = screenLoc.y - display.lastY; + + display.lastX = screenLoc.x; + display.lastY = screenLoc.y; + break; + case OS.GID_ROTATE: + type = SWT.Gesture; + event.detail = SWT.GESTURE_ROTATE; + double rotationInRadians = OS.GID_ROTATE_ANGLE_FROM_ARGUMENT(OS.LODWORD(gi.ullArguments)); + if ((gi.dwFlags & OS.GF_BEGIN) != 0) { + display.rotationAngle = rotationInRadians; + } + + // Feature in Win32: Rotation events are sent even when the fingers are at rest. + // If the current rotation is the same as the last one received don't send the event. + if (display.rotationAngle == rotationInRadians) return false; + event.rotation = Math.toDegrees(rotationInRadians); + display.rotationAngle = rotationInRadians; + break; + default: + // Unknown gesture -- ignore. + break; + } + + if (type == 0) return false; + setInputState (event, type); + + if (send) { + sendEvent (type, event); + if (isDisposed ()) return false; + } else { + postEvent (type, event); + } + // Must allow GID_BEGIN and GID_END to go to default handler. + if (event.type != SWT.BeginGesture && event.type != SWT.EndGesture) return false; + return true; +} + void sendSelectionEvent (int type) { sendSelectionEvent (type, null, false); } @@ -1559,6 +1639,17 @@ return showMenu (x, y) ? LRESULT.ZERO : null; } +LRESULT wmGesture (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lParam) { + boolean handled = false; + GESTUREINFO gi = new GESTUREINFO(); + gi.cbSize = GESTUREINFO.sizeof; + if (OS.GetGestureInfo(lParam, gi)) { + handled = sendGestureEvent(gi, false); + } + OS.CloseGestureInfoHandle(lParam); + return (handled ? LRESULT.ZERO : null); +} + LRESULT wmIMEChar (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lParam) { Display display = this.display; display.lastKey = 0; @@ -2565,6 +2656,70 @@ return wmKeyUp (hwnd, wParam, lParam); } +LRESULT wmTabletFlick (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lParam) { + Event event = new Event (); + FLICK_DATA fData = new FLICK_DATA(); + int /*long*/ [] source = new int /*long*/ [1]; + source[0] = wParam; + OS.MoveMemory(fData, source, OS.FLICK_DATA_sizeof()); + + FLICK_POINT fPoint = new FLICK_POINT(); + source[0] = lParam; + OS.MoveMemory(fPoint, source, OS.FLICK_POINT_sizeof()); + + /* + * Feature in Win32: iFlickDirection is defined as a 3-bit field in a packed structure. + * Unpacking into a Java int (or long) maintains the sign. Mask off all but the last 3 bits + * to get the FLICK_DIRECTION enum value. + */ + fData.iFlickDirection &= 0x7; + + switch (fData.iFlickDirection) { + case OS.FLICKDIRECTION_RIGHT: + event.xDirection = 1; + event.yDirection = 0; + break; + case OS.FLICKDIRECTION_UPRIGHT: + event.xDirection = 1; + event.yDirection = -1; + break; + case OS.FLICKDIRECTION_UP: + event.xDirection = 0; + event.yDirection = -1; + break; + case OS.FLICKDIRECTION_UPLEFT: + event.xDirection = -1; + event.yDirection = -1; + break; + case OS.FLICKDIRECTION_LEFT: + event.xDirection = -1; + event.yDirection = 0; + break; + case OS.FLICKDIRECTION_DOWNLEFT: + event.xDirection = -1; + event.yDirection = 1; + break; + case OS.FLICKDIRECTION_DOWN: + event.xDirection = 0; + event.yDirection = 1; + break; + case OS.FLICKDIRECTION_DOWNRIGHT: + event.xDirection = 1; + event.yDirection = 1; + break; + } + + event.x = fPoint.x; + event.y = fPoint.y; + event.doit = true; + event.type = SWT.Gesture; + event.detail = SWT.GESTURE_SWIPE; + setInputState (event, SWT.Gesture); + sendEvent (SWT.Gesture, event); + return (event.doit == false ? LRESULT.ONE : null); +} + + LRESULT wmXButtonDblClk (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lParam) { /* * Feature in Windows. Windows sends the following