Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2009-08-19 17:39:16 -0400
committerSilenio Quarti2009-08-19 17:39:16 -0400
commit976e43084e6451bfa01e2552d9934253d1c13468 (patch)
treeff9ec4361b219f27fb3c5f339092b5fdb5b25aeb /bundles
parentb72bc1d2aeff462f0ad0e8ecfa6bc39ebd385109 (diff)
downloadeclipse.platform.swt-976e43084e6451bfa01e2552d9934253d1c13468.tar.gz
eclipse.platform.swt-976e43084e6451bfa01e2552d9934253d1c13468.tar.xz
eclipse.platform.swt-976e43084e6451bfa01e2552d9934253d1c13468.zip
270531 - Cocoa - Font metrics
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c416
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c49
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c80
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CFRange.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGAffineTransform.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreFoundationFull.bridgesupport.extras28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreTextFull.bridgesupport.extras47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java132
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras8
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java297
14 files changed, 1106 insertions, 108 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c
index 8d7092f664..a3c01bedf2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c
@@ -774,6 +774,18 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1webView_1setFrame_1)
}
#endif
+#ifndef NO_CFAttributedStringCreate
+JNIEXPORT jintLong JNICALL OS_NATIVE(CFAttributedStringCreate)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CFAttributedStringCreate_FUNC);
+ rc = (jintLong)CFAttributedStringCreate((CFAllocatorRef)arg0, (CFStringRef)arg1, (CFDictionaryRef)arg2);
+ OS_NATIVE_EXIT(env, that, CFAttributedStringCreate_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CFDataGetBytePtr
JNIEXPORT jintLong JNICALL OS_NATIVE(CFDataGetBytePtr)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -798,6 +810,40 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CFDataGetLength)
}
#endif
+#ifndef NO_CFDictionaryAddValue
+JNIEXPORT void JNICALL OS_NATIVE(CFDictionaryAddValue)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
+{
+ OS_NATIVE_ENTER(env, that, CFDictionaryAddValue_FUNC);
+ CFDictionaryAddValue((CFMutableDictionaryRef)arg0, (void*)arg1, (void*)arg2);
+ OS_NATIVE_EXIT(env, that, CFDictionaryAddValue_FUNC);
+}
+#endif
+
+#ifndef NO_CFDictionaryCreateMutable
+JNIEXPORT jintLong JNICALL OS_NATIVE(CFDictionaryCreateMutable)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CFDictionaryCreateMutable_FUNC);
+ rc = (jintLong)CFDictionaryCreateMutable((CFAllocatorRef)arg0, (CFIndex)arg1, (CFDictionaryKeyCallBacks*)arg2, (CFDictionaryValueCallBacks*)arg3);
+ OS_NATIVE_EXIT(env, that, CFDictionaryCreateMutable_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CFRange_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(CFRange_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, CFRange_1sizeof_FUNC);
+ rc = (jint)CFRange_sizeof();
+ OS_NATIVE_EXIT(env, that, CFRange_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CFRelease
JNIEXPORT void JNICALL OS_NATIVE(CFRelease)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -852,6 +898,22 @@ JNIEXPORT void JNICALL OS_NATIVE(CFRunLoopObserverInvalidate)
}
#endif
+#ifndef NO_CFStringCreateWithCharacters
+JNIEXPORT jintLong JNICALL OS_NATIVE(CFStringCreateWithCharacters)
+ (JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jintLong arg2)
+{
+ jchar *lparg1=NULL;
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CFStringCreateWithCharacters_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ rc = (jintLong)CFStringCreateWithCharacters((CFAllocatorRef)arg0, (UniChar*)lparg1, (CFIndex)arg2);
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, CFStringCreateWithCharacters_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CFURLCreateStringByAddingPercentEscapes
JNIEXPORT jintLong JNICALL OS_NATIVE(CFURLCreateStringByAddingPercentEscapes)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jint arg4)
@@ -864,6 +926,18 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CFURLCreateStringByAddingPercentEscapes)
}
#endif
+#ifndef NO_CGAffineTransform_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(CGAffineTransform_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, CGAffineTransform_1sizeof_FUNC);
+ rc = (jint)CGAffineTransform_sizeof();
+ OS_NATIVE_EXIT(env, that, CGAffineTransform_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CGBitmapContextCreate
JNIEXPORT jintLong JNICALL OS_NATIVE(CGBitmapContextCreate)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jintLong arg5, jint arg6)
@@ -900,6 +974,22 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CGBitmapContextGetData)
}
#endif
+#ifndef NO_CGColorCreate
+JNIEXPORT jintLong JNICALL OS_NATIVE(CGColorCreate)
+ (JNIEnv *env, jclass that, jintLong arg0, jfloatDoubleArray arg1)
+{
+ jfloatDouble *lparg1=NULL;
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CGColorCreate_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetFloatDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ rc = (jintLong)CGColorCreate((CGColorSpaceRef)arg0, (CGFloat*)lparg1);
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseFloatDoubleArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, CGColorCreate_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CGColorSpaceCreateDeviceRGB
JNIEXPORT jintLong JNICALL OS_NATIVE(CGColorSpaceCreateDeviceRGB)
(JNIEnv *env, jclass that)
@@ -1143,6 +1233,50 @@ JNIEXPORT void JNICALL OS_NATIVE(CGContextSetMiterLimit)
}
#endif
+#ifndef NO_CGContextSetShouldAntialias
+JNIEXPORT void JNICALL OS_NATIVE(CGContextSetShouldAntialias)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, CGContextSetShouldAntialias_FUNC);
+ CGContextSetShouldAntialias((CGContextRef)arg0, (_Bool)arg1);
+ OS_NATIVE_EXIT(env, that, CGContextSetShouldAntialias_FUNC);
+}
+#endif
+
+#ifndef NO_CGContextSetTextDrawingMode
+JNIEXPORT void JNICALL OS_NATIVE(CGContextSetTextDrawingMode)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, CGContextSetTextDrawingMode_FUNC);
+ CGContextSetTextDrawingMode((CGContextRef)arg0, (CGTextDrawingMode)arg1);
+ OS_NATIVE_EXIT(env, that, CGContextSetTextDrawingMode_FUNC);
+}
+#endif
+
+#ifndef NO_CGContextSetTextMatrix
+JNIEXPORT void JNICALL OS_NATIVE(CGContextSetTextMatrix)
+ (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
+{
+ CGAffineTransform _arg1, *lparg1=NULL;
+ OS_NATIVE_ENTER(env, that, CGContextSetTextMatrix_FUNC);
+ if (arg1) if ((lparg1 = getCGAffineTransformFields(env, arg1, &_arg1)) == NULL) goto fail;
+ CGContextSetTextMatrix((CGContextRef)arg0, *lparg1);
+fail:
+ if (arg1 && lparg1) setCGAffineTransformFields(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, CGContextSetTextMatrix_FUNC);
+}
+#endif
+
+#ifndef NO_CGContextSetTextPosition
+JNIEXPORT void JNICALL OS_NATIVE(CGContextSetTextPosition)
+ (JNIEnv *env, jclass that, jintLong arg0, jfloatDouble arg1, jfloatDouble arg2)
+{
+ OS_NATIVE_ENTER(env, that, CGContextSetTextPosition_FUNC);
+ CGContextSetTextPosition((CGContextRef)arg0, (CGFloat)arg1, (CGFloat)arg2);
+ OS_NATIVE_EXIT(env, that, CGContextSetTextPosition_FUNC);
+}
+#endif
+
#ifndef NO_CGContextStrokePath
JNIEXPORT void JNICALL OS_NATIVE(CGContextStrokePath)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -1399,6 +1533,20 @@ JNIEXPORT void JNICALL OS_NATIVE(CGPathAddLineToPoint)
}
#endif
+#ifndef NO_CGPathAddRect
+JNIEXPORT void JNICALL OS_NATIVE(CGPathAddRect)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2)
+{
+ CGRect _arg2, *lparg2=NULL;
+ OS_NATIVE_ENTER(env, that, CGPathAddRect_FUNC);
+ if (arg2) if ((lparg2 = getCGRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ CGPathAddRect((CGMutablePathRef)arg0, (CGAffineTransform*)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setCGRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, CGPathAddRect_FUNC);
+}
+#endif
+
#ifndef NO_CGPathApply
JNIEXPORT void JNICALL OS_NATIVE(CGPathApply)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
@@ -1607,6 +1755,126 @@ fail:
}
#endif
+#ifndef NO_CTFontGetAscent
+JNIEXPORT jfloatDouble JNICALL OS_NATIVE(CTFontGetAscent)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jfloatDouble rc = 0;
+ OS_NATIVE_ENTER(env, that, CTFontGetAscent_FUNC);
+ rc = (jfloatDouble)CTFontGetAscent((CTFontRef)arg0);
+ OS_NATIVE_EXIT(env, that, CTFontGetAscent_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTFontGetDescent
+JNIEXPORT jfloatDouble JNICALL OS_NATIVE(CTFontGetDescent)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jfloatDouble rc = 0;
+ OS_NATIVE_ENTER(env, that, CTFontGetDescent_FUNC);
+ rc = (jfloatDouble)CTFontGetDescent((CTFontRef)arg0);
+ OS_NATIVE_EXIT(env, that, CTFontGetDescent_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTFontGetLeading
+JNIEXPORT jfloatDouble JNICALL OS_NATIVE(CTFontGetLeading)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jfloatDouble rc = 0;
+ OS_NATIVE_ENTER(env, that, CTFontGetLeading_FUNC);
+ rc = (jfloatDouble)CTFontGetLeading((CTFontRef)arg0);
+ OS_NATIVE_EXIT(env, that, CTFontGetLeading_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTLineCreateWithAttributedString
+JNIEXPORT jintLong JNICALL OS_NATIVE(CTLineCreateWithAttributedString)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CTLineCreateWithAttributedString_FUNC);
+ rc = (jintLong)CTLineCreateWithAttributedString((CFAttributedStringRef)arg0);
+ OS_NATIVE_EXIT(env, that, CTLineCreateWithAttributedString_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTLineDraw
+JNIEXPORT void JNICALL OS_NATIVE(CTLineDraw)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
+{
+ OS_NATIVE_ENTER(env, that, CTLineDraw_FUNC);
+ CTLineDraw((CTLineRef)arg0, (CGContextRef)arg1);
+ OS_NATIVE_EXIT(env, that, CTLineDraw_FUNC);
+}
+#endif
+
+#ifndef NO_CTLineGetTypographicBounds
+JNIEXPORT jdouble JNICALL OS_NATIVE(CTLineGetTypographicBounds)
+ (JNIEnv *env, jclass that, jintLong arg0, jfloatDoubleArray arg1, jfloatDoubleArray arg2, jfloatDoubleArray arg3)
+{
+ jfloatDouble *lparg1=NULL;
+ jfloatDouble *lparg2=NULL;
+ jfloatDouble *lparg3=NULL;
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, CTLineGetTypographicBounds_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetFloatDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = (*env)->GetFloatDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = (*env)->GetFloatDoubleArrayElements(env, arg3, NULL)) == NULL) goto fail;
+ rc = (jdouble)CTLineGetTypographicBounds((CTLineRef)arg0, (CGFloat*)lparg1, (CGFloat*)lparg2, (CGFloat*)lparg3);
+fail:
+ if (arg3 && lparg3) (*env)->ReleaseFloatDoubleArrayElements(env, arg3, lparg3, 0);
+ if (arg2 && lparg2) (*env)->ReleaseFloatDoubleArrayElements(env, arg2, lparg2, 0);
+ if (arg1 && lparg1) (*env)->ReleaseFloatDoubleArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, CTLineGetTypographicBounds_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTTypesetterCreateLine
+JNIEXPORT jintLong JNICALL OS_NATIVE(CTTypesetterCreateLine)
+ (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
+{
+ CFRange _arg1, *lparg1=NULL;
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CTTypesetterCreateLine_FUNC);
+ if (arg1) if ((lparg1 = getCFRangeFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jintLong)CTTypesetterCreateLine((CTTypesetterRef)arg0, *lparg1);
+fail:
+ if (arg1 && lparg1) setCFRangeFields(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, CTTypesetterCreateLine_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTTypesetterCreateWithAttributedString
+JNIEXPORT jintLong JNICALL OS_NATIVE(CTTypesetterCreateWithAttributedString)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CTTypesetterCreateWithAttributedString_FUNC);
+ rc = (jintLong)CTTypesetterCreateWithAttributedString((CFAttributedStringRef)arg0);
+ OS_NATIVE_EXIT(env, that, CTTypesetterCreateWithAttributedString_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CTTypesetterSuggestLineBreak
+JNIEXPORT jintLong JNICALL OS_NATIVE(CTTypesetterSuggestLineBreak)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, CTTypesetterSuggestLineBreak_FUNC);
+ rc = (jintLong)CTTypesetterSuggestLineBreak((CTTypesetterRef)arg0, (CFIndex)arg1, (double)arg2);
+ OS_NATIVE_EXIT(env, that, CTTypesetterSuggestLineBreak_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_CancelMenuTracking
JNIEXPORT jint JNICALL OS_NATIVE(CancelMenuTracking)
(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1, jint arg2)
@@ -4560,6 +4828,104 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(kCFRunLoopCommonModes)
}
#endif
+#ifndef NO_kCFTypeDictionaryKeyCallBacks
+JNIEXPORT jintLong JNICALL OS_NATIVE(kCFTypeDictionaryKeyCallBacks)
+ (JNIEnv *env, jclass that)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, kCFTypeDictionaryKeyCallBacks_FUNC);
+ rc = (jintLong)&kCFTypeDictionaryKeyCallBacks;
+ OS_NATIVE_EXIT(env, that, kCFTypeDictionaryKeyCallBacks_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_kCFTypeDictionaryValueCallBacks
+JNIEXPORT jintLong JNICALL OS_NATIVE(kCFTypeDictionaryValueCallBacks)
+ (JNIEnv *env, jclass that)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, kCFTypeDictionaryValueCallBacks_FUNC);
+ rc = (jintLong)&kCFTypeDictionaryValueCallBacks;
+ OS_NATIVE_EXIT(env, that, kCFTypeDictionaryValueCallBacks_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_kCTFontAttributeName
+JNIEXPORT jintLong JNICALL OS_NATIVE(kCTFontAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, kCTFontAttributeName_FUNC);
+ rc = (jintLong)kCTFontAttributeName;
+ OS_NATIVE_EXIT(env, that, kCTFontAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_kCTForegroundColorAttributeName
+JNIEXPORT jintLong JNICALL OS_NATIVE(kCTForegroundColorAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, kCTForegroundColorAttributeName_FUNC);
+ rc = (jintLong)kCTForegroundColorAttributeName;
+ OS_NATIVE_EXIT(env, that, kCTForegroundColorAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_cocoa_CFRange_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_cocoa_CFRange_2J) && defined(JNI64))
+#ifndef JNI64
+JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_cocoa_CFRange_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
+#else
+JNIEXPORT void JNICALL OS_NATIVE(memmove__JLorg_eclipse_swt_internal_cocoa_CFRange_2J)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
+#endif
+{
+ CFRange _arg1, *lparg1=NULL;
+#ifndef JNI64
+ OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_CFRange_2I_FUNC);
+#else
+ OS_NATIVE_ENTER(env, that, memmove__JLorg_eclipse_swt_internal_cocoa_CFRange_2J_FUNC);
+#endif
+ if (arg1) if ((lparg1 = getCFRangeFields(env, arg1, &_arg1)) == NULL) goto fail;
+ memmove((void *)arg0, (void *)lparg1, arg2);
+fail:
+ if (arg1 && lparg1) setCFRangeFields(env, arg1, lparg1);
+#ifndef JNI64
+ OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_CFRange_2I_FUNC);
+#else
+ OS_NATIVE_EXIT(env, that, memmove__JLorg_eclipse_swt_internal_cocoa_CFRange_2J_FUNC);
+#endif
+}
+#endif
+
+#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_cocoa_CGAffineTransform_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_cocoa_CGAffineTransform_2J) && defined(JNI64))
+#ifndef JNI64
+JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_cocoa_CGAffineTransform_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
+#else
+JNIEXPORT void JNICALL OS_NATIVE(memmove__JLorg_eclipse_swt_internal_cocoa_CGAffineTransform_2J)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
+#endif
+{
+ CGAffineTransform _arg1, *lparg1=NULL;
+#ifndef JNI64
+ OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_CGAffineTransform_2I_FUNC);
+#else
+ OS_NATIVE_ENTER(env, that, memmove__JLorg_eclipse_swt_internal_cocoa_CGAffineTransform_2J_FUNC);
+#endif
+ if (arg1) if ((lparg1 = getCGAffineTransformFields(env, arg1, &_arg1)) == NULL) goto fail;
+ memmove((void *)arg0, (void *)lparg1, arg2);
+fail:
+ if (arg1 && lparg1) setCGAffineTransformFields(env, arg1, lparg1);
+#ifndef JNI64
+ OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_CGAffineTransform_2I_FUNC);
+#else
+ OS_NATIVE_EXIT(env, that, memmove__JLorg_eclipse_swt_internal_cocoa_CGAffineTransform_2J_FUNC);
+#endif
+}
+#endif
+
#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_cocoa_CGPathElement_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_cocoa_CGPathElement_2J) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_cocoa_CGPathElement_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
@@ -4785,6 +5151,56 @@ fail:
}
#endif
+#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2JJ) && defined(JNI64))
+#ifndef JNI64
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
+#else
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2JJ)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
+#endif
+{
+ CFRange _arg0, *lparg0=NULL;
+#ifndef JNI64
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2II_FUNC);
+#else
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2JJ_FUNC);
+#endif
+ if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail;
+ memmove((void *)lparg0, (void *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setCFRangeFields(env, arg0, lparg0);
+#ifndef JNI64
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2II_FUNC);
+#else
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2JJ_FUNC);
+#endif
+}
+#endif
+
+#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2JJ) && defined(JNI64))
+#ifndef JNI64
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
+#else
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2JJ)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
+#endif
+{
+ CGAffineTransform _arg0, *lparg0=NULL;
+#ifndef JNI64
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2II_FUNC);
+#else
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2JJ_FUNC);
+#endif
+ if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail;
+ memmove((void *)lparg0, (void *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setCGAffineTransformFields(env, arg0, lparg0);
+#ifndef JNI64
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2II_FUNC);
+#else
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2JJ_FUNC);
+#endif
+}
+#endif
+
#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2JJ) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c
index e90a3bbe99..6973ad9b1d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 488;
-int OS_nativeFunctionCallCount[488];
+int OS_nativeFunctionCount = 517;
+int OS_nativeFunctionCallCount[517];
char * OS_nativeFunctionNames[] = {
"ATSFontActivateFromFileReference",
"AcquireRootMenu",
@@ -51,17 +51,24 @@ char * OS_nativeFunctionNames[] = {
"CALLBACK_1titleRectForBounds_1",
"CALLBACK_1view_1stringForToolTip_1point_1userData_1",
"CALLBACK_1webView_1setFrame_1",
+ "CFAttributedStringCreate",
"CFDataGetBytePtr",
"CFDataGetLength",
+ "CFDictionaryAddValue",
+ "CFDictionaryCreateMutable",
+ "CFRange_1sizeof",
"CFRelease",
"CFRunLoopAddObserver",
"CFRunLoopGetCurrent",
"CFRunLoopObserverCreate",
"CFRunLoopObserverInvalidate",
+ "CFStringCreateWithCharacters",
"CFURLCreateStringByAddingPercentEscapes",
+ "CGAffineTransform_1sizeof",
"CGBitmapContextCreate",
"CGBitmapContextCreateImage",
"CGBitmapContextGetData",
+ "CGColorCreate",
"CGColorSpaceCreateDeviceRGB",
"CGColorSpaceRelease",
"CGContextAddPath",
@@ -82,6 +89,10 @@ char * OS_nativeFunctionNames[] = {
"CGContextSetLineJoin",
"CGContextSetLineWidth",
"CGContextSetMiterLimit",
+ "CGContextSetShouldAntialias",
+ "CGContextSetTextDrawingMode",
+ "CGContextSetTextMatrix",
+ "CGContextSetTextPosition",
"CGContextStrokePath",
"CGContextTranslateCTM",
"CGDataProviderCreateWithData",
@@ -105,6 +116,7 @@ char * OS_nativeFunctionNames[] = {
"CGImageRelease",
"CGPathAddCurveToPoint",
"CGPathAddLineToPoint",
+ "CGPathAddRect",
"CGPathApply",
"CGPathCloseSubpath",
"CGPathCreateCopy",
@@ -122,6 +134,15 @@ char * OS_nativeFunctionNames[] = {
"CGSize_1sizeof",
"CGWarpMouseCursorPosition",
"CPSSetProcessName",
+ "CTFontGetAscent",
+ "CTFontGetDescent",
+ "CTFontGetLeading",
+ "CTLineCreateWithAttributedString",
+ "CTLineDraw",
+ "CTLineGetTypographicBounds",
+ "CTTypesetterCreateLine",
+ "CTTypesetterCreateWithAttributedString",
+ "CTTypesetterSuggestLineBreak",
"CancelMenuTracking",
"CloseRgn",
"CopyRgn",
@@ -345,8 +366,22 @@ char * OS_nativeFunctionNames[] = {
"instrumentObjcMessageSends",
"isFlipped_1CALLBACK",
"kCFRunLoopCommonModes",
+ "kCFTypeDictionaryKeyCallBacks",
+ "kCFTypeDictionaryValueCallBacks",
+ "kCTFontAttributeName",
+ "kCTForegroundColorAttributeName",
"kTISPropertyUnicodeKeyLayoutData",
#ifndef JNI64
+ "memmove__ILorg_eclipse_swt_internal_cocoa_CFRange_2I",
+#else
+ "memmove__JLorg_eclipse_swt_internal_cocoa_CFRange_2J",
+#endif
+#ifndef JNI64
+ "memmove__ILorg_eclipse_swt_internal_cocoa_CGAffineTransform_2I",
+#else
+ "memmove__JLorg_eclipse_swt_internal_cocoa_CGAffineTransform_2J",
+#endif
+#ifndef JNI64
"memmove__ILorg_eclipse_swt_internal_cocoa_CGPathElement_2I",
#else
"memmove__JLorg_eclipse_swt_internal_cocoa_CGPathElement_2J",
@@ -392,6 +427,16 @@ char * OS_nativeFunctionNames[] = {
"memmove__JLorg_eclipse_swt_internal_cocoa_NSSize_2J",
#endif
#ifndef JNI64
+ "memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2II",
+#else
+ "memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2JJ",
+#endif
+#ifndef JNI64
+ "memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2II",
+#else
+ "memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2JJ",
+#endif
+#ifndef JNI64
"memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2II",
#else
"memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2JJ",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h
index 606e386880..82f6f90661 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h
@@ -59,17 +59,24 @@ typedef enum {
CALLBACK_1titleRectForBounds_1_FUNC,
CALLBACK_1view_1stringForToolTip_1point_1userData_1_FUNC,
CALLBACK_1webView_1setFrame_1_FUNC,
+ CFAttributedStringCreate_FUNC,
CFDataGetBytePtr_FUNC,
CFDataGetLength_FUNC,
+ CFDictionaryAddValue_FUNC,
+ CFDictionaryCreateMutable_FUNC,
+ CFRange_1sizeof_FUNC,
CFRelease_FUNC,
CFRunLoopAddObserver_FUNC,
CFRunLoopGetCurrent_FUNC,
CFRunLoopObserverCreate_FUNC,
CFRunLoopObserverInvalidate_FUNC,
+ CFStringCreateWithCharacters_FUNC,
CFURLCreateStringByAddingPercentEscapes_FUNC,
+ CGAffineTransform_1sizeof_FUNC,
CGBitmapContextCreate_FUNC,
CGBitmapContextCreateImage_FUNC,
CGBitmapContextGetData_FUNC,
+ CGColorCreate_FUNC,
CGColorSpaceCreateDeviceRGB_FUNC,
CGColorSpaceRelease_FUNC,
CGContextAddPath_FUNC,
@@ -90,6 +97,10 @@ typedef enum {
CGContextSetLineJoin_FUNC,
CGContextSetLineWidth_FUNC,
CGContextSetMiterLimit_FUNC,
+ CGContextSetShouldAntialias_FUNC,
+ CGContextSetTextDrawingMode_FUNC,
+ CGContextSetTextMatrix_FUNC,
+ CGContextSetTextPosition_FUNC,
CGContextStrokePath_FUNC,
CGContextTranslateCTM_FUNC,
CGDataProviderCreateWithData_FUNC,
@@ -113,6 +124,7 @@ typedef enum {
CGImageRelease_FUNC,
CGPathAddCurveToPoint_FUNC,
CGPathAddLineToPoint_FUNC,
+ CGPathAddRect_FUNC,
CGPathApply_FUNC,
CGPathCloseSubpath_FUNC,
CGPathCreateCopy_FUNC,
@@ -130,6 +142,15 @@ typedef enum {
CGSize_1sizeof_FUNC,
CGWarpMouseCursorPosition_FUNC,
CPSSetProcessName_FUNC,
+ CTFontGetAscent_FUNC,
+ CTFontGetDescent_FUNC,
+ CTFontGetLeading_FUNC,
+ CTLineCreateWithAttributedString_FUNC,
+ CTLineDraw_FUNC,
+ CTLineGetTypographicBounds_FUNC,
+ CTTypesetterCreateLine_FUNC,
+ CTTypesetterCreateWithAttributedString_FUNC,
+ CTTypesetterSuggestLineBreak_FUNC,
CancelMenuTracking_FUNC,
CloseRgn_FUNC,
CopyRgn_FUNC,
@@ -353,8 +374,22 @@ typedef enum {
instrumentObjcMessageSends_FUNC,
isFlipped_1CALLBACK_FUNC,
kCFRunLoopCommonModes_FUNC,
+ kCFTypeDictionaryKeyCallBacks_FUNC,
+ kCFTypeDictionaryValueCallBacks_FUNC,
+ kCTFontAttributeName_FUNC,
+ kCTForegroundColorAttributeName_FUNC,
kTISPropertyUnicodeKeyLayoutData_FUNC,
#ifndef JNI64
+ memmove__ILorg_eclipse_swt_internal_cocoa_CFRange_2I_FUNC,
+#else
+ memmove__JLorg_eclipse_swt_internal_cocoa_CFRange_2J_FUNC,
+#endif
+#ifndef JNI64
+ memmove__ILorg_eclipse_swt_internal_cocoa_CGAffineTransform_2I_FUNC,
+#else
+ memmove__JLorg_eclipse_swt_internal_cocoa_CGAffineTransform_2J_FUNC,
+#endif
+#ifndef JNI64
memmove__ILorg_eclipse_swt_internal_cocoa_CGPathElement_2I_FUNC,
#else
memmove__JLorg_eclipse_swt_internal_cocoa_CGPathElement_2J_FUNC,
@@ -400,6 +435,16 @@ typedef enum {
memmove__JLorg_eclipse_swt_internal_cocoa_NSSize_2J_FUNC,
#endif
#ifndef JNI64
+ memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2II_FUNC,
+#else
+ memmove__Lorg_eclipse_swt_internal_cocoa_CFRange_2JJ_FUNC,
+#endif
+#ifndef JNI64
+ memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2II_FUNC,
+#else
+ memmove__Lorg_eclipse_swt_internal_cocoa_CGAffineTransform_2JJ_FUNC,
+#endif
+#ifndef JNI64
memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2II_FUNC,
#else
memmove__Lorg_eclipse_swt_internal_cocoa_CGPathElement_2JJ_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c
index e249b01a04..66ba9da232 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c
@@ -12,6 +12,86 @@
#include "swt.h"
#include "os_structs.h"
+#ifndef NO_CFRange
+typedef struct CFRange_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID location, length;
+} CFRange_FID_CACHE;
+
+CFRange_FID_CACHE CFRangeFc;
+
+void cacheCFRangeFields(JNIEnv *env, jobject lpObject)
+{
+ if (CFRangeFc.cached) return;
+ CFRangeFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ CFRangeFc.location = (*env)->GetFieldID(env, CFRangeFc.clazz, "location", I_J);
+ CFRangeFc.length = (*env)->GetFieldID(env, CFRangeFc.clazz, "length", I_J);
+ CFRangeFc.cached = 1;
+}
+
+CFRange *getCFRangeFields(JNIEnv *env, jobject lpObject, CFRange *lpStruct)
+{
+ if (!CFRangeFc.cached) cacheCFRangeFields(env, lpObject);
+ lpStruct->location = (*env)->GetIntLongField(env, lpObject, CFRangeFc.location);
+ lpStruct->length = (*env)->GetIntLongField(env, lpObject, CFRangeFc.length);
+ return lpStruct;
+}
+
+void setCFRangeFields(JNIEnv *env, jobject lpObject, CFRange *lpStruct)
+{
+ if (!CFRangeFc.cached) cacheCFRangeFields(env, lpObject);
+ (*env)->SetIntLongField(env, lpObject, CFRangeFc.location, (jintLong)lpStruct->location);
+ (*env)->SetIntLongField(env, lpObject, CFRangeFc.length, (jintLong)lpStruct->length);
+}
+#endif
+
+#ifndef NO_CGAffineTransform
+typedef struct CGAffineTransform_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID a, b, c, d, tx, ty;
+} CGAffineTransform_FID_CACHE;
+
+CGAffineTransform_FID_CACHE CGAffineTransformFc;
+
+void cacheCGAffineTransformFields(JNIEnv *env, jobject lpObject)
+{
+ if (CGAffineTransformFc.cached) return;
+ CGAffineTransformFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ CGAffineTransformFc.a = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "a", F_D);
+ CGAffineTransformFc.b = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "b", F_D);
+ CGAffineTransformFc.c = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "c", F_D);
+ CGAffineTransformFc.d = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "d", F_D);
+ CGAffineTransformFc.tx = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "tx", F_D);
+ CGAffineTransformFc.ty = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "ty", F_D);
+ CGAffineTransformFc.cached = 1;
+}
+
+CGAffineTransform *getCGAffineTransformFields(JNIEnv *env, jobject lpObject, CGAffineTransform *lpStruct)
+{
+ if (!CGAffineTransformFc.cached) cacheCGAffineTransformFields(env, lpObject);
+ lpStruct->a = (*env)->GetFloatDoubleField(env, lpObject, CGAffineTransformFc.a);
+ lpStruct->b = (*env)->GetFloatDoubleField(env, lpObject, CGAffineTransformFc.b);
+ lpStruct->c = (*env)->GetFloatDoubleField(env, lpObject, CGAffineTransformFc.c);
+ lpStruct->d = (*env)->GetFloatDoubleField(env, lpObject, CGAffineTransformFc.d);
+ lpStruct->tx = (*env)->GetFloatDoubleField(env, lpObject, CGAffineTransformFc.tx);
+ lpStruct->ty = (*env)->GetFloatDoubleField(env, lpObject, CGAffineTransformFc.ty);
+ return lpStruct;
+}
+
+void setCGAffineTransformFields(JNIEnv *env, jobject lpObject, CGAffineTransform *lpStruct)
+{
+ if (!CGAffineTransformFc.cached) cacheCGAffineTransformFields(env, lpObject);
+ (*env)->SetFloatDoubleField(env, lpObject, CGAffineTransformFc.a, (jfloatDouble)lpStruct->a);
+ (*env)->SetFloatDoubleField(env, lpObject, CGAffineTransformFc.b, (jfloatDouble)lpStruct->b);
+ (*env)->SetFloatDoubleField(env, lpObject, CGAffineTransformFc.c, (jfloatDouble)lpStruct->c);
+ (*env)->SetFloatDoubleField(env, lpObject, CGAffineTransformFc.d, (jfloatDouble)lpStruct->d);
+ (*env)->SetFloatDoubleField(env, lpObject, CGAffineTransformFc.tx, (jfloatDouble)lpStruct->tx);
+ (*env)->SetFloatDoubleField(env, lpObject, CGAffineTransformFc.ty, (jfloatDouble)lpStruct->ty);
+}
+#endif
+
#ifndef NO_CGPathElement
typedef struct CGPathElement_FID_CACHE {
int cached;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h
index 31eb71f770..a8a0d00ba0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h
@@ -11,6 +11,30 @@
#include "os.h"
+#ifndef NO_CFRange
+void cacheCFRangeFields(JNIEnv *env, jobject lpObject);
+CFRange *getCFRangeFields(JNIEnv *env, jobject lpObject, CFRange *lpStruct);
+void setCFRangeFields(JNIEnv *env, jobject lpObject, CFRange *lpStruct);
+#define CFRange_sizeof() sizeof(CFRange)
+#else
+#define cacheCFRangeFields(a,b)
+#define getCFRangeFields(a,b,c) NULL
+#define setCFRangeFields(a,b,c)
+#define CFRange_sizeof() 0
+#endif
+
+#ifndef NO_CGAffineTransform
+void cacheCGAffineTransformFields(JNIEnv *env, jobject lpObject);
+CGAffineTransform *getCGAffineTransformFields(JNIEnv *env, jobject lpObject, CGAffineTransform *lpStruct);
+void setCGAffineTransformFields(JNIEnv *env, jobject lpObject, CGAffineTransform *lpStruct);
+#define CGAffineTransform_sizeof() sizeof(CGAffineTransform)
+#else
+#define cacheCGAffineTransformFields(a,b)
+#define getCGAffineTransformFields(a,b,c) NULL
+#define setCGAffineTransformFields(a,b,c)
+#define CGAffineTransform_sizeof() 0
+#endif
+
#ifndef NO_CGPathElement
void cacheCGPathElementFields(JNIEnv *env, jobject lpObject);
CGPathElement *getCGPathElementFields(JNIEnv *env, jobject lpObject, CGPathElement *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
index 8ae3872646..b76dc91492 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
@@ -4753,26 +4753,26 @@
</informal_protocol>
<class name="NSSecureTextField" swt_gen="true" swt_superclass="NSTextField"></class>
<informal_protocol name="NSTextInput" swt_gen="true">
- <method selector="markedRange" swt_gen="true" swt_gen_custom_callback="true"></method>
+ <method selector="hasMarkedText" swt_gen="true"></method>
<method selector="insertText:" swt_gen="true">
<arg name="aString" swt_gen="true"></arg>
</method>
<method selector="unmarkText" swt_gen="true"></method>
- <method selector="hasMarkedText" swt_gen="true"></method>
- <method selector="validAttributesForMarkedText" swt_gen="true"></method>
+ <method selector="selectedRange" swt_gen="true" swt_gen_custom_callback="true"></method>
<method selector="characterIndexForPoint:" swt_gen="true" swt_gen_custom_callback="true">
<arg name="thePoint" swt_gen="true"></arg>
</method>
+ <method selector="firstRectForCharacterRange:" swt_gen="true" swt_gen_custom_callback="true">
+ <arg name="theRange" swt_gen="true"></arg>
+ </method>
+ <method selector="validAttributesForMarkedText" swt_gen="true"></method>
<method selector="attributedSubstringFromRange:" swt_gen="true" swt_gen_custom_callback="true">
<arg name="theRange" swt_gen="true"></arg>
</method>
- <method selector="selectedRange" swt_gen="true" swt_gen_custom_callback="true"></method>
<method selector="setMarkedText:selectedRange:" swt_gen="true" swt_gen_custom_callback="true">
<arg name="selRange" swt_gen="true"></arg>
<arg name="aString" swt_gen="true"></arg>
</method>
- <method selector="firstRectForCharacterRange:" swt_gen="true" swt_gen_custom_callback="true">
- <arg name="theRange" swt_gen="true"></arg>
- </method>
+ <method selector="markedRange" swt_gen="true" swt_gen_custom_callback="true"></method>
</informal_protocol>
</signatures>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CFRange.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CFRange.java
new file mode 100644
index 0000000000..0c38c3819b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CFRange.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 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.cocoa;
+
+public class CFRange {
+ public int /*long*/ location;
+ public int /*long*/ length;
+ public static int sizeof = OS.CFRange_sizeof();
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGAffineTransform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGAffineTransform.java
new file mode 100644
index 0000000000..7d17d9386e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGAffineTransform.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 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.cocoa;
+
+public class CGAffineTransform {
+ public float /*double*/ a;
+ public float /*double*/ b;
+ public float /*double*/ c;
+ public float /*double*/ d;
+ public float /*double*/ tx;
+ public float /*double*/ ty;
+ public static int sizeof = OS.CGAffineTransform_sizeof();
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreFoundationFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreFoundationFull.bridgesupport.extras
index 556ef896ca..76d691df5a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreFoundationFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreFoundationFull.bridgesupport.extras
@@ -1,8 +1,18 @@
<?xml version="1.0" encoding="UTF8"?>
<signatures swt_gen="mixed">
+ <struct name="CFRange" swt_gen="true">
+ <field name="location" swt_gen="true"></field>
+ <field name="length" swt_gen="true"></field>
+ </struct>
<constant name="kCFRunLoopCommonModes" swt_gen="true"></constant>
<enum name="kCFRunLoopBeforeWaiting" swt_gen="true"></enum>
<enum name="kCFStringEncodingUTF8" swt_gen="true"></enum>
+ <function name="CFAttributedStringCreate" swt_gen="true">
+ <arg name="alloc" swt_gen="true"></arg>
+ <arg name="str" swt_gen="true"></arg>
+ <arg name="attributes" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
<function name="CFDataGetBytePtr" swt_gen="true">
<arg name="theData" swt_gen="true"></arg>
<retval swt_gen="true"></retval>
@@ -11,6 +21,18 @@
<arg name="theData" swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</function>
+ <function name="CFDictionaryAddValue" swt_gen="true">
+ <arg name="theDict" swt_gen="true"></arg>
+ <arg name="key" swt_gen="true"></arg>
+ <arg name="value" swt_gen="true"></arg>
+ </function>
+ <function name="CFDictionaryCreateMutable" swt_gen="true">
+ <arg name="allocator" swt_gen="true"></arg>
+ <arg name="capacity" swt_gen="true"></arg>
+ <arg name="keyCallBacks" swt_gen="true"></arg>
+ <arg name="valueCallBacks" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
<function name="CFRelease" swt_gen="true">
<arg name="cf" swt_gen="true"></arg>
</function>
@@ -39,6 +61,12 @@
<function name="CFRunLoopObserverInvalidate" swt_gen="true">
<arg name="observer" swt_gen="true"></arg>
</function>
+ <function name="CFStringCreateWithCharacters" swt_gen="true">
+ <arg name="alloc" swt_gen="true"></arg>
+ <arg name="chars" swt_gen="true" swt_java_type="char[]"></arg>
+ <arg name="numChars" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
<function name="CFURLCreateStringByAddingPercentEscapes" swt_gen="true">
<arg name="allocator" swt_gen="true"></arg>
<arg name="originalString" swt_gen="true"></arg>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras
index 9a493c1ac5..9e34373ab4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF8"?>
<signatures swt_gen="mixed">
+ <struct name="CGAffineTransform" swt_gen="true">
+ <field name="a" swt_gen="true"></field>
+ <field name="b" swt_gen="true"></field>
+ <field name="c" swt_gen="true"></field>
+ <field name="d" swt_gen="true"></field>
+ <field name="tx" swt_gen="true"></field>
+ <field name="ty" swt_gen="true"></field>
+ </struct>
<struct name="CGPathElement" swt_gen="true">
<field name="type" swt_gen="true"></field>
<field name="points" swt_gen="true"></field>
@@ -42,6 +50,7 @@
<enum name="kCGPathElementMoveToPoint" swt_gen="true"></enum>
<enum name="kCGPathStroke" swt_gen="true"></enum>
<enum name="kCGSessionEventTap" swt_gen="true"></enum>
+ <enum name="kCGTextFillStroke" swt_gen="true"></enum>
<function name="CGBitmapContextCreate" swt_gen="true">
<arg name="data" swt_gen="true"></arg>
<arg name="width" swt_gen="true"></arg>
@@ -60,6 +69,11 @@
<arg name="c" swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</function>
+ <function name="CGColorCreate" swt_gen="true">
+ <arg name="space" swt_gen="true"></arg>
+ <arg name="components" swt_gen="true" swt_java_type="float[]" swt_java_type64="double[]"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
<function name="CGColorSpaceCreateDeviceRGB" swt_gen="true">
<retval swt_gen="true"></retval>
</function>
@@ -130,6 +144,23 @@
<arg name="c" swt_gen="true"></arg>
<arg name="limit" swt_gen="true"></arg>
</function>
+ <function name="CGContextSetShouldAntialias" swt_gen="true">
+ <arg name="c" swt_gen="true"></arg>
+ <arg name="shouldAntialias" swt_gen="true"></arg>
+ </function>
+ <function name="CGContextSetTextDrawingMode" swt_gen="true">
+ <arg name="c" swt_gen="true"></arg>
+ <arg name="mode" swt_gen="true"></arg>
+ </function>
+ <function name="CGContextSetTextMatrix" swt_gen="true">
+ <arg name="c" swt_gen="true"></arg>
+ <arg name="t" swt_gen="true"></arg>
+ </function>
+ <function name="CGContextSetTextPosition" swt_gen="true">
+ <arg name="c" swt_gen="true"></arg>
+ <arg name="x" swt_gen="true"></arg>
+ <arg name="y" swt_gen="true"></arg>
+ </function>
<function name="CGContextStrokePath" swt_gen="true">
<arg name="c" swt_gen="true"></arg>
</function>
@@ -249,6 +280,11 @@
<arg name="x" swt_gen="true"></arg>
<arg name="y" swt_gen="true"></arg>
</function>
+ <function name="CGPathAddRect" swt_gen="true">
+ <arg name="path" swt_gen="true"></arg>
+ <arg name="m" swt_gen="true"></arg>
+ <arg name="rect" swt_gen="true"></arg>
+ </function>
<function name="CGPathApply" swt_gen="true">
<arg name="path" swt_gen="true"></arg>
<arg name="info" swt_gen="true"></arg>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreTextFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreTextFull.bridgesupport.extras
new file mode 100644
index 0000000000..e1280b68f1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreTextFull.bridgesupport.extras
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF8"?>
+<signatures swt_gen="mixed">
+ <constant name="kCTFontAttributeName" swt_gen="true"></constant>
+ <constant name="kCTForegroundColorAttributeName" swt_gen="true"></constant>
+ <function name="CTFontGetAscent" swt_gen="true">
+ <arg name="font" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTFontGetDescent" swt_gen="true">
+ <arg name="font" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTFontGetLeading" swt_gen="true">
+ <arg name="font" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTLineCreateWithAttributedString" swt_gen="true">
+ <arg name="string" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTLineDraw" swt_gen="true">
+ <arg name="line" swt_gen="true"></arg>
+ <arg name="context" swt_gen="true"></arg>
+ </function>
+ <function name="CTLineGetTypographicBounds" swt_gen="true">
+ <arg name="line" swt_gen="true"></arg>
+ <arg name="ascent" swt_gen="true" swt_java_type="float[]" swt_java_type64="double[]"></arg>
+ <arg name="descent" swt_gen="true" swt_java_type="float[]" swt_java_type64="double[]"></arg>
+ <arg name="leading" swt_gen="true" swt_java_type="float[]" swt_java_type64="double[]"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTTypesetterCreateLine" swt_gen="true">
+ <arg name="typesetter" swt_gen="true"></arg>
+ <arg name="stringRange" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTTypesetterCreateWithAttributedString" swt_gen="true">
+ <arg name="string" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+ <function name="CTTypesetterSuggestLineBreak" swt_gen="true">
+ <arg name="typesetter" swt_gen="true"></arg>
+ <arg name="startIndex" swt_gen="true"></arg>
+ <arg name="width" swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </function>
+</signatures>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 9323a32299..6d33c6631a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -269,6 +269,11 @@ public static final native void NSIntersectionRect (NSRect result, NSRect aRect,
*/
public static final native void CGDisplayBounds(int display, CGRect rect);
+/** @method flags=const address*/
+public static final native int /*long*/ kCFTypeDictionaryKeyCallBacks();
+/** @method flags=const address*/
+public static final native int /*long*/ kCFTypeDictionaryValueCallBacks();
+
/** Objective-C runtime */
/**
@@ -2008,6 +2013,7 @@ public static final int kCGPathElementCloseSubpath = 4;
public static final int kCGPathElementMoveToPoint = 0;
public static final int kCGPathStroke = 2;
public static final int kCGSessionEventTap = 1;
+public static final int kCGTextFillStroke = 2;
public static final int NSAllApplicationsDirectory = 100;
public static final int NSAllDomainsMask = 65535;
public static final int NSNotFound = 2147483647;
@@ -2450,6 +2456,10 @@ public static final NSString NSViewGlobalFrameDidChangeNotification = new NSStri
/** @method flags=const */
public static final native int /*long*/ kCFRunLoopCommonModes();
/** @method flags=const */
+public static final native int /*long*/ kCTFontAttributeName();
+/** @method flags=const */
+public static final native int /*long*/ kCTForegroundColorAttributeName();
+/** @method flags=const */
public static final native int /*long*/ NSDefaultRunLoopMode();
public static final NSString NSDefaultRunLoopMode = new NSString(NSDefaultRunLoopMode());
/** @method flags=const */
@@ -2514,6 +2524,12 @@ public static final native void NSCopyBits(int /*long*/ srcGState, NSRect srcRec
*/
public static final native int /*long*/ NSNumberOfColorComponents(int /*long*/ colorSpaceName);
/**
+ * @param alloc cast=(CFAllocatorRef)
+ * @param str cast=(CFStringRef)
+ * @param attributes cast=(CFDictionaryRef)
+ */
+public static final native int /*long*/ CFAttributedStringCreate(int /*long*/ alloc, int /*long*/ str, int /*long*/ attributes);
+/**
* @param theData cast=(CFDataRef)
*/
public static final native int /*long*/ CFDataGetBytePtr(int /*long*/ theData);
@@ -2522,6 +2538,19 @@ public static final native int /*long*/ CFDataGetBytePtr(int /*long*/ theData);
*/
public static final native int /*long*/ CFDataGetLength(int /*long*/ theData);
/**
+ * @param theDict cast=(CFMutableDictionaryRef)
+ * @param key cast=(void*)
+ * @param value cast=(void*)
+ */
+public static final native void CFDictionaryAddValue(int /*long*/ theDict, int /*long*/ key, int /*long*/ value);
+/**
+ * @param allocator cast=(CFAllocatorRef)
+ * @param capacity cast=(CFIndex)
+ * @param keyCallBacks cast=(CFDictionaryKeyCallBacks*)
+ * @param valueCallBacks cast=(CFDictionaryValueCallBacks*)
+ */
+public static final native int /*long*/ CFDictionaryCreateMutable(int /*long*/ allocator, int /*long*/ capacity, int /*long*/ keyCallBacks, int /*long*/ valueCallBacks);
+/**
* @param cf cast=(CFTypeRef)
*/
public static final native void CFRelease(int /*long*/ cf);
@@ -2546,6 +2575,12 @@ public static final native int /*long*/ CFRunLoopObserverCreate(int /*long*/ all
*/
public static final native void CFRunLoopObserverInvalidate(int /*long*/ observer);
/**
+ * @param alloc cast=(CFAllocatorRef)
+ * @param chars cast=(UniChar*)
+ * @param numChars cast=(CFIndex)
+ */
+public static final native int /*long*/ CFStringCreateWithCharacters(int /*long*/ alloc, char[] chars, int /*long*/ numChars);
+/**
* @param allocator cast=(CFAllocatorRef)
* @param originalString cast=(CFStringRef)
* @param charactersToLeaveUnescaped cast=(CFStringRef)
@@ -2571,6 +2606,11 @@ public static final native int /*long*/ CGBitmapContextCreateImage(int /*long*/
* @param c cast=(CGContextRef)
*/
public static final native int /*long*/ CGBitmapContextGetData(int /*long*/ c);
+/**
+ * @param space cast=(CGColorSpaceRef)
+ * @param components cast=(CGFloat*)
+ */
+public static final native int /*long*/ CGColorCreate(int /*long*/ space, float[] /*double[]*/ components);
public static final native int /*long*/ CGColorSpaceCreateDeviceRGB();
/**
* @param space cast=(CGColorSpaceRef)
@@ -2658,6 +2698,27 @@ public static final native void CGContextSetLineWidth(int /*long*/ c, float /*do
public static final native void CGContextSetMiterLimit(int /*long*/ c, float /*double*/ limit);
/**
* @param c cast=(CGContextRef)
+ * @param shouldAntialias cast=(_Bool)
+ */
+public static final native void CGContextSetShouldAntialias(int /*long*/ c, boolean shouldAntialias);
+/**
+ * @param c cast=(CGContextRef)
+ * @param mode cast=(CGTextDrawingMode)
+ */
+public static final native void CGContextSetTextDrawingMode(int /*long*/ c, int mode);
+/**
+ * @param c cast=(CGContextRef)
+ * @param t flags=struct
+ */
+public static final native void CGContextSetTextMatrix(int /*long*/ c, CGAffineTransform t);
+/**
+ * @param c cast=(CGContextRef)
+ * @param x cast=(CGFloat)
+ * @param y cast=(CGFloat)
+ */
+public static final native void CGContextSetTextPosition(int /*long*/ c, float /*double*/ x, float /*double*/ y);
+/**
+ * @param c cast=(CGContextRef)
*/
public static final native void CGContextStrokePath(int /*long*/ c);
/**
@@ -2779,6 +2840,12 @@ public static final native void CGPathAddCurveToPoint(int /*long*/ path, int /*l
*/
public static final native void CGPathAddLineToPoint(int /*long*/ path, int /*long*/ m, float /*double*/ x, float /*double*/ y);
/**
+ * @param path cast=(CGMutablePathRef)
+ * @param m cast=(CGAffineTransform*)
+ * @param rect flags=struct
+ */
+public static final native void CGPathAddRect(int /*long*/ path, int /*long*/ m, CGRect rect);
+/**
* @param path cast=(CGPathRef)
* @param info cast=(void*)
* @param function cast=(CGPathApplierFunction)
@@ -2836,6 +2903,49 @@ public static final native int CGSetLocalEventsSuppressionInterval(double second
*/
public static final native int CGWarpMouseCursorPosition(CGPoint newCursorPosition);
/**
+ * @param font cast=(CTFontRef)
+ */
+public static final native float /*double*/ CTFontGetAscent(int /*long*/ font);
+/**
+ * @param font cast=(CTFontRef)
+ */
+public static final native float /*double*/ CTFontGetDescent(int /*long*/ font);
+/**
+ * @param font cast=(CTFontRef)
+ */
+public static final native float /*double*/ CTFontGetLeading(int /*long*/ font);
+/**
+ * @param string cast=(CFAttributedStringRef)
+ */
+public static final native int /*long*/ CTLineCreateWithAttributedString(int /*long*/ string);
+/**
+ * @param line cast=(CTLineRef)
+ * @param context cast=(CGContextRef)
+ */
+public static final native void CTLineDraw(int /*long*/ line, int /*long*/ context);
+/**
+ * @param line cast=(CTLineRef)
+ * @param ascent cast=(CGFloat*)
+ * @param descent cast=(CGFloat*)
+ * @param leading cast=(CGFloat*)
+ */
+public static final native double CTLineGetTypographicBounds(int /*long*/ line, float[] /*double[]*/ ascent, float[] /*double[]*/ descent, float[] /*double[]*/ leading);
+/**
+ * @param typesetter cast=(CTTypesetterRef)
+ * @param stringRange flags=struct
+ */
+public static final native int /*long*/ CTTypesetterCreateLine(int /*long*/ typesetter, CFRange stringRange);
+/**
+ * @param string cast=(CFAttributedStringRef)
+ */
+public static final native int /*long*/ CTTypesetterCreateWithAttributedString(int /*long*/ string);
+/**
+ * @param typesetter cast=(CTTypesetterRef)
+ * @param startIndex cast=(CFIndex)
+ * @param width cast=(double)
+ */
+public static final native int /*long*/ CTTypesetterSuggestLineBreak(int /*long*/ typesetter, int /*long*/ startIndex, double width);
+/**
* @param aRect flags=struct
* @param bRect flags=struct
*/
@@ -3327,6 +3437,8 @@ public static final native void objc_msgSend_stret(NSSize result, int /*long*/ i
public static final native void objc_msgSend_stret(NSSize result, int /*long*/ id, int /*long*/ sel, boolean arg0);
/** Sizeof natives */
+public static final native int CFRange_sizeof();
+public static final native int CGAffineTransform_sizeof();
public static final native int CGPathElement_sizeof();
public static final native int CGPoint_sizeof();
public static final native int CGRect_sizeof();
@@ -3343,6 +3455,26 @@ public static final native int NSSize_sizeof();
* @param dest cast=(void *),flags=no_in critical
* @param src cast=(void *),flags=critical
*/
+public static final native void memmove(int /*long*/ dest, CFRange src, int /*long*/ size);
+/**
+ * @param dest cast=(void *),flags=no_in critical
+ * @param src cast=(void *),flags=critical
+ */
+public static final native void memmove(CFRange dest, int /*long*/ src, int /*long*/ size);
+/**
+ * @param dest cast=(void *),flags=no_in critical
+ * @param src cast=(void *),flags=critical
+ */
+public static final native void memmove(int /*long*/ dest, CGAffineTransform src, int /*long*/ size);
+/**
+ * @param dest cast=(void *),flags=no_in critical
+ * @param src cast=(void *),flags=critical
+ */
+public static final native void memmove(CGAffineTransform dest, int /*long*/ src, int /*long*/ size);
+/**
+ * @param dest cast=(void *),flags=no_in critical
+ * @param src cast=(void *),flags=critical
+ */
public static final native void memmove(int /*long*/ dest, CGPathElement src, int /*long*/ size);
/**
* @param dest cast=(void *),flags=no_in critical
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras
index 2d1617c9b9..4dee3064e8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras
@@ -394,17 +394,17 @@
<arg name="sender" swt_gen="true"></arg>
</method>
</informal_protocol>
+ <informal_protocol name="WebDocumentRepresentation" swt_gen="true">
+ <method selector="documentSource" swt_gen="true"></method>
+ </informal_protocol>
<informal_protocol name="WebOpenPanelResultListener" swt_gen="true">
<method selector="chooseFilename:" swt_gen="true">
<arg name="theRange" swt_gen="true"></arg>
</method>
</informal_protocol>
- <informal_protocol name="WebDocumentRepresentation" swt_gen="true">
- <method selector="documentSource" swt_gen="true"></method>
- </informal_protocol>
<informal_protocol name="WebPolicyDecisionListener" swt_gen="true">
+ <method selector="ignore" swt_gen="true"></method>
<method selector="use" swt_gen="true"></method>
<method selector="download" swt_gen="true"></method>
- <method selector="ignore" swt_gen="true"></method>
</informal_protocol>
</signatures>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
index 13bca374af..cfcdbf946f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -811,73 +811,6 @@ NSBezierPath createNSBezierPath (int /*long*/ cgPath) {
return bezierPath;
}
-NSAttributedString createString(String string, int flags, boolean draw) {
- NSMutableDictionary dict = ((NSMutableDictionary)new NSMutableDictionary().alloc()).initWithCapacity(5);
- Font font = data.font;
- dict.setObject(font.handle, OS.NSFontAttributeName);
- font.addTraits(dict);
- if (draw) {
- Pattern pattern = data.foregroundPattern;
- if (pattern != null) {
- if (pattern.color != null) dict.setObject(pattern.color, OS.NSForegroundColorAttributeName);
- } else {
- NSColor fg = data.fg;
- if (fg == null) {
- float /*double*/ [] color = data.foreground;
- fg = data.fg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f);
- fg.retain();
- }
- dict.setObject(fg, OS.NSForegroundColorAttributeName);
- }
- }
- if ((flags & SWT.DRAW_TAB) == 0) {
- dict.setObject(device.paragraphStyle, OS.NSParagraphStyleAttributeName);
- }
- int length = string.length();
- char[] chars = new char[length];
- string.getChars(0, length, chars, 0);
- int breakCount = 0;
- int[] breaks = null;
- if ((flags & SWT.DRAW_MNEMONIC) !=0 || (flags & SWT.DRAW_DELIMITER) == 0) {
- int i=0, j=0;
- while (i < chars.length) {
- char c = chars [j++] = chars [i++];
- switch (c) {
- case '&': {
- if ((flags & SWT.DRAW_MNEMONIC) != 0) {
- if (i == chars.length) {continue;}
- if (chars [i] == '&') {i++; continue;}
- j--;
- }
- break;
- }
- case '\r':
- case '\n': {
- if ((flags & SWT.DRAW_DELIMITER) == 0) {
- if (c == '\r' && i != chars.length && chars[i] == '\n') i++;
- j--;
- if (breaks == null) {
- breaks = new int[4];
- } else if (breakCount == breaks.length) {
- int[] newBreaks = new int[breaks.length + 4];
- System.arraycopy(breaks, 0, newBreaks, 0, breaks.length);
- breaks = newBreaks;
- }
- breaks[breakCount++] = j;
- }
- break;
- }
- }
- }
- length = j;
- }
- NSString str = ((NSString)new NSString().alloc()).initWithCharacters(chars, length);
- NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString(str, dict);
- dict.release();
- str.release();
- return attribStr;
-}
-
void destroy() {
/* Free resources */
Image image = data.image;
@@ -1635,7 +1568,8 @@ public void drawText (String string, int x, int y, int flags) {
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
NSAutoreleasePool pool = checkGC(CLIPPING | TRANSFORM | FONT | FOREGROUND_FILL);
try {
- handle.saveGraphicsState();
+ int length = string.length();
+ if (length == 0) return;
boolean mode = true;
switch (data.textAntialias) {
case SWT.DEFAULT:
@@ -1645,37 +1579,131 @@ public void drawText (String string, int x, int y, int flags) {
case SWT.OFF: mode = false; break;
case SWT.ON: mode = true; break;
}
- handle.setShouldAntialias(mode);
- NSAttributedString str = createString(string, flags, true);
- if ((flags & SWT.DRAW_TRANSPARENT) == 0) {
- NSSize size = str.size();
- NSRect rect = new NSRect();
- rect.x = x;
- rect.y = y;
- rect.width = size.width;
- rect.height = size.height;
- NSColor bg = data.bg;
- if (bg == null) {
- float /*double*/ [] color = data.background;
- bg = data.bg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f);
- bg.retain();
+ int /*long*/ context = handle.graphicsPort();
+ OS.CGContextSaveGState(context);
+ OS.CGContextSetShouldAntialias(context, mode);
+ CGAffineTransform transform = new CGAffineTransform();
+ transform.a = 1;
+ transform.d = -1;
+ Font font = data.font;
+ int /*long*/ fontID = font.handle.id;
+ if ((font.extraTraits & OS.NSItalicFontMask) != 0) {
+ transform.c = (float)Font.SYNTHETIC_ITALIC;
+ }
+ if ((font.extraTraits & OS.NSBoldFontMask) != 0) {
+ OS.CGContextSetTextDrawingMode(context, OS.kCGTextFillStroke);
+ OS.CGContextSetLineWidth(context, (float)(font.handle.pointSize() * -Font.SYNTHETIC_BOLD / 100f));
+ }
+ OS.CGContextSetTextMatrix(context, transform);
+ char[] chars = new char[length];
+ string.getChars(0, length, chars, 0);
+ if ((flags & SWT.DRAW_MNEMONIC) != 0 || (flags & SWT.DRAW_TAB) == 0) {
+ int i=0, j=0;
+ while (i < chars.length) {
+ char c = chars [j++] = chars [i++];
+ switch (c) {
+ case '\t': {
+ if ((flags & SWT.DRAW_TAB) == 0) j--;
+ break;
+ }
+ case '&': {
+ if ((flags & SWT.DRAW_MNEMONIC) != 0) {
+ if (i == chars.length) {continue;}
+ if (chars [i] == '&') {i++; continue;}
+ j--;
+ }
+ break;
+ }
+ }
}
- bg.setFill();
- NSBezierPath.fillRect(rect);
- str.drawInRect(rect);
+ length = j;
+ }
+ int /*long*/ dict = OS.CFDictionaryCreateMutable(0, 2, OS.kCFTypeDictionaryKeyCallBacks(), OS.kCFTypeDictionaryValueCallBacks());
+ OS.CFDictionaryAddValue(dict, OS.kCTFontAttributeName(), fontID);
+ int /*long*/ colorspace = OS.CGColorSpaceCreateDeviceRGB();
+ float /*double*/ oldAlpha = data.foreground[3];
+ data.foreground[3] = data.alpha / 255f;
+ int /*long*/ color = OS.CGColorCreate(colorspace, data.foreground);
+ data.foreground[3] = oldAlpha;
+ OS.CFDictionaryAddValue(dict, OS.kCTForegroundColorAttributeName(), color);
+ OS.CFRelease(color);
+ OS.CFRelease(colorspace);
+ int /*long*/ str = OS.CFStringCreateWithCharacters(0, chars, length);
+ int /*long*/ attrStr = OS.CFAttributedStringCreate(0, str, dict);
+ OS.CFRelease(dict);
+ OS.CFRelease(str);
+ float /*double*/ drawX = x, drawY = y;
+ float /*double*/ [] ascent = new float /*double*/ [1];
+ float /*double*/ [] descent = new float /*double*/ [1];
+ float /*double*/ [] leading = new float /*double*/ [1];
+ float /*double*/ fontAscent = OS.CTFontGetAscent(fontID);
+ if ((flags & SWT.DRAW_DELIMITER) != 0) {
+ float /*double*/ fontDescent = OS.CTFontGetDescent(fontID);
+ float /*double*/ fontLeading = OS.CTFontGetLeading(fontID);
+ int /*long*/ typesetter = OS.CTTypesetterCreateWithAttributedString(attrStr);
+ int end = 0;
+ CFRange range = new CFRange();
+ while (end < length) {
+ char c = chars[end++];
+ switch (c) {
+ case '\r':
+ case '\n': {
+ range.length = end - range.location - 1;
+ if (c == '\r' && end != chars.length && chars[end] == '\n') end++;
+ if (range.length > 0) {
+ int /*long*/ line = OS.CTTypesetterCreateLine(typesetter, range);
+ drawText(context, flags, drawX, drawY, line, ascent, descent, leading, fontAscent);
+ OS.CFRelease(line);
+ drawY += ascent[0] + descent[0] + leading[0];
+ } else {
+ drawY += fontAscent + fontDescent + fontLeading;
+ }
+ range.location = end;
+ }
+ }
+ }
+ if (range.location != end) {
+ range.length = end - range.location;
+ int /*long*/ line = OS.CTTypesetterCreateLine(typesetter, range);
+ drawText(context, flags, drawX, drawY, line, ascent, descent, leading, fontAscent);
+ OS.CFRelease(line);
+ }
+ OS.CFRelease(typesetter);
} else {
- NSPoint pt = new NSPoint();
- pt.x = x;
- pt.y = y;
- str.drawAtPoint(pt);
+ int /*long*/ line = OS.CTLineCreateWithAttributedString(attrStr);
+ drawText(context, flags, drawX, drawY, line, ascent, descent, leading, fontAscent);
+ OS.CFRelease(line);
}
- str.release();
- handle.restoreGraphicsState();
+ OS.CFRelease(attrStr);
+ OS.CGContextRestoreGState(context);
} finally {
uncheckGC(pool);
}
}
+void drawText (int /*long*/ context, int flags, float /*double*/ x, float /*double*/ y, int /*long*/ line, float /*double*/ [] ascent, float /*double*/ [] descent, float /*double*/ [] leading, float /*double*/ fontAscent) {
+ double width = 0;
+ if ((flags & SWT.DRAW_DELIMITER) != 0 || (flags & SWT.DRAW_TRANSPARENT) == 0) {
+ width = OS.CTLineGetTypographicBounds(line, ascent, descent, leading);
+ }
+ if ((flags & SWT.DRAW_TRANSPARENT) == 0) {
+ CGRect rect = new CGRect();
+ rect.origin.x = x;
+ rect.origin.y = y;
+ rect.size.width = (float)Math.ceil(width);
+ rect.size.height = (float)Math.ceil(ascent[0] + descent[0] + leading[0]);
+ OS.CGContextSaveGState(context);
+ float /*double*/ oldAlpha = data.background[3];
+ data.background[3] = data.alpha / 255f;
+ OS.CGContextSetFillColor(context, data.background);
+ data.background[3] = oldAlpha;
+ OS.CGContextFillRect(context, rect);
+ OS.CGContextRestoreGState(context);
+ }
+ OS.CGContextSetTextPosition(context, x, y + fontAscent);
+ OS.CTLineDraw(line, context);
+}
+
/**
* Compares the argument to the receiver, and returns true
* if they represent the <em>same</em> object using a class
@@ -3894,10 +3922,89 @@ public Point textExtent(String string, int flags) {
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
NSAutoreleasePool pool = checkGC(FONT);
try {
- NSAttributedString str = createString(string, flags, false);
- NSSize size = str.size();
- str.release();
- return new Point((int)size.width, (int)size.height);
+ int length = string.length();
+ Font font = data.font;
+ int /*long*/ fontID = font.handle.id;
+ if (length == 0) {
+ return new Point(0, (int)(0.5f + OS.CTFontGetAscent(fontID)) + (int)(0.5f + OS.CTFontGetDescent(fontID) + OS.CTFontGetLeading(fontID)));
+ }
+ char[] chars = new char[length];
+ string.getChars(0, length, chars, 0);
+ if ((flags & SWT.DRAW_MNEMONIC) != 0 || (flags & SWT.DRAW_TAB) == 0) {
+ int i=0, j=0;
+ while (i < chars.length) {
+ char c = chars [j++] = chars [i++];
+ switch (c) {
+ case '\t': {
+ if ((flags & SWT.DRAW_TAB) == 0) j--;
+ break;
+ }
+ case '&': {
+ if ((flags & SWT.DRAW_MNEMONIC) != 0) {
+ if (i == chars.length) {continue;}
+ if (chars [i] == '&') {i++; continue;}
+ j--;
+ }
+ break;
+ }
+ }
+ }
+ length = j;
+ }
+ int /*long*/ dict = OS.CFDictionaryCreateMutable(0, 1, OS.kCFTypeDictionaryKeyCallBacks(), OS.kCFTypeDictionaryValueCallBacks());
+ OS.CFDictionaryAddValue(dict, OS.kCTFontAttributeName(), font.handle.id);
+ int /*long*/ str = OS.CFStringCreateWithCharacters(0, chars, length);
+ int /*long*/ attrStr = OS.CFAttributedStringCreate(0, str, dict);
+ OS.CFRelease(dict);
+ OS.CFRelease(str);
+ float /*double*/ [] ascent = new float /*double*/ [1];
+ float /*double*/ [] descent = new float /*double*/ [1];
+ float /*double*/ [] leading = new float /*double*/ [1];
+ double width = 0, height = 0;
+ if ((flags & SWT.DRAW_DELIMITER) != 0) {
+ float /*double*/ fontAscent = OS.CTFontGetAscent(fontID);
+ float /*double*/ fontDescent = OS.CTFontGetDescent(fontID);
+ float /*double*/ fontLeading = OS.CTFontGetLeading(fontID);
+ int /*long*/ typesetter = OS.CTTypesetterCreateWithAttributedString(attrStr);
+ int end = 0;
+ CFRange range = new CFRange();
+ while (end < length) {
+ char c = chars[end++];
+ switch (c) {
+ case '\r':
+ case '\n': {
+ range.length = end - range.location - 1;
+ if (c == '\r' && end != chars.length && chars[end] == '\n') end++;
+ if (range.length > 0) {
+ int /*long*/ line = OS.CTTypesetterCreateLine(typesetter, range);
+ width = Math.max(width, OS.CTLineGetTypographicBounds(line, ascent, descent, leading));
+ height += ascent[0] + descent[0] + leading[0];
+ OS.CFRelease(line);
+ } else {
+ height += fontAscent + fontDescent + fontLeading;
+ }
+ range.location = end;
+ }
+ }
+ }
+ if (range.location != end) {
+ range.length = end - range.location;
+ int /*long*/ line = OS.CTTypesetterCreateLine(typesetter, range);
+ width = Math.max(width, OS.CTLineGetTypographicBounds(line, ascent, descent, leading));
+ height += ascent[0] + descent[0] + leading[0];
+ OS.CFRelease(line);
+ } else {
+ height += fontAscent + fontDescent + fontLeading;
+ }
+ OS.CFRelease(typesetter);
+ } else {
+ int /*long*/ line = OS.CTLineCreateWithAttributedString(attrStr);
+ width = OS.CTLineGetTypographicBounds(line, ascent, descent, leading);
+ height = ascent[0] + descent[0] + leading[0];
+ OS.CFRelease(line);
+ }
+ OS.CFRelease(attrStr);
+ return new Point((int)Math.ceil(width), (int)Math.ceil(height));
} finally {
uncheckGC(pool);
}

Back to the top