diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2011-08-03 18:17:36 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2011-08-03 18:17:36 -0400 |
commit | b74b414065a855cd1f454e71dbb13ea90f41b4d8 (patch) | |
tree | 3dc7a8dfb3d277bbd7443bcd8746fff821c306c8 /bundles/org.eclipse.swt/Eclipse SWT PI | |
parent | a0e9a2f658ad11e7c613ab7218b7cf8b48f05fc9 (diff) | |
download | eclipse.platform.swt-b74b414065a855cd1f454e71dbb13ea90f41b4d8.tar.gz eclipse.platform.swt-b74b414065a855cd1f454e71dbb13ea90f41b4d8.tar.xz eclipse.platform.swt-b74b414065a855cd1f454e71dbb13ea90f41b4d8.zip |
Bug 352694 - GC can not capture screen correctly in MAC 10.7 lion
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
10 files changed, 61 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c index bda460f384..0e88a7fd1e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c @@ -2748,6 +2748,26 @@ JNIEXPORT jint JNICALL OS_NATIVE(CGDisplayBytesPerRow) } #endif +#ifndef NO_CGDisplayCreateImage +JNIEXPORT jintLong JNICALL OS_NATIVE(CGDisplayCreateImage) + (JNIEnv *env, jclass that, jint arg0) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, CGDisplayCreateImage_FUNC); +/* + rc = (jintLong)CGDisplayCreateImage((CGDirectDisplayID)arg0); +*/ + { + LOAD_FUNCTION(fp, CGDisplayCreateImage) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(CGDirectDisplayID))fp)((CGDirectDisplayID)arg0); + } + } + OS_NATIVE_EXIT(env, that, CGDisplayCreateImage_FUNC); + return rc; +} +#endif + #ifndef NO_CGDisplayHideCursor JNIEXPORT jint JNICALL OS_NATIVE(CGDisplayHideCursor) (JNIEnv *env, jclass that, jint arg0) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_custom.h index 0c66ec8354..49c9b8c278 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_custom.h @@ -33,3 +33,4 @@ #define AXUIElementCreateWithDataBrowserAndItemInfo_LIB "com.apple.Carbon" #define PMPrinterGetOutputResolution_LIB "com.apple.Carbon" #define PMShowPrintDialogWithOptions_LIB "com.apple.Carbon" +#define CGDisplayCreateImage_LIB "com.apple.Carbon" diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c index ae3a9c161c..b1a212bed4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1015; -int OS_nativeFunctionCallCount[1015]; +int OS_nativeFunctionCount = 1016; +int OS_nativeFunctionCallCount[1016]; char * OS_nativeFunctionNames[] = { "AECoerceDesc", "AECountItems", @@ -229,6 +229,7 @@ char * OS_nativeFunctionNames[] = { "CGDisplayBitsPerSample", "CGDisplayBounds", "CGDisplayBytesPerRow", + "CGDisplayCreateImage", "CGDisplayHideCursor", "CGDisplayPixelsHigh", "CGDisplayPixelsWide", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h index 32d36401e2..8eb9478aa4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h @@ -237,6 +237,7 @@ typedef enum { CGDisplayBitsPerSample_FUNC, CGDisplayBounds_FUNC, CGDisplayBytesPerRow_FUNC, + CGDisplayCreateImage_FUNC, CGDisplayHideCursor_FUNC, CGDisplayPixelsHigh_FUNC, CGDisplayPixelsWide_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java index 9881449a9d..8ba01edff4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java @@ -2045,6 +2045,11 @@ public static final native int CGDisplayBitsPerPixel (int display); public static final native int CGDisplayBitsPerSample (int display); /** @param display cast=(CGDirectDisplayID) */ public static final native int CGDisplayBytesPerRow (int display); +/** + * @method flags=dynamic + * @param displayID cast=(CGDirectDisplayID) + */ +public static final native int /*long*/ CGDisplayCreateImage(int displayID); /** @param display cast=(CGDirectDisplayID) */ public static final native int CGDisplayPixelsHigh (int display); /** @param display cast=(CGDirectDisplayID) */ 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 27fa0b1915..55ae27ce11 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 @@ -1659,6 +1659,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CGDisplayBytesPerRow) } #endif +#ifndef NO_CGDisplayCreateImage +JNIEXPORT jintLong JNICALL OS_NATIVE(CGDisplayCreateImage) + (JNIEnv *env, jclass that, jint arg0) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, CGDisplayCreateImage_FUNC); +/* + rc = (jintLong)CGDisplayCreateImage((CGDirectDisplayID)arg0); +*/ + { + LOAD_FUNCTION(fp, CGDisplayCreateImage) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(CGDirectDisplayID))fp)((CGDirectDisplayID)arg0); + } + } + OS_NATIVE_EXIT(env, that, CGDisplayCreateImage_FUNC); + return rc; +} +#endif + #ifndef NO_CGDisplayPixelsHigh JNIEXPORT jintLong JNICALL OS_NATIVE(CGDisplayPixelsHigh) (JNIEnv *env, jclass that, jint arg0) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h index dbd5f18aca..19f5112bed 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h @@ -34,6 +34,7 @@ #define GetCurrentEventButtonState_LIB "com.apple.Carbon" #define GetDblTime_LIB "com.apple.Carbon" #define CGContextCopyPath_LIB "com.apple.Cocoa" +#define CGDisplayCreateImage_LIB "com.apple.Cocoa" #define TISCopyCurrentKeyboardInputSource_LIB "com.apple.Carbon" #define TISGetInputSourceProperty_LIB "com.apple.Carbon" #define UCKeyTranslate_LIB "com.apple.CoreServices" 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 ff1373ef79..3c0869da31 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 = 628; -int OS_nativeFunctionCallCount[628]; +int OS_nativeFunctionCount = 629; +int OS_nativeFunctionCallCount[629]; char * OS_nativeFunctionNames[] = { "ATSFontActivateFromFileReference", "AcquireRootMenu", @@ -117,6 +117,7 @@ char * OS_nativeFunctionNames[] = { "CGDisplayBitsPerSample", "CGDisplayBounds", "CGDisplayBytesPerRow", + "CGDisplayCreateImage", "CGDisplayPixelsHigh", "CGDisplayPixelsWide", "CGEventCreateKeyboardEvent", 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 88fc61e088..4d5d15f298 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 @@ -125,6 +125,7 @@ typedef enum { CGDisplayBitsPerSample_FUNC, CGDisplayBounds_FUNC, CGDisplayBytesPerRow_FUNC, + CGDisplayCreateImage_FUNC, CGDisplayPixelsHigh_FUNC, CGDisplayPixelsWide_FUNC, CGEventCreateKeyboardEvent_FUNC, 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 118aa48669..0c1aeb4bed 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 @@ -364,6 +364,12 @@ public static final int kCGBitmapByteOrder32Host = __BIG_ENDIAN__() ? kCGBitmapB */ public static final native void CGContextCopyWindowContentsToRect(int /*long*/ context, CGRect destRect, int /*long*/ contextID, int /*long*/ windowNumber, CGRect srcRect); +/** + * @method flags=dynamic + * @param displayID cast=(CGDirectDisplayID) + */ +public static final native int /*long*/ CGDisplayCreateImage(int displayID); + /** QuickDraw calls */ /** @method flags=dynamic */ |