summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/carbon
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2010-02-26 15:19:36 +0000
committerSilenio Quarti <silenio>2010-02-26 15:19:36 +0000
commitca2b791c06a9d675e378600c962ec2edb94eb7eb (patch)
tree6773e09289189daa3c3097d60500cb48321b3503 /bundles/org.eclipse.swt/Eclipse SWT PI/carbon
parent30f672395169133411dec6a6b095d380c65985b4 (diff)
downloadeclipse.platform.swt-ca2b791c06a9d675e378600c962ec2edb94eb7eb.tar.gz
eclipse.platform.swt-ca2b791c06a9d675e378600c962ec2edb94eb7eb.tar.xz
eclipse.platform.swt-ca2b791c06a9d675e378600c962ec2edb94eb7eb.zip
BugÊ201148 - [mac] TrayItem menus should be drop downs rooted to the menu bar
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/carbon')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa.c48
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_custom.c15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.c10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.h6
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/cocoa/Cocoa.java16
5 files changed, 93 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa.c
index dc80e60634..d1995b9e7e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa.c
@@ -79,6 +79,25 @@ JNIEXPORT jint JNICALL Cocoa_NATIVE(NSDeviceRGBColorSpace)
}
#endif
+#ifndef NO_NSPointInRect
+JNIEXPORT jboolean JNICALL Cocoa_NATIVE(NSPointInRect)
+ (JNIEnv *env, jclass that, jobject arg0, jobject arg1)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSRect _arg1, *lparg1=NULL;
+ jboolean rc = 0;
+ Cocoa_NATIVE_ENTER(env, that, NSPointInRect_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg1) if ((lparg1 = getNSRectFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jboolean)NSPointInRect(*lparg0, *lparg1);
+fail:
+ if (arg1 && lparg1) setNSRectFields(env, arg1, lparg1);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ Cocoa_NATIVE_EXIT(env, that, NSPointInRect_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_NSSearchPathForDirectoriesInDomains
JNIEXPORT jint JNICALL Cocoa_NATIVE(NSSearchPathForDirectoriesInDomains)
(JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2)
@@ -479,6 +498,35 @@ JNIEXPORT jdouble JNICALL Cocoa_NATIVE(objc_1msgSend_1fpret)
}
#endif
+#if (!defined(NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II) && !defined(JNI64)) || (!defined(NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2JJ) && defined(JNI64))
+#ifndef JNI64
+JNIEXPORT void JNICALL Cocoa_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
+#else
+JNIEXPORT void JNICALL Cocoa_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2JJ)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
+#endif
+{
+ NSPoint _arg0, *lparg0=NULL;
+#ifndef JNI64
+ Cocoa_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+#else
+ Cocoa_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2JJ_FUNC);
+#endif
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (sizeof(_arg0) > STRUCT_SIZE_LIMIT) {
+ *lparg0 = (*(NSPoint (*)(jintLong, jintLong))objc_msgSend_stret)(arg1, arg2);
+ } else {
+ *lparg0 = (*(NSPoint (*)(jintLong, jintLong))objc_msgSend)(arg1, arg2);
+ }
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+#ifndef JNI64
+ Cocoa_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+#else
+ Cocoa_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2JJ_FUNC);
+#endif
+}
+#endif
+
#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II
JNIEXPORT void JNICALL Cocoa_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II)
(JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_custom.c
index 168a6e79d9..bf5189c3f8 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_custom.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_custom.c
@@ -86,6 +86,21 @@ fail:
proc((int)self, user_data, 3, &rect);
[super drawRect: rect];
}
+
+- (void)rightMouseUp:(NSEvent *)event
+{
+ proc((int)self, user_data, 4, event);
+}
+
+- (void)mouseDragged:(NSEvent *)event
+{
+ proc((int)self, user_data, 5, event);
+}
+
+- (void)rightMouseDragged:(NSEvent *)event
+{
+ proc((int)self, user_data, 6, event);
+}
@end
@interface WebKitDelegate : NSObject
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.c
index a51c942092..1ce7cdb24f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.c
@@ -14,14 +14,15 @@
#ifdef NATIVE_STATS
-int Cocoa_nativeFunctionCount = 36;
-int Cocoa_nativeFunctionCallCount[36];
+int Cocoa_nativeFunctionCount = 38;
+int Cocoa_nativeFunctionCallCount[38];
char * Cocoa_nativeFunctionNames[] = {
"HICocoaViewCreate",
"HIJavaViewCreateWithCocoaView",
"HIWebViewCreate",
"HIWebViewGetWebView",
"NSDeviceRGBColorSpace",
+ "NSPointInRect",
"NSSearchPathForDirectoriesInDomains",
"WebInitForCarbon",
"class_1getClassMethod",
@@ -50,6 +51,11 @@ char * Cocoa_nativeFunctionNames[] = {
"objc_1msgSend__II_3C",
"objc_1msgSend__II_3IIIIIIIIIII",
"objc_1msgSend_1fpret",
+#ifndef JNI64
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II",
+#else
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2JJ",
+#endif
"objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II",
"objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I",
"sel_1registerName",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.h
index c81ba28683..e7c3c70759 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/cocoa_stats.h
@@ -30,6 +30,7 @@ typedef enum {
HIWebViewCreate_FUNC,
HIWebViewGetWebView_FUNC,
NSDeviceRGBColorSpace_FUNC,
+ NSPointInRect_FUNC,
NSSearchPathForDirectoriesInDomains_FUNC,
WebInitForCarbon_FUNC,
class_1getClassMethod_FUNC,
@@ -58,6 +59,11 @@ typedef enum {
objc_1msgSend__II_3C_FUNC,
objc_1msgSend__II_3IIIIIIIIIII_FUNC,
objc_1msgSend_1fpret_FUNC,
+#ifndef JNI64
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
+#else
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2JJ_FUNC,
+#endif
objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC,
objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
sel_1registerName_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/cocoa/Cocoa.java b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/cocoa/Cocoa.java
index 337be87f8e..17f699b3e5 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/cocoa/Cocoa.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/cocoa/Cocoa.java
@@ -187,6 +187,7 @@ public static final int S_initWithImage_hotSpot = Cocoa.sel_registerName("initWi
public static final int S_set = Cocoa.sel_registerName("set"); //$NON-NLS-1$
public static final int S_init = Cocoa.sel_registerName("init"); //$NON-NLS-1$
public static final int S_frame = Cocoa.sel_registerName("frame"); //$NON-NLS-1$
+public static final int S_display = Cocoa.sel_registerName("display"); //$NON-NLS-1$
public static final int S_window = Cocoa.sel_registerName("window"); //$NON-NLS-1$
public static final int S_makeKeyWindow = Cocoa.sel_registerName("makeKeyWindow"); //$NON-NLS-1$
public static final int S_addRepresentation = Cocoa.sel_registerName("addRepresentation:"); //$NON-NLS-1$
@@ -230,6 +231,7 @@ public static final int S_setHTTPBody = Cocoa.sel_registerName("setHTTPBody:");
public static final int S_setHTTPMethod = Cocoa.sel_registerName("setHTTPMethod:"); //$NON-NLS-1$
public static final int S_setCustomUserAgent = Cocoa.sel_registerName("setCustomUserAgent:"); //$NON-NLS-1$
public static final int S_setValueForHTTPHeaderField = Cocoa.sel_registerName("setValue:forHTTPHeaderField:"); //$NON-NLS-1$
+public static final int S_locationInWindow = sel_registerName("locationInWindow");
public static final int NSAlphaFirstBitmapFormat = 1 << 0;
public static final int NSAlphaNonpremultipliedBitmapFormat = 1 << 1;
@@ -252,6 +254,13 @@ public static final int NSDesktopDirectory = 12;
public static final int NSDocumentDirectory = 9;
public static final int NSDownloadsDirectory = 15;
+public static final int NSRightMouseDown = 3;
+public static final int NSRightMouseDragged = 7;
+public static final int NSRightMouseUp = 4;
+public static final int NSLeftMouseDown = 1;
+public static final int NSLeftMouseDragged = 6;
+public static final int NSLeftMouseUp = 2;
+
/* WebKit */
/** @param outView cast=(HIViewRef *) */
public static final native int HIWebViewCreate(int[] outView);
@@ -392,6 +401,8 @@ public static final native double objc_msgSend_fpret(int /*long*/ id, int /*long
* @param selector cast=(SEL)
*/
public static final native void objc_msgSend_stret(NSRect result, int object, int selector);
+/** @method flags=cast */
+public static final native void objc_msgSend_stret(NSPoint result, int /*long*/ id, int /*long*/ sel);
/**
* @param result cast=(void *)
* @param object cast=(void *)
@@ -405,6 +416,11 @@ public static final native int sel_registerName(byte[] selectorName);
/** @method flags=const */
public static final native int NSDeviceRGBColorSpace();
/**
+ * @param aPoint flags=struct
+ * @param aRect flags=struct
+ */
+public static final native boolean NSPointInRect(NSPoint aPoint, NSRect aRect);
+/**
* @param directory cast=(NSSearchPathDirectory)
* @param domainMask cast=(NSSearchPathDomainMask)
* @param expandTilde cast=(BOOL)