diff options
22 files changed, 1655 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c index ffa4735239..12a477f00a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c @@ -857,6 +857,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CloseEnhMetaFile) } #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) @@ -889,6 +909,26 @@ JNIEXPORT jint JNICALL OS_NATIVE(CloseThemeData) } #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) @@ -3133,6 +3173,30 @@ JNIEXPORT jint JNICALL OS_NATIVE(FILETIME_1sizeof) } #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) @@ -3254,6 +3318,30 @@ JNIEXPORT jint JNICALL OS_NATIVE(GCP_1RESULTS_1sizeof) } #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) @@ -3290,6 +3378,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(GET_1Y_1LPARAM) } #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) @@ -4086,6 +4186,30 @@ fail: } #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) @@ -6003,6 +6127,26 @@ fail: } #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) @@ -7710,6 +7854,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(LITEM_1sizeof) } #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) @@ -8587,6 +8743,30 @@ fail: } #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) @@ -9620,6 +9800,62 @@ fail: } #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) @@ -10629,6 +10865,31 @@ fail: } #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) @@ -12570,6 +12831,26 @@ fail: } #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) @@ -15726,6 +16007,26 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(SetForegroundWindow) } #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) @@ -16803,6 +17104,30 @@ JNIEXPORT jint JNICALL OS_NATIVE(TOOLINFO_1sizeof) } #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) @@ -17153,6 +17478,26 @@ fail: } #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) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h index 36ed3f0cf8..04c285a5f9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h @@ -68,6 +68,11 @@ #define NO_EMREXTCREATEFONTINDIRECTW #define NO_EXTLOGFONTW #define NO_EXTLOGPEN +#define NO_FLICK_DATA +#define NO_FLICK_POINT +#define NO_GESTURECONFIG +#define NO_GESTUREINFO +#define NO_GESTURENOTIFYSTRUCT #define NO_GCP_RESULTS #define NO_GRADIENT_RECT #define NO_GUITHREADINFO @@ -113,6 +118,7 @@ #define NO_TF_DA_COLOR #define NO_TF_DISPLAYATTRIBUTE #define NO_TOOLINFO +#define NO_TOUCHINPUT #define NO_TRACKMOUSEEVENT #define NO_TRIVERTEX #define NO_TVITEMEX @@ -179,7 +185,9 @@ #define NO_ChooseFontA #define NO_ChooseFontW #define NO_CloseEnhMetaFile +#define NO_CloseGestureInfoHandle #define NO_CloseThemeData +#define NO_CloseTouchInputHandle #define NO_CoCreateInstance #define NO_CoInternetIsFeatureEnabled #define NO_CoInternetSetFeatureEnabled @@ -245,8 +253,13 @@ #define NO_ExtractIconExA #define NO_FillPath #define NO_FindWindowA +#define NO_FLICK_1DATA_1sizeof +#define NO_FLICK_1POINT_1sizeof #define NO_FormatMessageA #define NO_GdiSetBatchLimit +#define NO_GESTURECONFIG_1sizeof +#define NO_GESTUREINFO_1sizeof +#define NO_GID_1ROTATE_1ANGLE_1FROM_1ARGUMENT #define NO_GetCharABCWidthsA #define NO_GetCharABCWidthsW #define NO_GetCharWidthA @@ -261,6 +274,7 @@ #define NO_GetDIBColorTable #define NO_GetDIBits #define NO_GetFontLanguageInfo +#define NO_GetGestureInfo #define NO_GetGlyphIndicesW #define NO_GetGraphicsMode #define NO_GetGUIThreadInfo @@ -328,6 +342,7 @@ #define NO_GetThemeRect #define NO_GetThemeSysSize #define NO_GetTimeFormatA +#define NO_GetTouchInputInfo #define NO_GetVersionExA__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOA_2 #define NO_GetVersionExA__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOEXA_2 #define NO_GetVersionExW__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOEXW_2 @@ -374,6 +389,7 @@ #define NO_LoadLibraryA #define NO_LoadStringA #define NO_LockWindowUpdate +#define NO_LODWORD #define NO_LPtoDP #define NO_MapVirtualKeyA #define NO_MCIWndRegisterClass @@ -386,10 +402,14 @@ #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II +#define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1POINT_2_3II +#define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_FLICK_1DATA_2_3II #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_NMREBARCHEVRON_2II #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_NMREBARCHILDSIZE_2II #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_HELPINFO_2II #define NO_MoveMemory__ILorg_eclipse_swt_internal_win32_TRIVERTEX_2I +#define NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I +#define NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GESTURECONFIG_2I #define NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_NMLINK_2II #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_NMTBHOTITEM_2II @@ -408,6 +428,7 @@ #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_SHDRAGIMAGE_2II #define NO_MoveMemory__ILorg_eclipse_swt_internal_win32_MINMAXINFO_2I #define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_MINMAXINFO_2II +#define NO_MoveMemory__Lorg_eclipse_swt_internal_win32_TOUCHINPUT_2II #define NO_MoveToEx #define NO_NotifyWinEvent #define NO_OleInitialize @@ -432,12 +453,14 @@ #define NO_RegQueryValueExA__I_3BI_3I_3I_3I #define NO_RegisterClassA #define NO_RegisterClipboardFormatA +#define NO_RegisterTouchWindow #define NO_RegisterWindowMessageA #define NO_RemoveFontResourceExW #define NO_RemovePropA #define NO_RemovePropW #define NO_ReplyMessage #define NO_SetCurrentProcessExplicitAppUserModelID +#define NO_SetGestureConfig #define NO_SetLayeredWindowAttributes #define NO_SetLayout #define NO_SetProcessDPIAware @@ -553,6 +576,8 @@ #define NO_ScriptXtoCP #define NO_StrokePath #define NO_ToAscii +#define NO_TOUCHINPUT_1sizeof +#define NO_TOUCH_1COORD_1TO_1PIXEL #define NO_ToUnicode #define NO_TrackMouseEvent #define NO_TranslateAcceleratorA @@ -560,6 +585,7 @@ #define NO_TransparentBlt #define NO_UnhookWindowsHookEx #define NO_UnregisterClassA +#define NO_UnregisterTouchWindow #define NO_UpdateLayeredWindow #define NO_VkKeyScanA #define NO_VkKeyScanW @@ -673,10 +699,127 @@ typedef struct tagTVITEMCHANGE { #endif /* _WIN32_IE <= 0x0600 */ #endif /* _WIN32_WCE */ +#if (WINVER < 0x0601) +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; + +typedef struct FLICK_POINT +{ + INT x:16; + INT y:16; +}FLICK_POINT; + +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; + +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; + +/* + * 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 */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h index 2ffdf4859f..452e6fed5e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h @@ -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" diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c index ce04a26fc1..c817d59b70 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1012; -int OS_nativeFunctionCallCount[1012]; +int OS_nativeFunctionCount = 1031; +int OS_nativeFunctionCallCount[1031]; char * OS_nativeFunctionNames[] = { "ACCEL_1sizeof", "ACTCTX_1sizeof", @@ -78,8 +78,10 @@ char * OS_nativeFunctionNames[] = { "ClientToScreen", "CloseClipboard", "CloseEnhMetaFile", + "CloseGestureInfoHandle", "CloseHandle", "CloseThemeData", + "CloseTouchInputHandle", "CoCreateInstance", "CoInternetIsFeatureEnabled", "CoInternetSetFeatureEnabled", @@ -231,6 +233,8 @@ char * OS_nativeFunctionNames[] = { "ExtractIconExA", "ExtractIconExW", "FILETIME_1sizeof", + "FLICK_1DATA_1sizeof", + "FLICK_1POINT_1sizeof", "FillPath", "FillRect", "FindWindowA", @@ -239,9 +243,12 @@ char * OS_nativeFunctionNames[] = { "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", @@ -289,6 +296,7 @@ char * OS_nativeFunctionNames[] = { "GetFontLanguageInfo", "GetForegroundWindow", "GetGUIThreadInfo", + "GetGestureInfo", "GetGlyphIndicesW", "GetGraphicsMode", "GetIconInfo", @@ -448,6 +456,7 @@ char * OS_nativeFunctionNames[] = { "GetTickCount", "GetTimeFormatA", "GetTimeFormatW", + "GetTouchInputInfo", "GetUpdateRect", "GetUpdateRgn", "GetVersionExA__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOA_2", @@ -586,6 +595,7 @@ char * OS_nativeFunctionNames[] = { "KEYBDINPUT_1sizeof", "KillTimer", "LITEM_1sizeof", + "LODWORD", "LOGBRUSH_1sizeof", "LOGFONTA_1sizeof", "LOGFONTW_1sizeof", @@ -688,6 +698,11 @@ char * OS_nativeFunctionNames[] = { "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", @@ -874,6 +889,16 @@ char * OS_nativeFunctionNames[] = { "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", @@ -1070,6 +1095,11 @@ char * OS_nativeFunctionNames[] = { "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", @@ -1239,6 +1269,7 @@ char * OS_nativeFunctionNames[] = { "RegisterClassW", "RegisterClipboardFormatA", "RegisterClipboardFormatW", + "RegisterTouchWindow", "RegisterWindowMessageA", "RegisterWindowMessageW", "ReleaseCapture", @@ -1666,6 +1697,7 @@ char * OS_nativeFunctionNames[] = { "SetErrorMode", "SetFocus", "SetForegroundWindow", + "SetGestureConfig", "SetGraphicsMode", "SetLayeredWindowAttributes", "SetLayout", @@ -1741,6 +1773,8 @@ char * OS_nativeFunctionNames[] = { "TF_1DA_1COLOR_1sizeof", "TF_1DISPLAYATTRIBUTE_1sizeof", "TOOLINFO_1sizeof", + "TOUCHINPUT_1sizeof", + "TOUCH_1COORD_1TO_1PIXEL", "TRACKMOUSEEVENT_1sizeof", "TRIVERTEX_1sizeof", "TVHITTESTINFO_1sizeof", @@ -1765,6 +1799,7 @@ char * OS_nativeFunctionNames[] = { "UnmapViewOfFile", "UnregisterClassA", "UnregisterClassW", + "UnregisterTouchWindow", "UpdateLayeredWindow", "UpdateWindow", "ValidateRect", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h index 077523b5d4..5f5e4433f9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h @@ -86,8 +86,10 @@ typedef enum { ClientToScreen_FUNC, CloseClipboard_FUNC, CloseEnhMetaFile_FUNC, + CloseGestureInfoHandle_FUNC, CloseHandle_FUNC, CloseThemeData_FUNC, + CloseTouchInputHandle_FUNC, CoCreateInstance_FUNC, CoInternetIsFeatureEnabled_FUNC, CoInternetSetFeatureEnabled_FUNC, @@ -239,6 +241,8 @@ typedef enum { ExtractIconExA_FUNC, ExtractIconExW_FUNC, FILETIME_1sizeof_FUNC, + FLICK_1DATA_1sizeof_FUNC, + FLICK_1POINT_1sizeof_FUNC, FillPath_FUNC, FillRect_FUNC, FindWindowA_FUNC, @@ -247,9 +251,12 @@ typedef enum { 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, @@ -297,6 +304,7 @@ typedef enum { GetFontLanguageInfo_FUNC, GetForegroundWindow_FUNC, GetGUIThreadInfo_FUNC, + GetGestureInfo_FUNC, GetGlyphIndicesW_FUNC, GetGraphicsMode_FUNC, GetIconInfo_FUNC, @@ -456,6 +464,7 @@ typedef enum { GetTickCount_FUNC, GetTimeFormatA_FUNC, GetTimeFormatW_FUNC, + GetTouchInputInfo_FUNC, GetUpdateRect_FUNC, GetUpdateRgn_FUNC, GetVersionExA__Lorg_eclipse_swt_internal_win32_OSVERSIONINFOA_2_FUNC, @@ -594,6 +603,7 @@ typedef enum { KEYBDINPUT_1sizeof_FUNC, KillTimer_FUNC, LITEM_1sizeof_FUNC, + LODWORD_FUNC, LOGBRUSH_1sizeof_FUNC, LOGFONTA_1sizeof_FUNC, LOGFONTW_1sizeof_FUNC, @@ -696,6 +706,11 @@ typedef enum { 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, @@ -882,6 +897,16 @@ typedef enum { 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, @@ -1078,6 +1103,11 @@ typedef enum { 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, @@ -1247,6 +1277,7 @@ typedef enum { RegisterClassW_FUNC, RegisterClipboardFormatA_FUNC, RegisterClipboardFormatW_FUNC, + RegisterTouchWindow_FUNC, RegisterWindowMessageA_FUNC, RegisterWindowMessageW_FUNC, ReleaseCapture_FUNC, @@ -1674,6 +1705,7 @@ typedef enum { SetErrorMode_FUNC, SetFocus_FUNC, SetForegroundWindow_FUNC, + SetGestureConfig_FUNC, SetGraphicsMode_FUNC, SetLayeredWindowAttributes_FUNC, SetLayout_FUNC, @@ -1749,6 +1781,8 @@ typedef enum { 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, @@ -1773,6 +1807,7 @@ typedef enum { UnmapViewOfFile_FUNC, UnregisterClassA_FUNC, UnregisterClassW_FUNC, + UnregisterTouchWindow_FUNC, UpdateLayeredWindow_FUNC, UpdateWindow_FUNC, ValidateRect_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c index a7c7a15e6c..88234f9a3e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c @@ -1721,6 +1721,98 @@ void setFILETIMEFields(JNIEnv *env, jobject lpObject, FILETIME *lpStruct) } #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 @@ void setGCP_RESULTSFields(JNIEnv *env, jobject lpObject, GCP_RESULTS *lpStruct) } #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 @@ void setTOOLINFOFields(JNIEnv *env, jobject lpObject, TOOLINFO *lpStruct) } #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; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h index b13086fb14..1bee778c30 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h @@ -359,6 +359,30 @@ void setFILETIMEFields(JNIEnv *env, jobject lpObject, FILETIME *lpStruct); #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 @@ void setGCP_RESULTSFields(JNIEnv *env, jobject lpObject, GCP_RESULTS *lpStruct); #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 @@ void setTOOLINFOFields(JNIEnv *env, jobject lpObject, TOOLINFO *lpStruct); #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); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java new file mode 100644 index 0000000000..3ebebad5a5 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_DATA.java @@ -0,0 +1,17 @@ + +package org.eclipse.swt.internal.win32; + +public class FLICK_DATA { + public int iFlickActionCommandCode; + /* @field 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(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java new file mode 100644 index 0000000000..872f4e760c --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FLICK_POINT.java @@ -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(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java new file mode 100644 index 0000000000..09c17f39fb --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java @@ -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 (); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java new file mode 100644 index 0000000000..4fc8f73c3e --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java @@ -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 (); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java index c0774d7a47..3b3a90cde1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java @@ -679,6 +679,15 @@ public class OS extends C { 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 class OS extends C { 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 class OS extends C { 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; @@ -1519,6 +1540,8 @@ public class OS extends C { 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; @@ -1739,6 +1762,13 @@ public class OS extends C { 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; @@ -2067,6 +2097,7 @@ public class OS extends C { 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; @@ -2139,8 +2170,10 @@ public class OS extends C { 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; @@ -2220,7 +2253,11 @@ public static final native int EMREXTCREATEFONTINDIRECTW_sizeof (); 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 (); @@ -2329,6 +2366,7 @@ public static final native int TEXTMETRICW_sizeof (); 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 (); @@ -3524,6 +3562,11 @@ public static final native boolean ClientToScreen (int /*long*/ hWnd, POINT lpPo 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); /** @@ -3532,6 +3575,11 @@ public static final native boolean CloseHandle (int /*long*/ hObject); */ 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) @@ -4165,6 +4213,12 @@ public static final native int /*long*/ GetFocus (); /** @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); /** @@ -4515,6 +4569,13 @@ public static final native int GetTimeFormatW(int Locale, int dwFlags, SYSTEMTIM */ 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) @@ -4583,6 +4644,7 @@ public static final native int GetWindowThreadProcessId (int /*long*/ hWnd, int * @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) */ @@ -4924,6 +4986,7 @@ public static final native int /*long*/ LoadLibraryA (byte [] lpLibFileName); 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); @@ -5159,6 +5222,16 @@ public static final native void MoveMemory (DRAWITEMSTRUCT Destination, int /*lo 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); @@ -5377,6 +5450,11 @@ public static final native void MoveMemory (TEXTMETRICA Destination, int /*long* * @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 @@ -5444,6 +5522,11 @@ public static final native void MoveMemory (int /*long*/ Destination, KEYBDINPUT */ 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) */ @@ -5588,6 +5671,12 @@ public static final native int RegEnumKeyExA (int /*long*/ hKey, int dwIndex, by /** @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) */ @@ -6298,6 +6387,12 @@ public static final native int SetErrorMode (int uMode); 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); /** @@ -6558,6 +6653,7 @@ public static final native int ToAscii (int uVirtKey, int uScanCode, byte [] lpK * @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) @@ -6618,6 +6714,11 @@ public static final native boolean UnregisterClassA (byte [] lpClassName, int /* * @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) */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java new file mode 100644 index 0000000000..868f75462d --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOUCHINPUT.java @@ -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(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java index 0cae4f1f52..b29f8e05eb 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java @@ -715,6 +715,39 @@ public class SWT { */ public static final int OpenDocument = 46; + /** + * The touch event type (value is 46). + * + * <p> + * This event is sent when SWT receives notification that a document + * should be opened. + * </p> + * + * @see org.eclipse.swt.widgets.Display#addListener + * @see org.eclipse.swt.widgets.Event + * + * @since 3.7 + */ + public static final int Touch = 47; + + /** + * The gesture event type (value is 48). + * + * <p> + * This event is sent when a gesture has been performed. + * </p> + * + * @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 = 48; + /* Event Details */ /** @@ -897,6 +930,58 @@ public class SWT { * (value is 1<<9). */ public static final int TRAVERSE_PAGE_NEXT = 1 << 9; + + /** + * Gesture event detail field value indicating that a continuous + * gesture is about to begin. + * + * @since 3.7 + */ + public static final int GESTURE_BEGIN = 1 << 1; + + /** + * Gesture event detail field value indicating that a continuous + * gesture has ended. + * + * @since 3.7 + */ + public static final int GESTURE_END = 1 << 2; + + /** + * 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 << 3; + + /** + * 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 << 4; + + /** + * 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 << 5; + + /** + * 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 << 6; /** * A constant indicating that widgets have changed. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java new file mode 100644 index 0000000000..3f8eecec85 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureAdapter.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2010 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 <code>GestureListener</code> interface. + * <p> + * Classes that wish to deal with <code>GestureEvent</code>s can + * extend this class and override only the methods which they are + * interested in. + * </p> + * + * @see GestureListener + * @see GestureEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * @since 3.7 + */ +public abstract class GestureAdapter implements GestureListener { + +/** + * Sent when a recognized gesture has occurred. + * + * @param e an event containing information about the gesture. + */ +public void gesture(GestureEvent e) { +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java new file mode 100644 index 0000000000..5b50c94760 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java @@ -0,0 +1,161 @@ +/******************************************************************************* + * Copyright (c) 2010 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. + * <p> + * </p> + * + * @see GestureListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * @since 3.7 + */ + +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. + * <p><ul> + * <li>{@link org.eclipse.swt.SWT#GESTURE_NONE}</li> + * <li>{@link org.eclipse.swt.SWT#GESTURE_MAGNIFY}</li> + * <li>{@link org.eclipse.swt.SWT#GESTURE_PAN}</li> + * <li>{@link org.eclipse.swt.SWT#GESTURE_ROTATE}</li> + * <li>{@link org.eclipse.swt.SWT#GESTURE_SWIPE}</li> + * </ul></p> + * + * The value of the <code>detail</code> field determines which fields of the + * <code>GestureEvent</code> contain valid data. + */ + public int detail; + + /** + * Depending on the value of the <code>detail</code> field and the current platform, this field + * can mean the x coordinate of the centroid of the touches that make up the gesture (Windows), or the x coordinate of + * the screen location of the cursor at the time the gesture was performed (Mac OS X). + * + * NOTE: The definition of this field is subject to change before the API freeze for 3.7. + */ + public int x; + + /** + * Depending on the value of the <code>detail</code> field and the current platform, this field + * can mean the y coordinate of the centroid of the touches that make up the gesture (Windows), or the y component of + * the screen location of the cursor at the time the gesture was performed (Mac OS X). + * + * NOTE: The definition of this field is subject to change before the API freeze for 3.7. + */ + public int y; + + /** + * Number of degrees rotated on the device since the gesture started. Positive values indicated counter-clockwise + * rotation; negative values indicate clockwise rotation. + * + * This field is valid when the <code>detail</code> field is set to <code>GESTURE_ROTATE</code>. + */ + public double rotation; + + /** + * The meaning of this field depends on the value of the <code>detail</code> field. + * + * If <code>detail</code> is <code>GESTURE_SWIPE</code> + * and non-zero, a positive value indicates a swipe to the right, and a negative value indicates a swipe to the left. + * + * If <code>detail</code> is <code>GESTURE_PAN</code> a positive value indicates a pan to the right of that many pixels, + * and a negative value indicates a pan to the left of that many pixels. + * + * This field is valid when the <code>detail</code> field is set to <code>GESTURE_SWIPE</code> or <code>GESTURE_PAN</code>. + * Both the <code>xDirection</code> and <code>yDirection</code> can be valid for an individual gesture. + */ + public int xDirection; + + /** + * The meaning of this field depends on the value of the <code>detail</code> field. + * + * If <code>detail</code> is <code>GESTURE_SWIPE</code> + * and non-zero, a positive value indicates a swipe down, and a negative value indicates a swipe up. + * + * If <code>detail</code> is <code>GESTURE_PAN</code> a positive value indicates a pan downwards of that many pixels, + * and a negative value indicates a pan upwards of that many pixels. + * + * This field is valid when the <code>detail</code> field is set to <code>GESTURE_SWIPE</code> or <code>GESTURE_PAN</code>. + * Both the <code>xDirection</code> and <code>yDirection</code> can be valid for an individual gesture. + */ + public int yDirection; + + /** + * Scale factor to be applied. In the first <code>GESTURE_MAGNIFY</code> received for a magnification this value will be 1.0 + * and will then fluctuate as the user moves their fingers. + * + * This field is valid when the <code>detail</code> field is set to <code>GESTURE_MAGNIFY</code>. + */ + public double magnification; + + /** + * A flag indicating whether the operation should be allowed. + * Setting this field to <code>false</code> will cancel the operation. + */ + public boolean doit; + + 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; + this.doit = e.doit; +} + +/** + * 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 + + "}"; +} +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java new file mode 100644 index 0000000000..34801b36db --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureListener.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2010 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. + * <p> + * After creating an instance of a class that implements + * this interface it can be added to a control using the + * <code>addGestureListener</code> method and removed using + * the <code>removeGestureListener</code> method. When a + * gesture is invoked, the appropriate method will be invoked. + * </p> + * + * @see GestureAdapter + * @see GestureEvent + * @since 3.7 + */ +public interface GestureListener extends SWTEventListener { + +/** + * Sent when a recognized gesture has occurred. + * + * @param e an event containing information about the gesture. + */ +public void gesture(GestureEvent e); + +}
\ No newline at end of file diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Event.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Event.java index d67ea3d9d9..34667a8044 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Event.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Event.java @@ -215,6 +215,40 @@ public class Event { */ public Object data; + /** + * An array of the touch states for the current touch event. + * @since 3.7 + */ + //public Touch[] 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. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java index db4fb1d98c..f87a010434 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java @@ -143,6 +143,10 @@ public void handleEvent (Event e) { ((FocusListener) eventListener).focusLost(new FocusEvent(e)); break; } + case SWT.Gesture: { + ((GestureListener)eventListener).gesture(new GestureEvent(e)); + break; + } case SWT.Help: { ((HelpListener) eventListener).helpRequested (new HelpEvent (e)); break; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index 580e7f22ad..8b57f49fc6 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -44,6 +44,8 @@ import org.eclipse.swt.accessibility.*; */ 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) @@ -194,6 +196,32 @@ public void addFocusListener (FocusListener listener) { /** * Adds the listener to the collection of listeners who will + * be notified when gesture events are generated for the control, + * by sending it one of the messages defined in the + * <code>GestureListener</code> interface. + * + * @param listener the listener which should be notified + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see GestureListener + * @see #removeGestureListener + */ +public void addGestureListener (GestureListener listener) { + checkWidget(); + if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); + TypedListener typedListener = new TypedListener (listener); + addListener (SWT.Gesture, 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 * <code>HelpListener</code> interface. @@ -640,6 +668,31 @@ void createHandle () { OS.ImmAssociateContext (handle, hIMC); OS.ImmReleaseContext (hwndParent, hIMC); } + +} + +void checkGesture() { + 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) { + int /*long*/ hHeap = OS.GetProcessHeap(); + int /*long*/ pConfigs = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, 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.HeapFree(hHeap, 0, pConfigs); + } + } + } } void createWidget () { @@ -655,6 +708,7 @@ void createWidget () { setDefaultFont (); checkMirrored (); checkBorder (); + checkGesture(); if ((state & PARENT_BACKGROUND) != 0) { setBackground (); } @@ -2379,6 +2433,30 @@ public void removeFocusListener(FocusListener listener) { /** * Removes the listener from the collection of listeners who will + * be notified when gesture events are generated for the control. + * + * @param listener the listener which should no longer be notified + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see GestureListener + * @see #addGestureListener + */ +public void removeGestureListener (GestureListener listener) { + checkWidget(); + if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); + if (eventTable == null) return; + eventTable.unhook(SWT.Gesture, listener); +} + +/** + * Removes the listener from the collection of listeners who will * be notified when the help events are generated for the control. * * @param listener the listener which should no longer be notified @@ -4180,6 +4258,7 @@ int /*long*/ windowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /* 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 +4321,7 @@ int /*long*/ windowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /* 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 +4438,10 @@ LRESULT WM_ERASEBKGND (int /*long*/ wParam, int /*long*/ lParam) { 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 +5035,10 @@ LRESULT WM_SYSKEYUP (int /*long*/ wParam, int /*long*/ lParam) { 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; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java index 89b891d12f..263e5907e9 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java @@ -246,6 +246,11 @@ public class Display extends Device { boolean accelKeyHit, mnemonicKeyHit; boolean lockActiveWindow, captureChanged, xMouse; + /* Gesture state */ + double magStartDistance, lastDistance; + double rotationAngle; + int lastX, lastY; + /* Tool Tips */ int nextToolTipId; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java index e3cd2ac37b..023f513246 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java @@ -1080,6 +1080,81 @@ void sendEvent (int eventType, Event event, boolean send) { } } +boolean sendGestureEvent (GESTUREINFO gi) { + Event event = new Event (); + int type = 0; + POINT screenLoc = new POINT(); + screenLoc.x = gi.x; + screenLoc.y = gi.y; + OS.MapWindowPoints (0, gi.hwndTarget, screenLoc, 1); + event.x = screenLoc.x; + event.y = screenLoc.y; + + switch (gi.dwID){ + 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) { + event.detail = SWT.GESTURE_BEGIN; + display.magStartDistance = display.lastDistance = fingerDistance; + } else if ((gi.dwFlags & OS.GF_END) != 0) { + event.detail = SWT.GESTURE_END; + } + + // gi.ullArguments is the distance between the fingers. Scale factor is relative + // to that original value. + if (fingerDistance == display.lastDistance && event.detail == SWT.GESTURE_MAGNIFY) return false; + if (fingerDistance != 0) 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) { + event.detail = SWT.GESTURE_BEGIN; + display.lastX = screenLoc.x; + display.lastY = screenLoc.y; + } else if ((gi.dwFlags & OS.GF_END) != 0) { + event.detail = SWT.GESTURE_END; + } + + if (display.lastX == screenLoc.x && display.lastY == screenLoc.y && event.detail == SWT.GESTURE_PAN) 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) { + event.detail = SWT.GESTURE_BEGIN; + display.rotationAngle = rotationInRadians; + } else if ((gi.dwFlags & OS.GF_END) != 0) { + event.detail = SWT.GESTURE_END; + } + + // 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 && event.detail == SWT.GESTURE_ROTATE) return false; + event.rotation = rotationInRadians * 180.0 / Compatibility.PI; + display.rotationAngle = rotationInRadians; + break; + default: + // Unknown gesture -- ignore. + break; + } + + if (type == 0) return false; + setInputState (event, type); + sendEvent (type, event); + return event.doit; +} + void sendSelectionEvent (int type) { sendSelectionEvent (type, null, false); } @@ -1559,6 +1634,17 @@ LRESULT wmContextMenu (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lPar 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); + } + 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 +2651,69 @@ LRESULT wmSysKeyUp (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lParam) 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 |