summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2008-05-29 23:22:35 +0000
committerFelipe Heidrich <fheidric>2008-05-29 23:22:35 +0000
commit046e0d0bfd6bae07f076caade40f57f2f865587f (patch)
treed6f958c56d2ee879e215c8f5f2c44f798727af59
parentc434902e868dc31f4d87acdb50f51cbdb8752d24 (diff)
downloadeclipse.platform.swt-046e0d0bfd6bae07f076caade40f57f2f865587f.tar.gz
eclipse.platform.swt-046e0d0bfd6bae07f076caade40f57f2f865587f.tar.xz
eclipse.platform.swt-046e0d0bfd6bae07f076caade40f57f2f865587f.zip
234738 - TextLayout font fallback improvement
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties106
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c222
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c229
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMR.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMREXTCREATEFONTINDIRECTW.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EXTLOGFONTW.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/PANOSE.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java220
13 files changed, 827 insertions, 154 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties
index cda49ab6b4..d17ebf7eb9 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties
@@ -212,6 +212,27 @@ DWM_BLURBEHIND_fEnable=
DWM_BLURBEHIND_hRgnBlur=cast=HRGN
DWM_BLURBEHIND_fTransitionOnMaximized=
+org_eclipse_swt_internal_win32_EMR=
+EMR_iType=
+EMR_nSize=
+
+org_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW=
+EMREXTCREATEFONTINDIRECTW_emr=
+EMREXTCREATEFONTINDIRECTW_ihFont=
+EMREXTCREATEFONTINDIRECTW_elfw=
+
+org_eclipse_swt_internal_win32_EXTLOGFONTW=
+EXTLOGFONTW_elfLogFont=
+EXTLOGFONTW_elfFullName=
+EXTLOGFONTW_elfStyle=
+EXTLOGFONTW_elfVersion=
+EXTLOGFONTW_elfStyleSize=
+EXTLOGFONTW_elfMatch=
+EXTLOGFONTW_elfReserved=
+EXTLOGFONTW_elfVendorId=
+EXTLOGFONTW_elfCulture=
+EXTLOGFONTW_elfPanose=
+
org_eclipse_swt_internal_win32_EXTLOGPEN=
EXTLOGPEN_elpPenStyle=
EXTLOGPEN_elpWidth=
@@ -943,6 +964,9 @@ OS_ClientToScreen_1=
OS_CloseClipboard=
+OS_CloseEnhMetaFile=
+OS_CloseEnhMetaFile_0=cast=(HDC)
+
OS_CloseHandle=
OS_CloseHandle_0=cast=HANDLE
@@ -1082,6 +1106,18 @@ OS_CreateDIBSection__I_3BI_3III_3=cast=(VOID **),flags=no_in critical
OS_CreateDIBSection__I_3BI_3III_4=cast=(HANDLE)
OS_CreateDIBSection__I_3BI_3III_5=
+OS_CreateEnhMetaFileA=
+OS_CreateEnhMetaFileA_0=cast=HDC
+OS_CreateEnhMetaFileA_1=cast=LPCSTR
+OS_CreateEnhMetaFileA_2=
+OS_CreateEnhMetaFileA_3=cast=LPCSTR
+
+OS_CreateEnhMetaFileW=
+OS_CreateEnhMetaFileW_0=cast=HDC
+OS_CreateEnhMetaFileW_1=cast=LPCWSTR
+OS_CreateEnhMetaFileW_2=
+OS_CreateEnhMetaFileW_3=cast=LPCWSTR
+
OS_CreateFontIndirectA__I=
OS_CreateFontIndirectA__I_0=cast=(LPLOGFONTA)
@@ -1253,6 +1289,9 @@ OS_DeferWindowPos_7=
OS_DeleteDC=
OS_DeleteDC_0=cast=(HDC)
+OS_DeleteEnhMetaFile=
+OS_DeleteEnhMetaFile_0=cast=HENHMETAFILE
+
OS_DeleteMenu=
OS_DeleteMenu_0=cast=(HMENU)
OS_DeleteMenu_1=
@@ -1428,6 +1467,12 @@ OS_DwmExtendFrameIntoClientArea=flags=dynamic
OS_DwmExtendFrameIntoClientArea_0=cast=HWND
OS_DwmExtendFrameIntoClientArea_1=
+OS_EMREXTCREATEFONTINDIRECTW_sizeof=
+
+OS_EMR_sizeof=
+
+OS_EXTLOGFONTW_sizeof=
+
OS_EXTLOGPEN_sizeof=
OS_Ellipse=
@@ -1477,6 +1522,13 @@ OS_EnumDisplayMonitors_1=cast=(LPCRECT)
OS_EnumDisplayMonitors_2=cast=(MONITORENUMPROC)
OS_EnumDisplayMonitors_3=cast=(LPARAM)
+OS_EnumEnhMetaFile=
+OS_EnumEnhMetaFile_0=cast=HDC
+OS_EnumEnhMetaFile_1=cast=HENHMETAFILE
+OS_EnumEnhMetaFile_2=cast=ENHMFENUMPROC
+OS_EnumEnhMetaFile_3=cast=LPVOID
+OS_EnumEnhMetaFile_4=
+
OS_EnumFontFamiliesA=
OS_EnumFontFamiliesA_0=cast=(HDC)
OS_EnumFontFamiliesA_1=cast=(LPSTR)
@@ -3104,6 +3156,16 @@ OS_MoveMemory__Lorg_eclipse_swt_internal_win32_DRAWITEMSTRUCT_2II_0=cast=(PVOID)
OS_MoveMemory__Lorg_eclipse_swt_internal_win32_DRAWITEMSTRUCT_2II_1=cast=(CONST VOID *)
OS_MoveMemory__Lorg_eclipse_swt_internal_win32_DRAWITEMSTRUCT_2II_2=
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II=
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II_0=cast=(PVOID),flags=no_in
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II_1=cast=(CONST VOID *)
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II_2=
+
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II=
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II_0=cast=(PVOID),flags=no_in
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II_1=cast=(CONST VOID *)
+OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II_2=
+
OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II=
OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II_0=cast=(PVOID),flags=no_in
OS_MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II_1=cast=(CONST VOID *)
@@ -3496,6 +3558,8 @@ OS_OpenThemeData_1=cast=LPCWSTR
OS_PAINTSTRUCT_sizeof=
+OS_PANOSE_sizeof=
+
OS_POINTSTOPOINT=
OS_POINTSTOPOINT_0=flags=struct
OS_POINTSTOPOINT_1=
@@ -3786,6 +3850,8 @@ OS_SCRIPT_PROPERTIES_sizeof=
OS_SCRIPT_STATE_sizeof=
+OS_SCRIPT_STRING_ANALYSIS_sizeof=
+
OS_SCROLLBARINFO_sizeof=
OS_SCROLLINFO_sizeof=
@@ -3981,6 +4047,34 @@ OS_ScriptShape_7=cast=WORD *
OS_ScriptShape_8=cast=SCRIPT_VISATTR *
OS_ScriptShape_9=cast=int *
+OS_ScriptStringAnalyse=
+OS_ScriptStringAnalyse_0=cast=HDC
+OS_ScriptStringAnalyse_1=cast=const void*
+OS_ScriptStringAnalyse_2=
+OS_ScriptStringAnalyse_3=
+OS_ScriptStringAnalyse_4=
+OS_ScriptStringAnalyse_5=
+OS_ScriptStringAnalyse_6=
+OS_ScriptStringAnalyse_7=
+OS_ScriptStringAnalyse_8=
+OS_ScriptStringAnalyse_9=cast=const int*
+OS_ScriptStringAnalyse_10=cast=SCRIPT_TABDEF*
+OS_ScriptStringAnalyse_11=cast=const BYTE*
+OS_ScriptStringAnalyse_12=cast=SCRIPT_STRING_ANALYSIS*
+
+OS_ScriptStringFree=
+OS_ScriptStringFree_0=cast=SCRIPT_STRING_ANALYSIS*
+
+OS_ScriptStringOut=
+OS_ScriptStringOut_0=cast=SCRIPT_STRING_ANALYSIS*,flags=struct
+OS_ScriptStringOut_1=
+OS_ScriptStringOut_2=
+OS_ScriptStringOut_3=
+OS_ScriptStringOut_4=
+OS_ScriptStringOut_5=
+OS_ScriptStringOut_6=
+OS_ScriptStringOut_7=
+
OS_ScriptTextOut=
OS_ScriptTextOut_0=cast=const HDC
OS_ScriptTextOut_1=cast=SCRIPT_CACHE *
@@ -5154,6 +5248,18 @@ PAINTSTRUCT_fRestore=
PAINTSTRUCT_fIncUpdate=
PAINTSTRUCT_rgbReserved=
+org_eclipse_swt_internal_win32_PANOSE=
+PANOSE_bFamilyType=
+PANOSE_bSerifStyle=
+PANOSE_bWeight=
+PANOSE_bProportion=
+PANOSE_bContrast=
+PANOSE_bStrokeVariation=
+PANOSE_bArmStyle=
+PANOSE_bLetterform=
+PANOSE_bMidline=
+PANOSE_bXHeight=
+
org_eclipse_swt_internal_win32_POINT=
POINT_x=
POINT_y=
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 2e579023b5..09e484414f 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
@@ -907,6 +907,18 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(CloseClipboard)
}
#endif
+#ifndef NO_CloseEnhMetaFile
+JNIEXPORT jint JNICALL OS_NATIVE(CloseEnhMetaFile)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, CloseEnhMetaFile_FUNC);
+ rc = (jint)CloseEnhMetaFile((HDC)arg0);
+ OS_NATIVE_EXIT(env, that, CloseEnhMetaFile_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CloseHandle
JNIEXPORT jboolean JNICALL OS_NATIVE(CloseHandle)
(JNIEnv *env, jclass that, jint arg0)
@@ -1441,6 +1453,50 @@ fail:
}
#endif
+#ifndef NO_CreateEnhMetaFileA
+JNIEXPORT jint JNICALL OS_NATIVE(CreateEnhMetaFileA)
+ (JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jobject arg2, jbyteArray arg3)
+{
+ jbyte *lparg1=NULL;
+ RECT _arg2, *lparg2=NULL;
+ jbyte *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, CreateEnhMetaFileA_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = getRECTFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL)) == NULL) goto fail;
+ rc = (jint)CreateEnhMetaFileA((HDC)arg0, (LPCSTR)lparg1, lparg2, (LPCSTR)lparg3);
+fail:
+ if (arg3 && lparg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0);
+ if (arg2 && lparg2) setRECTFields(env, arg2, lparg2);
+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, CreateEnhMetaFileA_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CreateEnhMetaFileW
+JNIEXPORT jint JNICALL OS_NATIVE(CreateEnhMetaFileW)
+ (JNIEnv *env, jclass that, jint arg0, jcharArray arg1, jobject arg2, jcharArray arg3)
+{
+ jchar *lparg1=NULL;
+ RECT _arg2, *lparg2=NULL;
+ jchar *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, CreateEnhMetaFileW_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = getRECTFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = (*env)->GetCharArrayElements(env, arg3, NULL)) == NULL) goto fail;
+ rc = (jint)CreateEnhMetaFileW((HDC)arg0, (LPCWSTR)lparg1, lparg2, (LPCWSTR)lparg3);
+fail:
+ if (arg3 && lparg3) (*env)->ReleaseCharArrayElements(env, arg3, lparg3, 0);
+ if (arg2 && lparg2) setRECTFields(env, arg2, lparg2);
+ if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, CreateEnhMetaFileW_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CreateFontIndirectA__I
JNIEXPORT jint JNICALL OS_NATIVE(CreateFontIndirectA__I)
(JNIEnv *env, jclass that, jint arg0)
@@ -1922,6 +1978,18 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(DeleteDC)
}
#endif
+#ifndef NO_DeleteEnhMetaFile
+JNIEXPORT jboolean JNICALL OS_NATIVE(DeleteEnhMetaFile)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, DeleteEnhMetaFile_FUNC);
+ rc = (jboolean)DeleteEnhMetaFile((HENHMETAFILE)arg0);
+ OS_NATIVE_EXIT(env, that, DeleteEnhMetaFile_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_DeleteMenu
JNIEXPORT jboolean JNICALL OS_NATIVE(DeleteMenu)
(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
@@ -2522,6 +2590,42 @@ fail:
}
#endif
+#ifndef NO_EMREXTCREATEFONTINDIRECTW_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(EMREXTCREATEFONTINDIRECTW_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, EMREXTCREATEFONTINDIRECTW_1sizeof_FUNC);
+ rc = (jint)EMREXTCREATEFONTINDIRECTW_sizeof();
+ OS_NATIVE_EXIT(env, that, EMREXTCREATEFONTINDIRECTW_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_EMR_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(EMR_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, EMR_1sizeof_FUNC);
+ rc = (jint)EMR_sizeof();
+ OS_NATIVE_EXIT(env, that, EMR_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_EXTLOGFONTW_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(EXTLOGFONTW_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, EXTLOGFONTW_1sizeof_FUNC);
+ rc = (jint)EXTLOGFONTW_sizeof();
+ OS_NATIVE_EXIT(env, that, EXTLOGFONTW_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_EXTLOGPEN_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(EXTLOGPEN_1sizeof)
(JNIEnv *env, jclass that)
@@ -2706,6 +2810,22 @@ fail:
}
#endif
+#ifndef NO_EnumEnhMetaFile
+JNIEXPORT jboolean JNICALL OS_NATIVE(EnumEnhMetaFile)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ RECT _arg4, *lparg4=NULL;
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, EnumEnhMetaFile_FUNC);
+ if (arg4) if ((lparg4 = getRECTFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jboolean)EnumEnhMetaFile((HDC)arg0, (HENHMETAFILE)arg1, (ENHMFENUMPROC)arg2, (LPVOID)arg3, lparg4);
+fail:
+ if (arg4 && lparg4) setRECTFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, EnumEnhMetaFile_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_EnumFontFamiliesA
JNIEXPORT jint JNICALL OS_NATIVE(EnumFontFamiliesA)
(JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jint arg2, jint arg3)
@@ -8725,6 +8845,34 @@ fail:
}
#endif
+#ifndef NO_MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II
+JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ EMREXTCREATEFONTINDIRECTW _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II_FUNC);
+ if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail;
+ MoveMemory((PVOID)lparg0, (CONST VOID *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setEMREXTCREATEFONTINDIRECTWFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II_FUNC);
+}
+#endif
+
+#ifndef NO_MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II
+JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ EMR _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II_FUNC);
+ if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail;
+ MoveMemory((PVOID)lparg0, (CONST VOID *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setEMRFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II_FUNC);
+}
+#endif
+
#ifndef NO_MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II
JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II)
(JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
@@ -10245,6 +10393,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(PAINTSTRUCT_1sizeof)
}
#endif
+#ifndef NO_PANOSE_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(PANOSE_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, PANOSE_1sizeof_FUNC);
+ rc = (jint)PANOSE_sizeof();
+ OS_NATIVE_EXIT(env, that, PANOSE_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_POINTSTOPOINT
JNIEXPORT void JNICALL OS_NATIVE(POINTSTOPOINT)
(JNIEnv *env, jclass that, jobject arg0, jint arg1)
@@ -11213,6 +11373,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(SCRIPT_1STATE_1sizeof)
}
#endif
+#ifndef NO_SCRIPT_1STRING_1ANALYSIS_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(SCRIPT_1STRING_1ANALYSIS_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, SCRIPT_1STRING_1ANALYSIS_1sizeof_FUNC);
+ rc = (jint)SCRIPT_STRING_ANALYSIS_sizeof();
+ OS_NATIVE_EXIT(env, that, SCRIPT_1STRING_1ANALYSIS_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_SCROLLBARINFO_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(SCROLLBARINFO_1sizeof)
(JNIEnv *env, jclass that)
@@ -11874,6 +12046,56 @@ fail:
}
#endif
+#ifndef NO_ScriptStringAnalyse
+JNIEXPORT jint JNICALL OS_NATIVE(ScriptStringAnalyse)
+ (JNIEnv *env, jclass that, jint arg0, jcharArray arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jobject arg7, jobject arg8, jint arg9, jint arg10, jint arg11, jint arg12)
+{
+ jchar *lparg1=NULL;
+ SCRIPT_CONTROL _arg7, *lparg7=NULL;
+ SCRIPT_STATE _arg8, *lparg8=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, ScriptStringAnalyse_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = getSCRIPT_CONTROLFields(env, arg7, &_arg7)) == NULL) goto fail;
+ if (arg8) if ((lparg8 = getSCRIPT_STATEFields(env, arg8, &_arg8)) == NULL) goto fail;
+ rc = (jint)ScriptStringAnalyse((HDC)arg0, (const void*)lparg1, arg2, arg3, arg4, arg5, arg6, lparg7, lparg8, (const int*)arg9, (SCRIPT_TABDEF*)arg10, (const BYTE*)arg11, (SCRIPT_STRING_ANALYSIS*)arg12);
+fail:
+ if (arg8 && lparg8) setSCRIPT_STATEFields(env, arg8, lparg8);
+ if (arg7 && lparg7) setSCRIPT_CONTROLFields(env, arg7, lparg7);
+ if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, ScriptStringAnalyse_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_ScriptStringFree
+JNIEXPORT jint JNICALL OS_NATIVE(ScriptStringFree)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, ScriptStringFree_FUNC);
+ rc = (jint)ScriptStringFree((SCRIPT_STRING_ANALYSIS*)arg0);
+ OS_NATIVE_EXIT(env, that, ScriptStringFree_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_ScriptStringOut
+JNIEXPORT jint JNICALL OS_NATIVE(ScriptStringOut)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5, jint arg6, jboolean arg7)
+{
+ RECT _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, ScriptStringOut_FUNC);
+ if (arg4) if ((lparg4 = getRECTFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)ScriptStringOut(*(SCRIPT_STRING_ANALYSIS*)arg0, arg1, arg2, arg3, lparg4, arg5, arg6, arg7);
+fail:
+ if (arg4 && lparg4) setRECTFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, ScriptStringOut_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_ScriptTextOut
JNIEXPORT jint JNICALL OS_NATIVE(ScriptTextOut)
(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5, jobject arg6, jint arg7, jint arg8, jint arg9, jint arg10, jint arg11, jint arg12, jint arg13)
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 735ed3def6..bb235c6a30 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
@@ -9,6 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
+/* Special sizeof's */
+#define SCRIPT_STRING_ANALYSIS_sizeof() sizeof(SCRIPT_STRING_ANALYSIS)
+
/* Libraries for dynamic loaded functions */
#define ActivateActCtx_LIB "kernel32.dll"
#define AddFontResourceExA_LIB "gdi32.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 cf0cf71704..766489f8c7 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 = 939;
-int OS_nativeFunctionCallCount[939];
+int OS_nativeFunctionCount = 954;
+int OS_nativeFunctionCallCount[954];
char * OS_nativeFunctionNames[] = {
"ACCEL_1sizeof",
"ACTCTX_1sizeof",
@@ -68,6 +68,7 @@ char * OS_nativeFunctionNames[] = {
"ChooseFontW",
"ClientToScreen",
"CloseClipboard",
+ "CloseEnhMetaFile",
"CloseHandle",
"CloseThemeData",
"CoCreateInstance",
@@ -96,6 +97,8 @@ char * OS_nativeFunctionNames[] = {
"CreateDCW",
"CreateDIBSection__III_3III",
"CreateDIBSection__I_3BI_3III",
+ "CreateEnhMetaFileA",
+ "CreateEnhMetaFileW",
"CreateFontIndirectA__I",
"CreateFontIndirectA__Lorg_eclipse_swt_internal_win32_LOGFONTA_2",
"CreateFontIndirectW__I",
@@ -130,6 +133,7 @@ char * OS_nativeFunctionNames[] = {
"DefWindowProcW",
"DeferWindowPos",
"DeleteDC",
+ "DeleteEnhMetaFile",
"DeleteMenu",
"DeleteObject",
"DestroyAcceleratorTable",
@@ -161,6 +165,9 @@ char * OS_nativeFunctionNames[] = {
"DrawThemeText",
"DwmEnableBlurBehindWindow",
"DwmExtendFrameIntoClientArea",
+ "EMREXTCREATEFONTINDIRECTW_1sizeof",
+ "EMR_1sizeof",
+ "EXTLOGFONTW_1sizeof",
"EXTLOGPEN_1sizeof",
"Ellipse",
"EnableMenuItem",
@@ -173,6 +180,7 @@ char * OS_nativeFunctionNames[] = {
"EndPaint",
"EndPath",
"EnumDisplayMonitors",
+ "EnumEnhMetaFile",
"EnumFontFamiliesA",
"EnumFontFamiliesExA",
"EnumFontFamiliesExW",
@@ -546,6 +554,8 @@ char * OS_nativeFunctionNames[] = {
"MoveMemory__Lorg_eclipse_swt_internal_win32_BITMAPINFOHEADER_2_3BI",
"MoveMemory__Lorg_eclipse_swt_internal_win32_DOCHOSTUIINFO_2II",
"MoveMemory__Lorg_eclipse_swt_internal_win32_DRAWITEMSTRUCT_2II",
+ "MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II",
+ "MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II",
"MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II",
"MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2II",
"MoveMemory__Lorg_eclipse_swt_internal_win32_HELPINFO_2II",
@@ -645,6 +655,7 @@ char * OS_nativeFunctionNames[] = {
"OpenClipboard",
"OpenThemeData",
"PAINTSTRUCT_1sizeof",
+ "PANOSE_1sizeof",
"POINTSTOPOINT",
"POINT_1sizeof",
"PRIMARYLANGID",
@@ -704,6 +715,7 @@ char * OS_nativeFunctionNames[] = {
"SCRIPT_1LOGATTR_1sizeof",
"SCRIPT_1PROPERTIES_1sizeof",
"SCRIPT_1STATE_1sizeof",
+ "SCRIPT_1STRING_1ANALYSIS_1sizeof",
"SCROLLBARINFO_1sizeof",
"SCROLLINFO_1sizeof",
"SHACTIVATEINFO_1sizeof",
@@ -747,6 +759,9 @@ char * OS_nativeFunctionNames[] = {
"ScriptPlace",
"ScriptRecordDigitSubstitution",
"ScriptShape",
+ "ScriptStringAnalyse",
+ "ScriptStringFree",
+ "ScriptStringOut",
"ScriptTextOut",
"ScriptXtoCP",
"ScrollWindowEx",
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 5f792ece28..3db6152729 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
@@ -76,6 +76,7 @@ typedef enum {
ChooseFontW_FUNC,
ClientToScreen_FUNC,
CloseClipboard_FUNC,
+ CloseEnhMetaFile_FUNC,
CloseHandle_FUNC,
CloseThemeData_FUNC,
CoCreateInstance_FUNC,
@@ -104,6 +105,8 @@ typedef enum {
CreateDCW_FUNC,
CreateDIBSection__III_3III_FUNC,
CreateDIBSection__I_3BI_3III_FUNC,
+ CreateEnhMetaFileA_FUNC,
+ CreateEnhMetaFileW_FUNC,
CreateFontIndirectA__I_FUNC,
CreateFontIndirectA__Lorg_eclipse_swt_internal_win32_LOGFONTA_2_FUNC,
CreateFontIndirectW__I_FUNC,
@@ -138,6 +141,7 @@ typedef enum {
DefWindowProcW_FUNC,
DeferWindowPos_FUNC,
DeleteDC_FUNC,
+ DeleteEnhMetaFile_FUNC,
DeleteMenu_FUNC,
DeleteObject_FUNC,
DestroyAcceleratorTable_FUNC,
@@ -169,6 +173,9 @@ typedef enum {
DrawThemeText_FUNC,
DwmEnableBlurBehindWindow_FUNC,
DwmExtendFrameIntoClientArea_FUNC,
+ EMREXTCREATEFONTINDIRECTW_1sizeof_FUNC,
+ EMR_1sizeof_FUNC,
+ EXTLOGFONTW_1sizeof_FUNC,
EXTLOGPEN_1sizeof_FUNC,
Ellipse_FUNC,
EnableMenuItem_FUNC,
@@ -181,6 +188,7 @@ typedef enum {
EndPaint_FUNC,
EndPath_FUNC,
EnumDisplayMonitors_FUNC,
+ EnumEnhMetaFile_FUNC,
EnumFontFamiliesA_FUNC,
EnumFontFamiliesExA_FUNC,
EnumFontFamiliesExW_FUNC,
@@ -554,6 +562,8 @@ typedef enum {
MoveMemory__Lorg_eclipse_swt_internal_win32_BITMAPINFOHEADER_2_3BI_FUNC,
MoveMemory__Lorg_eclipse_swt_internal_win32_DOCHOSTUIINFO_2II_FUNC,
MoveMemory__Lorg_eclipse_swt_internal_win32_DRAWITEMSTRUCT_2II_FUNC,
+ MoveMemory__Lorg_eclipse_swt_internal_win32_EMREXTCREATEFONTINDIRECTW_2II_FUNC,
+ MoveMemory__Lorg_eclipse_swt_internal_win32_EMR_2II_FUNC,
MoveMemory__Lorg_eclipse_swt_internal_win32_EXTLOGPEN_2II_FUNC,
MoveMemory__Lorg_eclipse_swt_internal_win32_HDITEM_2II_FUNC,
MoveMemory__Lorg_eclipse_swt_internal_win32_HELPINFO_2II_FUNC,
@@ -653,6 +663,7 @@ typedef enum {
OpenClipboard_FUNC,
OpenThemeData_FUNC,
PAINTSTRUCT_1sizeof_FUNC,
+ PANOSE_1sizeof_FUNC,
POINTSTOPOINT_FUNC,
POINT_1sizeof_FUNC,
PRIMARYLANGID_FUNC,
@@ -712,6 +723,7 @@ typedef enum {
SCRIPT_1LOGATTR_1sizeof_FUNC,
SCRIPT_1PROPERTIES_1sizeof_FUNC,
SCRIPT_1STATE_1sizeof_FUNC,
+ SCRIPT_1STRING_1ANALYSIS_1sizeof_FUNC,
SCROLLBARINFO_1sizeof_FUNC,
SCROLLINFO_1sizeof_FUNC,
SHACTIVATEINFO_1sizeof_FUNC,
@@ -755,6 +767,9 @@ typedef enum {
ScriptPlace_FUNC,
ScriptRecordDigitSubstitution_FUNC,
ScriptShape_FUNC,
+ ScriptStringAnalyse_FUNC,
+ ScriptStringFree_FUNC,
+ ScriptStringOut_FUNC,
ScriptTextOut_FUNC,
ScriptXtoCP_FUNC,
ScrollWindowEx_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 21e1c5c9fc..26817b463d 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
@@ -1101,6 +1101,177 @@ void setDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpSt
}
#endif
+#ifndef NO_EMR
+typedef struct EMR_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID iType, nSize;
+} EMR_FID_CACHE;
+
+EMR_FID_CACHE EMRFc;
+
+void cacheEMRFields(JNIEnv *env, jobject lpObject)
+{
+ if (EMRFc.cached) return;
+ EMRFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ EMRFc.iType = (*env)->GetFieldID(env, EMRFc.clazz, "iType", "I");
+ EMRFc.nSize = (*env)->GetFieldID(env, EMRFc.clazz, "nSize", "I");
+ EMRFc.cached = 1;
+}
+
+EMR *getEMRFields(JNIEnv *env, jobject lpObject, EMR *lpStruct)
+{
+ if (!EMRFc.cached) cacheEMRFields(env, lpObject);
+ lpStruct->iType = (*env)->GetIntField(env, lpObject, EMRFc.iType);
+ lpStruct->nSize = (*env)->GetIntField(env, lpObject, EMRFc.nSize);
+ return lpStruct;
+}
+
+void setEMRFields(JNIEnv *env, jobject lpObject, EMR *lpStruct)
+{
+ if (!EMRFc.cached) cacheEMRFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, EMRFc.iType, (jint)lpStruct->iType);
+ (*env)->SetIntField(env, lpObject, EMRFc.nSize, (jint)lpStruct->nSize);
+}
+#endif
+
+#ifndef NO_EMREXTCREATEFONTINDIRECTW
+typedef struct EMREXTCREATEFONTINDIRECTW_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID emr, ihFont, elfw;
+} EMREXTCREATEFONTINDIRECTW_FID_CACHE;
+
+EMREXTCREATEFONTINDIRECTW_FID_CACHE EMREXTCREATEFONTINDIRECTWFc;
+
+void cacheEMREXTCREATEFONTINDIRECTWFields(JNIEnv *env, jobject lpObject)
+{
+ if (EMREXTCREATEFONTINDIRECTWFc.cached) return;
+ EMREXTCREATEFONTINDIRECTWFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ EMREXTCREATEFONTINDIRECTWFc.emr = (*env)->GetFieldID(env, EMREXTCREATEFONTINDIRECTWFc.clazz, "emr", "Lorg/eclipse/swt/internal/win32/EMR;");
+ EMREXTCREATEFONTINDIRECTWFc.ihFont = (*env)->GetFieldID(env, EMREXTCREATEFONTINDIRECTWFc.clazz, "ihFont", "I");
+ EMREXTCREATEFONTINDIRECTWFc.elfw = (*env)->GetFieldID(env, EMREXTCREATEFONTINDIRECTWFc.clazz, "elfw", "Lorg/eclipse/swt/internal/win32/EXTLOGFONTW;");
+ EMREXTCREATEFONTINDIRECTWFc.cached = 1;
+}
+
+EMREXTCREATEFONTINDIRECTW *getEMREXTCREATEFONTINDIRECTWFields(JNIEnv *env, jobject lpObject, EMREXTCREATEFONTINDIRECTW *lpStruct)
+{
+ if (!EMREXTCREATEFONTINDIRECTWFc.cached) cacheEMREXTCREATEFONTINDIRECTWFields(env, lpObject);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EMREXTCREATEFONTINDIRECTWFc.emr);
+ if (lpObject1 != NULL) getEMRFields(env, lpObject1, &lpStruct->emr);
+ }
+ lpStruct->ihFont = (*env)->GetIntField(env, lpObject, EMREXTCREATEFONTINDIRECTWFc.ihFont);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EMREXTCREATEFONTINDIRECTWFc.elfw);
+ if (lpObject1 != NULL) getEXTLOGFONTWFields(env, lpObject1, &lpStruct->elfw);
+ }
+ return lpStruct;
+}
+
+void setEMREXTCREATEFONTINDIRECTWFields(JNIEnv *env, jobject lpObject, EMREXTCREATEFONTINDIRECTW *lpStruct)
+{
+ if (!EMREXTCREATEFONTINDIRECTWFc.cached) cacheEMREXTCREATEFONTINDIRECTWFields(env, lpObject);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EMREXTCREATEFONTINDIRECTWFc.emr);
+ if (lpObject1 != NULL) setEMRFields(env, lpObject1, &lpStruct->emr);
+ }
+ (*env)->SetIntField(env, lpObject, EMREXTCREATEFONTINDIRECTWFc.ihFont, (jint)lpStruct->ihFont);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EMREXTCREATEFONTINDIRECTWFc.elfw);
+ if (lpObject1 != NULL) setEXTLOGFONTWFields(env, lpObject1, &lpStruct->elfw);
+ }
+}
+#endif
+
+#ifndef NO_EXTLOGFONTW
+typedef struct EXTLOGFONTW_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID elfLogFont, elfFullName, elfStyle, elfVersion, elfStyleSize, elfMatch, elfReserved, elfVendorId, elfCulture, elfPanose;
+} EXTLOGFONTW_FID_CACHE;
+
+EXTLOGFONTW_FID_CACHE EXTLOGFONTWFc;
+
+void cacheEXTLOGFONTWFields(JNIEnv *env, jobject lpObject)
+{
+ if (EXTLOGFONTWFc.cached) return;
+ EXTLOGFONTWFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ EXTLOGFONTWFc.elfLogFont = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfLogFont", "Lorg/eclipse/swt/internal/win32/LOGFONTW;");
+ EXTLOGFONTWFc.elfFullName = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfFullName", "[C");
+ EXTLOGFONTWFc.elfStyle = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfStyle", "[C");
+ EXTLOGFONTWFc.elfVersion = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfVersion", "I");
+ EXTLOGFONTWFc.elfStyleSize = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfStyleSize", "I");
+ EXTLOGFONTWFc.elfMatch = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfMatch", "I");
+ EXTLOGFONTWFc.elfReserved = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfReserved", "I");
+ EXTLOGFONTWFc.elfVendorId = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfVendorId", "[B");
+ EXTLOGFONTWFc.elfCulture = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfCulture", "I");
+ EXTLOGFONTWFc.elfPanose = (*env)->GetFieldID(env, EXTLOGFONTWFc.clazz, "elfPanose", "Lorg/eclipse/swt/internal/win32/PANOSE;");
+ EXTLOGFONTWFc.cached = 1;
+}
+
+EXTLOGFONTW *getEXTLOGFONTWFields(JNIEnv *env, jobject lpObject, EXTLOGFONTW *lpStruct)
+{
+ if (!EXTLOGFONTWFc.cached) cacheEXTLOGFONTWFields(env, lpObject);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfLogFont);
+ if (lpObject1 != NULL) getLOGFONTWFields(env, lpObject1, &lpStruct->elfLogFont);
+ }
+ {
+ jcharArray lpObject1 = (jcharArray)(*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfFullName);
+ (*env)->GetCharArrayRegion(env, lpObject1, 0, sizeof(lpStruct->elfFullName) / 2, (jchar *)lpStruct->elfFullName);
+ }
+ {
+ jcharArray lpObject1 = (jcharArray)(*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfStyle);
+ (*env)->GetCharArrayRegion(env, lpObject1, 0, sizeof(lpStruct->elfStyle) / 2, (jchar *)lpStruct->elfStyle);
+ }
+ lpStruct->elfVersion = (*env)->GetIntField(env, lpObject, EXTLOGFONTWFc.elfVersion);
+ lpStruct->elfStyleSize = (*env)->GetIntField(env, lpObject, EXTLOGFONTWFc.elfStyleSize);
+ lpStruct->elfMatch = (*env)->GetIntField(env, lpObject, EXTLOGFONTWFc.elfMatch);
+ lpStruct->elfReserved = (*env)->GetIntField(env, lpObject, EXTLOGFONTWFc.elfReserved);
+ {
+ jbyteArray lpObject1 = (jbyteArray)(*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfVendorId);
+ (*env)->GetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->elfVendorId), (jbyte *)lpStruct->elfVendorId);
+ }
+ lpStruct->elfCulture = (*env)->GetIntField(env, lpObject, EXTLOGFONTWFc.elfCulture);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfPanose);
+ if (lpObject1 != NULL) getPANOSEFields(env, lpObject1, &lpStruct->elfPanose);
+ }
+ return lpStruct;
+}
+
+void setEXTLOGFONTWFields(JNIEnv *env, jobject lpObject, EXTLOGFONTW *lpStruct)
+{
+ if (!EXTLOGFONTWFc.cached) cacheEXTLOGFONTWFields(env, lpObject);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfLogFont);
+ if (lpObject1 != NULL) setLOGFONTWFields(env, lpObject1, &lpStruct->elfLogFont);
+ }
+ {
+ jcharArray lpObject1 = (jcharArray)(*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfFullName);
+ (*env)->SetCharArrayRegion(env, lpObject1, 0, sizeof(lpStruct->elfFullName) / 2, (jchar *)lpStruct->elfFullName);
+ }
+ {
+ jcharArray lpObject1 = (jcharArray)(*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfStyle);
+ (*env)->SetCharArrayRegion(env, lpObject1, 0, sizeof(lpStruct->elfStyle) / 2, (jchar *)lpStruct->elfStyle);
+ }
+ (*env)->SetIntField(env, lpObject, EXTLOGFONTWFc.elfVersion, (jint)lpStruct->elfVersion);
+ (*env)->SetIntField(env, lpObject, EXTLOGFONTWFc.elfStyleSize, (jint)lpStruct->elfStyleSize);
+ (*env)->SetIntField(env, lpObject, EXTLOGFONTWFc.elfMatch, (jint)lpStruct->elfMatch);
+ (*env)->SetIntField(env, lpObject, EXTLOGFONTWFc.elfReserved, (jint)lpStruct->elfReserved);
+ {
+ jbyteArray lpObject1 = (jbyteArray)(*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfVendorId);
+ (*env)->SetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->elfVendorId), (jbyte *)lpStruct->elfVendorId);
+ }
+ (*env)->SetIntField(env, lpObject, EXTLOGFONTWFc.elfCulture, (jint)lpStruct->elfCulture);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, EXTLOGFONTWFc.elfPanose);
+ if (lpObject1 != NULL) setPANOSEFields(env, lpObject1, &lpStruct->elfPanose);
+ }
+}
+#endif
+
#ifndef NO_EXTLOGPEN
typedef struct EXTLOGPEN_FID_CACHE {
int cached;
@@ -5437,6 +5608,64 @@ void setPAINTSTRUCTFields(JNIEnv *env, jobject lpObject, PAINTSTRUCT *lpStruct)
}
#endif
+#ifndef NO_PANOSE
+typedef struct PANOSE_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID bFamilyType, bSerifStyle, bWeight, bProportion, bContrast, bStrokeVariation, bArmStyle, bLetterform, bMidline, bXHeight;
+} PANOSE_FID_CACHE;
+
+PANOSE_FID_CACHE PANOSEFc;
+
+void cachePANOSEFields(JNIEnv *env, jobject lpObject)
+{
+ if (PANOSEFc.cached) return;
+ PANOSEFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ PANOSEFc.bFamilyType = (*env)->GetFieldID(env, PANOSEFc.clazz, "bFamilyType", "B");
+ PANOSEFc.bSerifStyle = (*env)->GetFieldID(env, PANOSEFc.clazz, "bSerifStyle", "B");
+ PANOSEFc.bWeight = (*env)->GetFieldID(env, PANOSEFc.clazz, "bWeight", "B");
+ PANOSEFc.bProportion = (*env)->GetFieldID(env, PANOSEFc.clazz, "bProportion", "B");
+ PANOSEFc.bContrast = (*env)->GetFieldID(env, PANOSEFc.clazz, "bContrast", "B");
+ PANOSEFc.bStrokeVariation = (*env)->GetFieldID(env, PANOSEFc.clazz, "bStrokeVariation", "B");
+ PANOSEFc.bArmStyle = (*env)->GetFieldID(env, PANOSEFc.clazz, "bArmStyle", "B");
+ PANOSEFc.bLetterform = (*env)->GetFieldID(env, PANOSEFc.clazz, "bLetterform", "B");
+ PANOSEFc.bMidline = (*env)->GetFieldID(env, PANOSEFc.clazz, "bMidline", "B");
+ PANOSEFc.bXHeight = (*env)->GetFieldID(env, PANOSEFc.clazz, "bXHeight", "B");
+ PANOSEFc.cached = 1;
+}
+
+PANOSE *getPANOSEFields(JNIEnv *env, jobject lpObject, PANOSE *lpStruct)
+{
+ if (!PANOSEFc.cached) cachePANOSEFields(env, lpObject);
+ lpStruct->bFamilyType = (*env)->GetByteField(env, lpObject, PANOSEFc.bFamilyType);
+ lpStruct->bSerifStyle = (*env)->GetByteField(env, lpObject, PANOSEFc.bSerifStyle);
+ lpStruct->bWeight = (*env)->GetByteField(env, lpObject, PANOSEFc.bWeight);
+ lpStruct->bProportion = (*env)->GetByteField(env, lpObject, PANOSEFc.bProportion);
+ lpStruct->bContrast = (*env)->GetByteField(env, lpObject, PANOSEFc.bContrast);
+ lpStruct->bStrokeVariation = (*env)->GetByteField(env, lpObject, PANOSEFc.bStrokeVariation);
+ lpStruct->bArmStyle = (*env)->GetByteField(env, lpObject, PANOSEFc.bArmStyle);
+ lpStruct->bLetterform = (*env)->GetByteField(env, lpObject, PANOSEFc.bLetterform);
+ lpStruct->bMidline = (*env)->GetByteField(env, lpObject, PANOSEFc.bMidline);
+ lpStruct->bXHeight = (*env)->GetByteField(env, lpObject, PANOSEFc.bXHeight);
+ return lpStruct;
+}
+
+void setPANOSEFields(JNIEnv *env, jobject lpObject, PANOSE *lpStruct)
+{
+ if (!PANOSEFc.cached) cachePANOSEFields(env, lpObject);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bFamilyType, (jbyte)lpStruct->bFamilyType);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bSerifStyle, (jbyte)lpStruct->bSerifStyle);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bWeight, (jbyte)lpStruct->bWeight);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bProportion, (jbyte)lpStruct->bProportion);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bContrast, (jbyte)lpStruct->bContrast);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bStrokeVariation, (jbyte)lpStruct->bStrokeVariation);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bArmStyle, (jbyte)lpStruct->bArmStyle);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bLetterform, (jbyte)lpStruct->bLetterform);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bMidline, (jbyte)lpStruct->bMidline);
+ (*env)->SetByteField(env, lpObject, PANOSEFc.bXHeight, (jbyte)lpStruct->bXHeight);
+}
+#endif
+
#ifndef NO_POINT
typedef struct POINT_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 39b4dde59d..094e3d60ed 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
@@ -263,6 +263,42 @@ void setDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpSt
#define DWM_BLURBEHIND_sizeof() 0
#endif
+#ifndef NO_EMR
+void cacheEMRFields(JNIEnv *env, jobject lpObject);
+EMR *getEMRFields(JNIEnv *env, jobject lpObject, EMR *lpStruct);
+void setEMRFields(JNIEnv *env, jobject lpObject, EMR *lpStruct);
+#define EMR_sizeof() sizeof(EMR)
+#else
+#define cacheEMRFields(a,b)
+#define getEMRFields(a,b,c) NULL
+#define setEMRFields(a,b,c)
+#define EMR_sizeof() 0
+#endif
+
+#ifndef NO_EMREXTCREATEFONTINDIRECTW
+void cacheEMREXTCREATEFONTINDIRECTWFields(JNIEnv *env, jobject lpObject);
+EMREXTCREATEFONTINDIRECTW *getEMREXTCREATEFONTINDIRECTWFields(JNIEnv *env, jobject lpObject, EMREXTCREATEFONTINDIRECTW *lpStruct);
+void setEMREXTCREATEFONTINDIRECTWFields(JNIEnv *env, jobject lpObject, EMREXTCREATEFONTINDIRECTW *lpStruct);
+#define EMREXTCREATEFONTINDIRECTW_sizeof() sizeof(EMREXTCREATEFONTINDIRECTW)
+#else
+#define cacheEMREXTCREATEFONTINDIRECTWFields(a,b)
+#define getEMREXTCREATEFONTINDIRECTWFields(a,b,c) NULL
+#define setEMREXTCREATEFONTINDIRECTWFields(a,b,c)
+#define EMREXTCREATEFONTINDIRECTW_sizeof() 0
+#endif
+
+#ifndef NO_EXTLOGFONTW
+void cacheEXTLOGFONTWFields(JNIEnv *env, jobject lpObject);
+EXTLOGFONTW *getEXTLOGFONTWFields(JNIEnv *env, jobject lpObject, EXTLOGFONTW *lpStruct);
+void setEXTLOGFONTWFields(JNIEnv *env, jobject lpObject, EXTLOGFONTW *lpStruct);
+#define EXTLOGFONTW_sizeof() sizeof(EXTLOGFONTW)
+#else
+#define cacheEXTLOGFONTWFields(a,b)
+#define getEXTLOGFONTWFields(a,b,c) NULL
+#define setEXTLOGFONTWFields(a,b,c)
+#define EXTLOGFONTW_sizeof() 0
+#endif
+
#ifndef NO_EXTLOGPEN
void cacheEXTLOGPENFields(JNIEnv *env, jobject lpObject);
EXTLOGPEN *getEXTLOGPENFields(JNIEnv *env, jobject lpObject, EXTLOGPEN *lpStruct);
@@ -1139,6 +1175,18 @@ void setPAINTSTRUCTFields(JNIEnv *env, jobject lpObject, PAINTSTRUCT *lpStruct);
#define PAINTSTRUCT_sizeof() 0
#endif
+#ifndef NO_PANOSE
+void cachePANOSEFields(JNIEnv *env, jobject lpObject);
+PANOSE *getPANOSEFields(JNIEnv *env, jobject lpObject, PANOSE *lpStruct);
+void setPANOSEFields(JNIEnv *env, jobject lpObject, PANOSE *lpStruct);
+#define PANOSE_sizeof() sizeof(PANOSE)
+#else
+#define cachePANOSEFields(a,b)
+#define getPANOSEFields(a,b,c) NULL
+#define setPANOSEFields(a,b,c)
+#define PANOSE_sizeof() 0
+#endif
+
#ifndef NO_POINT
void cachePOINTFields(JNIEnv *env, jobject lpObject);
POINT *getPOINTFields(JNIEnv *env, jobject lpObject, POINT *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMR.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMR.java
new file mode 100644
index 0000000000..ed534b4f7f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMR.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 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 EMR {
+ public int iType;
+ public int nSize;
+ public static final int sizeof = OS.EMR_sizeof ();
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMREXTCREATEFONTINDIRECTW.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMREXTCREATEFONTINDIRECTW.java
new file mode 100644
index 0000000000..22172024a6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EMREXTCREATEFONTINDIRECTW.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 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 EMREXTCREATEFONTINDIRECTW {
+ public EMR emr = new EMR();
+ public int ihFont;
+ public EXTLOGFONTW elfw = new EXTLOGFONTW();
+ public static final int sizeof = OS.EMREXTCREATEFONTINDIRECTW_sizeof ();
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EXTLOGFONTW.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EXTLOGFONTW.java
new file mode 100644
index 0000000000..bb1435751e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/EXTLOGFONTW.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 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 EXTLOGFONTW {
+ public LOGFONTW elfLogFont = new LOGFONTW();
+ public char[] elfFullName = new char[OS.LF_FULLFACESIZE];
+ public char[] elfStyle = new char[OS.LF_FACESIZE];
+ public int elfVersion;
+ public int elfStyleSize;
+ public int elfMatch;
+ public int elfReserved;
+ public byte[] elfVendorId = new byte[OS.ELF_VENDOR_SIZE];
+ public int elfCulture;
+ public PANOSE elfPanose = new PANOSE();
+ public static final int sizeof = OS.EXTLOGFONTW_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 a8bb427863..80214228d1 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
@@ -589,6 +589,7 @@ public class OS extends C {
public static final int EDGE_SUNKEN = (BDR_SUNKENOUTER | BDR_SUNKENINNER);
public static final int EDGE_ETCHED = (BDR_SUNKENOUTER | BDR_RAISEDINNER);
public static final int EDGE_BUMP = (BDR_RAISEDOUTER | BDR_SUNKENINNER);
+ public static final int ELF_VENDOR_SIZE = 4;
public static final int EM_CANUNDO = 0xc6;
public static final int EM_CHARFROMPOS = 0xd7;
public static final int EM_DISPLAYBAND = 0x433;
@@ -619,6 +620,8 @@ public class OS extends C {
public static final int EM_SETSEL = 0xb1;
public static final int EM_SETTABSTOPS = 0xcb;
public static final int EM_UNDO = 199;
+ public static final int EMR_EXTCREATEFONTINDIRECTW = 82;
+ public static final int EMR_EXTTEXTOUTW = 84;
public static final int EN_ALIGN_LTR_EC = 0x0700;
public static final int EN_ALIGN_RTL_EC = 0x0701;
public static final int EN_CHANGE = 0x300;
@@ -886,6 +889,7 @@ public class OS extends C {
public static final int LB_SETHORIZONTALEXTENT = 0x194;
public static final int LB_SETSEL = 0x185;
public static final int LB_SETTOPINDEX = 0x197;
+ public static final int LF_FULLFACESIZE = 64;
public static final int LF_FACESIZE = 32;
public static final int LGRPID_ARABIC = 0xd;
public static final int LGRPID_HEBREW = 0xc;
@@ -1478,6 +1482,10 @@ public class OS extends C {
public static final int SS_OWNERDRAW = 0xd;
public static final int SS_REALSIZEIMAGE = 0x800;
public static final int SS_RIGHT = 0x2;
+ public static final int SSA_FALLBACK = 0x00000020;
+ public static final int SSA_GLYPHS = 0x00000080;
+ public static final int SSA_METAFILE = 0x00000800;
+ public static final int SSA_LINK = 0x00001000;
public static final int STANDARD_RIGHTS_READ = 0x20000;
public static final int STARTF_USESHOWWINDOW = 0x1;
public static final int STATE_SYSTEM_INVISIBLE = 0x00008000;
@@ -2119,6 +2127,9 @@ public static final native int DOCINFO_sizeof ();
public static final native int DRAWITEMSTRUCT_sizeof ();
public static final native int DROPFILES_sizeof ();
public static final native int DWM_BLURBEHIND_sizeof ();
+public static final native int EMR_sizeof ();
+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 GCP_RESULTS_sizeof ();
@@ -2185,6 +2196,7 @@ public static final native int OSVERSIONINFOEXW_sizeof ();
public static final native int OUTLINETEXTMETRICA_sizeof ();
public static final native int OUTLINETEXTMETRICW_sizeof ();
public static final native int PAINTSTRUCT_sizeof ();
+public static final native int PANOSE_sizeof ();
public static final native int POINT_sizeof ();
public static final native int PRINTDLG_sizeof ();
public static final native int PROCESS_INFORMATION_sizeof ();
@@ -2198,6 +2210,7 @@ public static final native int SCRIPT_ITEM_sizeof ();
public static final native int SCRIPT_LOGATTR_sizeof ();
public static final native int SCRIPT_PROPERTIES_sizeof ();
public static final native int SCRIPT_STATE_sizeof ();
+public static final native int SCRIPT_STRING_ANALYSIS_sizeof ();
public static final native int SCROLLBARINFO_sizeof ();
public static final native int SCROLLINFO_sizeof ();
public static final native int SHACTIVATEINFO_sizeof ();
@@ -2302,6 +2315,17 @@ public static final int /*long*/ CreateDC (TCHAR lpszDriver, TCHAR lpszDevice, i
return CreateDCA (lpszDriver1, lpszDevice1, lpszOutput, lpInitData);
}
+public static final int /*long*/ CreateEnhMetaFile (int /*long*/ hdcRef, TCHAR lpFilename, RECT lpRect, TCHAR lpDescription) {
+ if (IsUnicode) {
+ char [] lpFilename1 = lpFilename == null ? null : lpFilename.chars;
+ char [] lpDescription1 = lpDescription == null ? null : lpDescription.chars;
+ return CreateEnhMetaFileW (hdcRef, lpFilename1, lpRect, lpDescription1);
+ }
+ byte [] lpFilename1 = lpFilename == null ? null : lpFilename.bytes;
+ byte [] lpDescription1 = lpDescription == null ? null : lpDescription.bytes;
+ return CreateEnhMetaFileA (hdcRef, lpFilename1, lpRect, lpDescription1);
+}
+
public static final int /*long*/ CreateFontIndirect (int /*long*/ lplf) {
if (IsUnicode) return CreateFontIndirectW (lplf);
return CreateFontIndirectA (lplf);
@@ -3257,6 +3281,7 @@ public static final native boolean ChooseFontW (CHOOSEFONT chooseFont);
public static final native boolean ChooseFontA (CHOOSEFONT chooseFont);
public static final native boolean ClientToScreen (int /*long*/ hWnd, POINT lpPoint);
public static final native boolean CloseClipboard ();
+public static final native int /*long*/ CloseEnhMetaFile (int /*long*/ hdc);
public static final native boolean CloseHandle (int /*long*/ hObject);
public static final native int CloseThemeData (int /*long*/ hTheme);
public static final native int CoCreateInstance (byte[] rclsid, int /*long*/ pUnkOuter, int dwClsContext, byte[] riid, int /*long*/[] ppv);
@@ -3285,6 +3310,8 @@ public static final native int /*long*/ CreateDCW (char [] lpszDriver, char [] l
public static final native int /*long*/ CreateDCA (byte [] lpszDriver, byte [] lpszDevice, int /*long*/ lpszOutput, int /*long*/ lpInitData);
public static final native int /*long*/ CreateDIBSection(int /*long*/ hdc, byte[] pbmi, int iUsage, int /*long*/[] ppvBits, int /*long*/ hSection, int dwOffset);
public static final native int /*long*/ CreateDIBSection(int /*long*/ hdc, int /*long*/ pbmi, int iUsage, int /*long*/[] ppvBits, int /*long*/ hSection, int dwOffset);
+public static final native int /*long*/ CreateEnhMetaFileW(int /*long*/ hdcRef, char[] lpFilename, RECT lpRect, char[] lpDescription);
+public static final native int /*long*/ CreateEnhMetaFileA(int /*long*/ hdcRef, byte[] lpFilename, RECT lpRect, byte[] lpDescription);
public static final native int /*long*/ CreateFontIndirectW (int /*long*/ lplf);
public static final native int /*long*/ CreateFontIndirectA (int /*long*/ lplf);
public static final native int /*long*/ CreateFontIndirectW (LOGFONTW lplf);
@@ -3311,6 +3338,7 @@ public static final native int /*long*/ DefFrameProcA (int /*long*/ hWnd, int /*
public static final native int /*long*/ DefWindowProcW (int /*long*/ hWnd, int Msg, int /*long*/ wParam, int /*long*/ lParam);
public static final native int /*long*/ DefWindowProcA (int /*long*/ hWnd, int Msg, int /*long*/ wParam, int /*long*/ lParam);
public static final native boolean DeleteDC (int /*long*/ hdc);
+public static final native boolean DeleteEnhMetaFile (int /*long*/ hemf);
public static final native boolean DeleteMenu (int /*long*/ hMenu, int uPosition, int uFlags);
public static final native boolean DeleteObject (int /*long*/ hGdiObj);
public static final native boolean DestroyAcceleratorTable (int /*long*/ hAccel);
@@ -3358,6 +3386,7 @@ public static final native int EndPage (int /*long*/ hdc);
public static final native int EndPaint (int /*long*/ hWnd, PAINTSTRUCT lpPaint);
public static final native boolean EndPath(int /*long*/ hdc);
public static final native boolean EnumDisplayMonitors (int /*long*/ hdc, RECT lprcClip, int /*long*/ lpfnEnum, int dwData);
+public static final native boolean EnumEnhMetaFile(int /*long*/ hdc, int /*long*/ hemf, int /*long*/ lpEnhMetaFunc, int /*long*/ lpData, RECT lpRect);
public static final native int EnumFontFamiliesW (int /*long*/ hdc, char [] lpszFamily, int /*long*/ lpEnumFontFamProc, int /*long*/ lParam);
public static final native int EnumFontFamiliesA (int /*long*/ hdc, byte [] lpszFamily, int /*long*/ lpEnumFontFamProc, int /*long*/ lParam);
public static final native int EnumFontFamiliesExW (int /*long*/ hdc, LOGFONTW lpLogfont, int /*long*/ lpEnumFontFamExProc, int /*long*/ lParam, int dwFlags);
@@ -3734,6 +3763,8 @@ public static final native void MoveMemory (NMTTDISPINFOW Destination, int /*lon
public static final native void MoveMemory (NMTTDISPINFOA Destination, int /*long*/ Source, int Length);
public static final native void MoveMemory (RECT Destination, int /*long*/[] Source, int Length);
public static final native void MoveMemory (SHDRAGIMAGE Destination, int /*long*/ Source, int Length);
+public static final native void MoveMemory (EMR Destination, int /*long*/ Source, int Length);
+public static final native void MoveMemory (EMREXTCREATEFONTINDIRECTW Destination, int /*long*/ Source, int Length);
public static final native void MoveMemory (int /*long*/ Destination, SHDRAGIMAGE Source, int Length);
public static final native void MoveMemory (TEXTMETRICW Destination, int /*long*/ Source, int Length);
public static final native void MoveMemory (TEXTMETRICA Destination, int /*long*/ Source, int Length);
@@ -3825,6 +3856,9 @@ public static final native int ScriptPlace (int /*long*/ hdc, int /*long*/ psc,
public static final native int ScriptRecordDigitSubstitution (int Locale, SCRIPT_DIGITSUBSTITUTE psds);
public static final native int ScriptGetCMap (int /*long*/ hdc, int /*long*/ psc, char[] pwcChars, int cChars, int dwFlags, short[] pwOutGlyphs);
public static final native int ScriptShape (int /*long*/ hdc, int /*long*/ psc, char[] pwcChars, int cChars, int cMaxGlyphs, SCRIPT_ANALYSIS psa, int /*long*/ pwOutGlyphs, int /*long*/ pwLogClust, int /*long*/ psva, int[] pcGlyphs);
+public static final native int ScriptStringAnalyse (int /*long*/ hdc, char[] pString, int cString, int cGlyphs, int iCharset, int dwFlags, int iReqWidth, SCRIPT_CONTROL psControl, SCRIPT_STATE psState, int /*long*/ piDx, int /*long*/ pTabdef, int /*long*/ pbInClass, int /*long*/ pssa);
+public static final native int ScriptStringOut(int /*long*/ ssa, int iX, int iY, int uOptions, RECT prc, int iMinSel, int iMaxSel, boolean fDisabled);
+public static final native int ScriptStringFree(int /*long*/ pssa);
public static final native int ScriptTextOut (int /*long*/ hdc, int /*long*/ psc, int x, int y, int fuOptions, RECT lprc, SCRIPT_ANALYSIS psa, int /*long*/ pwcReserved, int iReserved, int /*long*/ pwGlyphs, int cGlyphs, int /*long*/ piAdvance, int /*long*/ piJustify, int /*long*/ pGoffset);
public static final native int ScriptXtoCP (int iX, int cChars, int cGlyphs, int /*long*/ pwLogClust, int /*long*/ psva, int /*long*/ piAdvance, SCRIPT_ANALYSIS psa, int[] piCP, int[] piTrailing);
public static final native int ScrollWindowEx (int /*long*/ hWnd, int dx, int dy, RECT prcScroll, RECT prcClip, int /*long*/ hrgnUpdate, RECT prcUpdate, int flags);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/PANOSE.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/PANOSE.java
new file mode 100644
index 0000000000..cc41b86997
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/PANOSE.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 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 PANOSE {
+ public byte bFamilyType;
+ public byte bSerifStyle;
+ public byte bWeight;
+ public byte bProportion;
+ public byte bContrast;
+ public byte bStrokeVariation;
+ public byte bArmStyle;
+ public byte bLetterform;
+ public byte bMidline;
+ public byte bXHeight;
+ public static final int sizeof = OS.PANOSE_sizeof ();
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index d0b12027cb..28609c333d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -68,7 +68,7 @@ public final class TextLayout extends Resource {
class StyleItem {
TextStyle style;
int start, length;
- boolean lineBreak, softBreak, tab, mlang;
+ boolean lineBreak, softBreak, tab;
/*Script cache and analysis */
SCRIPT_ANALYSIS analysis;
@@ -136,14 +136,7 @@ public final class TextLayout extends Resource {
psla = 0;
}
if (fallbackFont != 0) {
- if (mlang) {
- if (mLangFontLink2 != 0) {
- /* ReleaseFont() */
- OS.VtblCall(8, mLangFontLink2, fallbackFont);
- }
- } else {
- OS.DeleteObject(fallbackFont);
- }
+ OS.DeleteObject(fallbackFont);
fallbackFont = 0;
}
width = ascent = descent = x = 0;
@@ -196,24 +189,6 @@ void breakRun(StyleItem run) {
OS.ScriptBreak(chars, chars.length, run.analysis, run.psla);
}
-void checkItem (int /*long*/ hDC, StyleItem item) {
- if (item.fallbackFont != 0) {
- /*
- * Feature in Windows. The fallback font returned by the MLang service
- * can be disposed by some other client running in the same thread.
- * For example, disposing a Browser widget internally releases all fonts
- * in the MLang cache. The fix is to use GetObject() to detect if the
- * font was disposed and reshape the run.
- */
- LOGFONT logFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW() : new LOGFONTA();
- if (OS.GetObject(item.fallbackFont, LOGFONT.sizeof, logFont) == 0) {
- item.free();
- OS.SelectObject(hDC, getItemFont(item));
- shape(hDC, item);
- }
- }
-}
-
void checkLayout () {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
}
@@ -785,7 +760,6 @@ public void draw (GC gc, int x, int y, int selectionStart, int selectionEnd, Col
int end = run.start + run.length - 1;
boolean fullSelection = hasSelection && selectionStart <= run.start && selectionEnd >= end;
boolean partialSelection = hasSelection && !fullSelection && !(selectionStart > end || run.start > selectionEnd);
- checkItem(hdc, run);
OS.SelectObject(hdc, getItemFont(run));
int drawRunY = drawY + (baseline - run.ascent);
if (partialSelection) {
@@ -2784,141 +2758,83 @@ void shape (final int /*long*/ hdc, final StyleItem run) {
final SCRIPT_PROPERTIES sp = new SCRIPT_PROPERTIES();
OS.MoveMemory(sp, device.scripts[script], SCRIPT_PROPERTIES.sizeof);
boolean shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp);
-
if (!shapeSucceed) {
- boolean useGDI = !sp.fComplex;
- /*
- * Bug in Windows. There are non-complex scripts that are
- * not supported by GDI. The fix is to detect these scripts
- * by checking the Unicode ranges and use Uniscribe instead.
- *
- * These are the scripts:
- * 0x0530..0x058F is Armenian
- * 0x10A0..0x10FF is Georgian
- * 0xA000..0xA4CF is Yi
- */
- char c = chars[0];
- if (0x0530 <= c && c <= 0x058F || 0x10A0 <= c && c <= 0x10FF || 0xA000 <= c && c <= 0xA4CF) {
- useGDI = false;
- }
- if (useGDI) {
- int /*long*/ hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT);
- LOGFONT logFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
- OS.GetObject(hFont, LOGFONT.sizeof, logFont);
- LOGFONT systemLogFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
- OS.GetObject(device.systemFont.handle, LOGFONT.sizeof, systemLogFont);
- systemLogFont.lfHeight = logFont.lfHeight;
- systemLogFont.lfWeight = logFont.lfWeight;
- systemLogFont.lfItalic = logFont.lfItalic;
- systemLogFont.lfWidth = logFont.lfWidth;
- int /*long*/ newFont = OS.CreateFontIndirect (systemLogFont);
- OS.SelectObject(hdc, newFont);
- run.analysis.fNoGlyphIndex = true;
- shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp);
- if (shapeSucceed) {
- run.fallbackFont = newFont;
- } else {
- OS.SelectObject(hdc, hFont);
- OS.DeleteObject(newFont);
- run.analysis.fNoGlyphIndex = false;
+ int /*long*/ hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT);
+ int /*long*/ ssa = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, OS.SCRIPT_STRING_ANALYSIS_sizeof());
+ int /*long*/ metaFileDc = OS.CreateEnhMetaFile(hdc, null, null, null);
+ int /*long*/ oldMetaFont = OS.SelectObject(metaFileDc, hFont);
+ int flags = OS.SSA_METAFILE | OS.SSA_FALLBACK | OS.SSA_GLYPHS | OS.SSA_LINK;
+ if (OS.ScriptStringAnalyse(metaFileDc, chars, chars.length, 0, -1, flags, 0, null, null, 0, 0, 0, ssa) == OS.S_OK) {
+ OS.ScriptStringOut(ssa, 0, 0, 0, null, 0, 0, false);
+ OS.ScriptStringFree(ssa);
+ }
+ OS.HeapFree(hHeap, 0, ssa);
+ OS.SelectObject(metaFileDc, oldMetaFont);
+ int /*long*/ metaFile = OS.CloseEnhMetaFile(metaFileDc);
+ final EMREXTCREATEFONTINDIRECTW emr = new EMREXTCREATEFONTINDIRECTW();
+ class MetaFileEnumProc {
+ int /*long*/ metaFileEnumProc (int /*long*/ hDC, int /*long*/ table, int /*long*/ record, int /*long*/ nObj, int /*long*/ lpData) {
+ OS.MoveMemory(emr.emr, record, EMR.sizeof);
+ switch (emr.emr.iType) {
+ case OS.EMR_EXTCREATEFONTINDIRECTW:
+ OS.MoveMemory(emr, record, EMREXTCREATEFONTINDIRECTW.sizeof);
+ break;
+ case OS.EMR_EXTTEXTOUTW:
+ return 0;
+ }
+ return 1;
}
+ };
+ MetaFileEnumProc object = new MetaFileEnumProc();
+ /* Avoid compiler warnings */
+ if (false) object.metaFileEnumProc(0, 0, 0, 0, 0);
+ Callback callback = new Callback(object, "metaFileEnumProc", 5);
+ int /*long*/ address = callback.getAddress();
+ if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+ OS.EnumEnhMetaFile(0, metaFile, address, 0, null);
+ OS.DeleteEnhMetaFile(metaFile);
+ callback.dispose();
+
+ int /*long*/ newFont = OS.CreateFontIndirectW(emr.elfw.elfLogFont);
+ OS.SelectObject(hdc, newFont);
+ if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) {
+ run.fallbackFont = newFont;
}
- }
-
- if (!shapeSucceed) {
- /*
- * Shape Failed.
- * Try to use MLANG to find a suitable font to shape the run.
- */
- if (mLangFontLink2 != 0) {
- int[] dwCodePages = new int[1];
- int[] cchCodePages = new int[1];
- /* GetStrCodePages() */
- OS.VtblCall(4, mLangFontLink2, chars, chars.length, 0, dwCodePages, cchCodePages);
- int /*long*/[] hNewFont = new int /*long*/[1];
- /* MapFont() */
- if (OS.VtblCall(10, mLangFontLink2, hdc, dwCodePages[0], chars[0], hNewFont) == OS.S_OK) {
- int /*long*/ hFont = OS.SelectObject(hdc, hNewFont[0]);
- shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp);
- if (shapeSucceed) {
- run.fallbackFont = hNewFont[0];
- run.mlang = true;
+ if (!shapeSucceed) {
+ if (!sp.fComplex) {
+ run.analysis.fNoGlyphIndex = true;
+ if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) {
+ run.fallbackFont = newFont;
} else {
- /* ReleaseFont() */
- OS.VtblCall(8, mLangFontLink2, hNewFont[0]);
- OS.SelectObject(hdc, hFont);
+ run.analysis.fNoGlyphIndex = false;
}
}
}
- }
-
- if (!shapeSucceed) {
- /*
- * Shape Failed.
- * Try to shape the run using the LOGFONT in the cache.
- */
- final int /*long*/ hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT);
- final LOGFONT logFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
- OS.GetObject(hFont, LOGFONT.sizeof, logFont);
-
- LOGFONT cachedLogFont = device.logFontsCache != null ? device.logFontsCache[script] : null;
- if (cachedLogFont != null) {
- cachedLogFont.lfHeight = logFont.lfHeight;
- cachedLogFont.lfWeight = logFont.lfWeight;
- cachedLogFont.lfItalic = logFont.lfItalic;
- cachedLogFont.lfWidth = logFont.lfWidth;
- int /*long*/ newFont = OS.CreateFontIndirect(cachedLogFont);
- OS.SelectObject(hdc, newFont);
- shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp);
- if (shapeSucceed) {
- run.fallbackFont = newFont;
- } else {
- OS.SelectObject(hdc, hFont);
- OS.DeleteObject(newFont);
- }
- }
if (!shapeSucceed) {
- /*
- * Shape Failed.
- * Use EnumFontFamExProc to iterate over every font in the system that supports
- * the charset of the run and try to shape it.
- */
- if (device.logFontsCache == null) device.logFontsCache = new LOGFONT[device.scripts.length];
- final LOGFONT newLogFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
- class EnumFontFamEx {
- int /*long*/ EnumFontFamExProc (int /*long*/ lpelfe, int /*long*/ lpntme, int /*long*/ FontType, int /*long*/ lParam) {
- if (FontType == OS.RASTER_FONTTYPE) return 1;
- OS.MoveMemory(newLogFont, lpelfe, LOGFONT.sizeof);
- newLogFont.lfHeight = logFont.lfHeight;
- newLogFont.lfWeight = logFont.lfWeight;
- newLogFont.lfItalic = logFont.lfItalic;
- newLogFont.lfWidth = logFont.lfWidth;
- int /*long*/ newFont = OS.CreateFontIndirect(newLogFont);
- OS.SelectObject(hdc, newFont);
- if (shape(hdc, run, chars, buffer, maxGlyphs, sp)) {
- run.fallbackFont = newFont;
- LOGFONT cacheLogFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
- OS.MoveMemory(cacheLogFont, lpelfe, LOGFONT.sizeof);
- device.logFontsCache[script] = cacheLogFont;
- return 0;
+ if (mLangFontLink2 != 0) {
+ int /*long*/[] hNewFont = new int /*long*/[1];
+ int[] dwCodePages = new int[1], cchCodePages = new int[1];
+ /* GetStrCodePages() */
+ OS.VtblCall(4, mLangFontLink2, chars, chars.length, 0, dwCodePages, cchCodePages);
+ /* MapFont() */
+ if (OS.VtblCall(10, mLangFontLink2, hdc, dwCodePages[0], chars[0], hNewFont) == OS.S_OK) {
+ LOGFONT logFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
+ OS.GetObject(hNewFont[0], LOGFONT.sizeof, logFont);
+ /* ReleaseFont() */
+ OS.VtblCall(8, mLangFontLink2, hNewFont[0]);
+ int /*long*/ mLangFont = OS.CreateFontIndirect(logFont);
+ int /*long*/ oldFont = OS.SelectObject(hdc, mLangFont);
+ if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) {
+ run.fallbackFont = mLangFont;
+ } else {
+ OS.SelectObject(hdc, oldFont);
+ OS.DeleteObject(mLangFont);
}
- OS.SelectObject(hdc, hFont);
- OS.DeleteObject(newFont);
- return 1;
}
- };
- EnumFontFamEx object = new EnumFontFamEx();
- /* Avoid compiler warnings */
- if (false) object.EnumFontFamExProc(0, 0, 0, 0);
- Callback callback = new Callback(object, "EnumFontFamExProc", 4);
- int /*long*/ address = callback.getAddress();
- if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
- int charSet = sp.fAmbiguousCharSet ? OS.DEFAULT_CHARSET : sp.bCharSet;
- newLogFont.lfCharSet = (byte)charSet;
- OS.EnumFontFamiliesEx(hdc, newLogFont, address, 0, 0);
- callback.dispose();
- shapeSucceed = run.fallbackFont != 0;
+ }
}
+ if (!shapeSucceed) OS.SelectObject(hdc, hFont);
+ if (newFont != run.fallbackFont) OS.DeleteObject(newFont);
}
if (!shapeSucceed) {