Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Barbero2015-03-27 13:08:03 +0000
committerMikael Barbero2015-03-30 06:26:08 +0000
commit463b445e5189bdb31ebc3e9fa1c8a347e23259d7 (patch)
tree2cb0bfc279ad873dea615e55d276a4cc90509d2e /bundles/org.eclipse.swt/Eclipse SWT AWT
parentedbb82693f3c8b5bbb22f50b299c3ef48ae9378f (diff)
downloadeclipse.platform.swt-463b445e5189bdb31ebc3e9fa1c8a347e23259d7.tar.gz
eclipse.platform.swt-463b445e5189bdb31ebc3e9fa1c8a347e23259d7.tar.xz
eclipse.platform.swt-463b445e5189bdb31ebc3e9fa1c8a347e23259d7.zip
Bug 462955 - Make SWT compile on OS X Yosemite.
- Create a JAWT_MacOSXDrawingSurfaceInfo struct as it does not exist anymore with JAWT 1.7 - Use Oracle's JDK location for headers instead of Apple's one when not available - Make #include path of mach-o/dyld.h relative rather than absolute to /usr/include as it does not exist anymore on Yosemite. Change-Id: I426552d641a715dd732c76b5939c2e887074fc3c Signed-off-by: Mikael Barbero <mikael@eclipse.org>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT AWT')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/library/swt_awt.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/library/swt_awt.c b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/library/swt_awt.c
index cca746c2ab..29a9899008 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/library/swt_awt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/library/swt_awt.c
@@ -13,8 +13,24 @@
#include "swt.h"
#include "jawt_md.h"
+#ifdef __OBJC__
+#import <AppKit/NSView.h>
+#endif
+
#define SWT_AWT_NATIVE(func) Java_org_eclipse_swt_awt_SWT_1AWT_##func
+/*
+ * JAWT version 1.7 does not define the type JAWT_MacOSXDrawingSurfaceInfo.
+ */
+#ifdef JAWT_VERSION_1_7
+// Legacy NSView-based rendering
+typedef struct JAWT_MacOSXDrawingSurfaceInfo {
+ NSView *cocoaViewRef; // the view is guaranteed to be valid only for the duration of Component.paint method
+}
+JAWT_MacOSXDrawingSurfaceInfo;
+#endif /* #ifdef JAWT_VERSION_1_7 */
+
+
#ifndef NO_getAWTHandle
JNIEXPORT jintLong JNICALL SWT_AWT_NATIVE(getAWTHandle)
(JNIEnv *env, jclass that, jobject canvas)
@@ -26,7 +42,7 @@ JNIEXPORT jintLong JNICALL SWT_AWT_NATIVE(getAWTHandle)
JAWT_MacOSXDrawingSurfaceInfo* dsi_cocoa;
jint lock;
- awt.version = JAWT_VERSION_1_4;
+ awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
if (JAWT_GetAWT(env, &awt) != 0) {
ds = awt.GetDrawingSurface(env, canvas);
if (ds != NULL) {

Back to the top