summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2008-07-10 21:15:39 +0000
committerSilenio Quarti <silenio>2008-07-10 21:15:39 +0000
commit1a6e006e3846000447e8938db0bd1aa6f52d6fd2 (patch)
treeb277e3b89cbd29fd30fe995641bc2d1eb4bf5f33
parente7a466f558751d15ec36d3e5484520377fa6315e (diff)
downloadeclipse.platform.swt-1a6e006e3846000447e8938db0bd1aa6f52d6fd2.tar.gz
eclipse.platform.swt-1a6e006e3846000447e8938db0bd1aa6f52d6fd2.tar.xz
eclipse.platform.swt-1a6e006e3846000447e8938db0bd1aa6f52d6fd2.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c66
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c93
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java13
5 files changed, 195 insertions, 3 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 14ae9aba0b..b9968585ad 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
@@ -348,6 +348,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(NSBitsPerPixelFromDepth)
}
#endif
+#ifndef NO_NSCalibratedRGBColorSpace
+JNIEXPORT jint JNICALL OS_NATIVE(NSCalibratedRGBColorSpace)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSCalibratedRGBColorSpace_FUNC);
+ rc = (jint)NSCalibratedRGBColorSpace;
+ OS_NATIVE_EXIT(env, that, NSCalibratedRGBColorSpace_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_NSDefaultRunLoopMode
JNIEXPORT jint JNICALL OS_NATIVE(NSDefaultRunLoopMode)
(JNIEnv *env, jclass that)
@@ -931,6 +943,32 @@ fail:
}
#endif
+#ifndef NO_class_1addProtocol
+JNIEXPORT jboolean JNICALL OS_NATIVE(class_1addProtocol)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, class_1addProtocol_FUNC);
+ rc = (jboolean)class_addProtocol((Class)arg0, (Protocol *)arg1);
+ OS_NATIVE_EXIT(env, that, class_1addProtocol_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_memmove__ILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2)
+{
+ NSRange _arg1, *lparg1=NULL;
+ OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg1) if ((lparg1 = getNSRangeFields(env, arg1, &_arg1)) == NULL) goto fail;
+ memmove((void *)arg0, (void *)lparg1, arg2);
+fail:
+ if (arg1 && lparg1) setNSRangeFields(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+}
+#endif
+
#ifndef NO_memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I
JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I)
(JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2)
@@ -1033,6 +1071,22 @@ fail:
}
#endif
+#ifndef NO_objc_1getProtocol
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1getProtocol)
+ (JNIEnv *env, jclass that, jstring arg0)
+{
+ const char *lparg0= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1getProtocol_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetStringUTFChars(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)objc_getProtocol(lparg0);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseStringUTFChars(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1getProtocol_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_objc_1lookUpClass
JNIEXPORT jint JNICALL OS_NATIVE(objc_1lookUpClass)
(JNIEnv *env, jclass that, jstring arg0)
@@ -5084,6 +5138,18 @@ fail:
}
#endif
+#ifndef NO_object_1setClass
+JNIEXPORT jint JNICALL OS_NATIVE(object_1setClass)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, object_1setClass_FUNC);
+ rc = (jint)object_setClass((id)arg0, (Class)arg1);
+ OS_NATIVE_EXIT(env, that, object_1setClass_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_object_1setInstanceVariable
JNIEXPORT jint JNICALL OS_NATIVE(object_1setInstanceVariable)
(JNIEnv *env, jclass that, jint arg0, jstring arg1, jint arg2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c
index 12a1d17686..7a9317d96d 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c
@@ -441,3 +441,96 @@ JNIEXPORT SWT_PTR JNICALL OS_NATIVE(webView_1setFrame_1CALLBACK)
return (SWT_PTR)webView_1setFrame;
}
#endif
+
+#ifndef NO_setMarkedText_1selectedRange_1CALLBACK
+static SWT_PTR setMarkedText_1selectedRange_1CALLBACK;
+static void setMarkedText_1selectedRange(id obj, SEL sel, id *arg0, NSRange arg1)
+{
+ ((void (*)(id, SEL, id*, NSRange*))setMarkedText_1selectedRange_1CALLBACK)(obj, sel, arg0, &arg1);
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(setMarkedText_1selectedRange_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ setMarkedText_1selectedRange_1CALLBACK = func;
+ return (SWT_PTR)setMarkedText_1selectedRange;
+}
+#endif
+
+#ifndef NO_selectedRange_1CALLBACK
+static SWT_PTR selectedRange_1CALLBACK;
+static NSRange selectedRangeProc(id obj, SEL sel)
+{
+ NSRange* ptr = ((NSRange* (*)(id, SEL))selectedRange_1CALLBACK)(obj, sel);
+ NSRange range = *ptr;
+ free(ptr);
+ return range;
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(selectedRange_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ selectedRange_1CALLBACK = func;
+ return (SWT_PTR)selectedRangeProc;
+}
+#endif
+
+#ifndef NO_markedRange_1CALLBACK
+static SWT_PTR markedRange_1CALLBACK;
+static NSRange markedRangeProc(id obj, SEL sel)
+{
+ NSRange* ptr = ((NSRange* (*)(id, SEL))markedRange_1CALLBACK)(obj, sel);
+ NSRange range = *ptr;
+ free(ptr);
+ return range;
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(markedRange_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ markedRange_1CALLBACK = func;
+ return (SWT_PTR)markedRangeProc;
+}
+#endif
+
+#ifndef NO_characterIndexForPoint_1CALLBACK
+static SWT_PTR characterIndexForPoint_1CALLBACK;
+static int characterIndexForPoint(id obj, SEL sel, NSPoint point)
+{
+ return ((int (*)(id, SEL, NSPoint*))characterIndexForPoint_1CALLBACK)(obj, sel, &point);
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(characterIndexForPoint_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ characterIndexForPoint_1CALLBACK = func;
+ return (SWT_PTR)characterIndexForPoint;
+}
+#endif
+
+#ifndef NO_firstRectForCharacterRange_1CALLBACK
+static SWT_PTR firstRectForCharacterRange_1CALLBACK;
+static NSRect firstRectForCharacterRangeProc(id obj, SEL sel, NSRange arg0)
+{
+ NSRect* ptr = ((NSRect* (*)(id, SEL, NSRange*))firstRectForCharacterRange_1CALLBACK)(obj, sel, &arg0);
+ NSRect result = *ptr;
+ free(ptr);
+ return result;
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(firstRectForCharacterRange_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ firstRectForCharacterRange_1CALLBACK = func;
+ return (SWT_PTR)firstRectForCharacterRangeProc;
+}
+#endif
+
+#ifndef NO_attributedSubstringFromRange_1CALLBACK
+static SWT_PTR attributedSubstringFromRange_1CALLBACK;
+static id attributedSubstringFromRangeProc(id obj, SEL sel, NSRange arg0)
+{
+ return ((id (*)(id, SEL, NSRange*))attributedSubstringFromRange_1CALLBACK)(obj, sel, &arg0);
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(attributedSubstringFromRange_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ attributedSubstringFromRange_1CALLBACK = func;
+ return (SWT_PTR)attributedSubstringFromRangeProc;
+}
+#endif
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 28da71661c..d34f561f89 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 = 337;
-int OS_nativeFunctionCallCount[337];
+int OS_nativeFunctionCount = 348;
+int OS_nativeFunctionCallCount[348];
char * OS_nativeFunctionNames[] = {
"CGWarpMouseCursorPosition",
"CloseRgn",
@@ -35,6 +35,7 @@ char * OS_nativeFunctionNames[] = {
"NSBackgroundColorAttributeName",
"NSBaselineOffsetAttributeName",
"NSBitsPerPixelFromDepth",
+ "NSCalibratedRGBColorSpace",
"NSDefaultRunLoopMode",
"NSDeviceRGBColorSpace",
"NSDeviceResolution",
@@ -67,10 +68,16 @@ char * OS_nativeFunctionNames[] = {
"SetRect",
"TransformProcessType",
"UnionRgn",
+ "attributedSubstringFromRange_1CALLBACK",
+ "characterIndexForPoint_1CALLBACK",
"class_1addIvar",
"class_1addMethod",
+ "class_1addProtocol",
"drawRect_1CALLBACK",
+ "firstRectForCharacterRange_1CALLBACK",
"hitTest_1CALLBACK",
+ "markedRange_1CALLBACK",
+ "memmove__ILorg_eclipse_swt_internal_cocoa_NSRange_2I",
"memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I",
"memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II",
"memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II",
@@ -78,6 +85,7 @@ char * OS_nativeFunctionNames[] = {
"memmove__Lorg_eclipse_swt_internal_cocoa_NSSize_2II",
"objc_1allocateClassPair",
"objc_1getClass",
+ "objc_1getProtocol",
"objc_1lookUpClass",
"objc_1msgSend__II",
"objc_1msgSend__IIB",
@@ -348,11 +356,14 @@ char * OS_nativeFunctionNames[] = {
"objc_1registerClassPair",
"object_1getClassName",
"object_1getInstanceVariable",
+ "object_1setClass",
"object_1setInstanceVariable",
"sel_1registerName",
+ "selectedRange_1CALLBACK",
"setFrameOrigin_1CALLBACK",
"setFrameSize_1CALLBACK",
"setFrame_1CALLBACK",
+ "setMarkedText_1selectedRange_1CALLBACK",
"webView_1setFrame_1CALLBACK",
};
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 b408bb1162..d1010e3aa8 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
@@ -43,6 +43,7 @@ typedef enum {
NSBackgroundColorAttributeName_FUNC,
NSBaselineOffsetAttributeName_FUNC,
NSBitsPerPixelFromDepth_FUNC,
+ NSCalibratedRGBColorSpace_FUNC,
NSDefaultRunLoopMode_FUNC,
NSDeviceRGBColorSpace_FUNC,
NSDeviceResolution_FUNC,
@@ -75,10 +76,16 @@ typedef enum {
SetRect_FUNC,
TransformProcessType_FUNC,
UnionRgn_FUNC,
+ attributedSubstringFromRange_1CALLBACK_FUNC,
+ characterIndexForPoint_1CALLBACK_FUNC,
class_1addIvar_FUNC,
class_1addMethod_FUNC,
+ class_1addProtocol_FUNC,
drawRect_1CALLBACK_FUNC,
+ firstRectForCharacterRange_1CALLBACK_FUNC,
hitTest_1CALLBACK_FUNC,
+ markedRange_1CALLBACK_FUNC,
+ memmove__ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
@@ -86,6 +93,7 @@ typedef enum {
memmove__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC,
objc_1allocateClassPair_FUNC,
objc_1getClass_FUNC,
+ objc_1getProtocol_FUNC,
objc_1lookUpClass_FUNC,
objc_1msgSend__II_FUNC,
objc_1msgSend__IIB_FUNC,
@@ -356,10 +364,13 @@ typedef enum {
objc_1registerClassPair_FUNC,
object_1getClassName_FUNC,
object_1getInstanceVariable_FUNC,
+ object_1setClass_FUNC,
object_1setInstanceVariable_FUNC,
sel_1registerName_FUNC,
+ selectedRange_1CALLBACK_FUNC,
setFrameOrigin_1CALLBACK_FUNC,
setFrameSize_1CALLBACK_FUNC,
setFrame_1CALLBACK_FUNC,
+ setMarkedText_1selectedRange_1CALLBACK_FUNC,
webView_1setFrame_1CALLBACK_FUNC,
} OS_FUNCS;
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 cc281e9dbb..7d5f4a0d36 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
@@ -85,13 +85,16 @@ public static final int kQDRegionToRectsMsgParse = 2;
public static final native boolean class_addIvar(int cls, String name, int size, byte alignment, String types);
public static final native boolean class_addMethod(int cls, int name, int imp, String types);
+public static final native boolean class_addProtocol(int cls, int protocol);
public static final native int objc_allocateClassPair(int superclass, String name, int extraBytes);
public static final native int objc_getClass(String className);
+public static final native int objc_getProtocol(String name);
public static final native int objc_lookUpClass(String className);
public static final native void objc_registerClassPair(int cls);
public static final native int object_getClassName(int obj);
public static final native int object_getInstanceVariable(int obj, String name, int[] outValue);
public static final native int object_setInstanceVariable(int obj, String name, int value);
+public static final native int object_setClass(int obj, int clazz);
public static final native int sel_registerName(String selectorName);
@@ -363,6 +366,12 @@ public static final native int setFrameOrigin_CALLBACK(int func);
public static final native int setFrameSize_CALLBACK(int func);
public static final native int hitTest_CALLBACK(int func);
public static final native int webView_setFrame_CALLBACK(int func);
+public static final native int markedRange_CALLBACK(int func);
+public static final native int selectedRange_CALLBACK(int func);
+public static final native int attributedSubstringFromRange_CALLBACK(int func);
+public static final native int setMarkedText_selectedRange_CALLBACK(int func);
+public static final native int characterIndexForPoint_CALLBACK(int func);
+public static final native int firstRectForCharacterRange_CALLBACK(int func);
public static final native int objc_msgSendSuper(objc_super superId, int sel);
public static final native int objc_msgSendSuper(objc_super superId, int sel, NSRect arg0);
@@ -375,6 +384,7 @@ public static final native void memmove (NSRect dest, int /*long*/ src, int /*lo
public static final native void memmove (NSPoint dest, int /*long*/ src, int /*long*/ size);
public static final native void memmove (NSSize dest, int /*long*/ src, int /*long*/ size);
public static final native void memmove (NSRange dest, int /*long*/ src, int /*long*/ size);
+public static final native void memmove (int /*long*/ dest, NSRange src, int /*long*/ size);
/** Classes */
public static final int class_NSScanner = objc_getClass("NSScanner");
@@ -9320,7 +9330,8 @@ public static final native int NSBaselineOffsetAttributeName();
//public static final native int NSBrowserColumnConfigurationDidChangeNotification();
//public static final native int NSBrowserIllegalDelegateException();
//public static final native int NSCalibratedBlackColorSpace();
-//public static final native int NSCalibratedRGBColorSpace();
+public static final NSString NSCalibratedRGBColorSpace = new NSString(NSCalibratedRGBColorSpace());
+public static final native int NSCalibratedRGBColorSpace();
//public static final native int NSCalibratedWhiteColorSpace();
//public static final native int NSCharacterEncodingDocumentAttribute();
//public static final native int NSCharacterEncodingDocumentOption();