summaryrefslogtreecommitdiffstats
path: root/bundles
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2009-01-14 22:16:28 +0000
committerSilenio Quarti <silenio>2009-01-14 22:16:28 +0000
commiteeba1185dbb829d8b675f05bd50535207b30ecf7 (patch)
treee462a17afa2f2b08754ff43f0e4c288cb8f69f83 /bundles
parent9a6939ddfeb0c7d1770c8dc6215052e361e90cb1 (diff)
downloadeclipse.platform.swt-eeba1185dbb829d8b675f05bd50535207b30ecf7.tar.gz
eclipse.platform.swt-eeba1185dbb829d8b675f05bd50535207b30ecf7.tar.xz
eclipse.platform.swt-eeba1185dbb829d8b675f05bd50535207b30ecf7.zip
Optimize caret blinking and widget drawing
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java9
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java5
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java4
7 files changed, 21 insertions, 17 deletions
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 bb6297a696..0d5a69c12c 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
@@ -336,3 +336,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(accessibilityHitTest_1CALLBACK)
return (jintLong)accessibilityHitTest;
}
#endif
+
+#ifndef NO_isFlipped_1CALLBACK
+static BOOL isFlippedProc(id obj, SEL sel)
+{
+ return YES;
+}
+JNIEXPORT jintLong JNICALL OS_NATIVE(isFlipped_1CALLBACK)
+(JNIEnv *env, jclass that)
+{
+ return (jintLong)isFlippedProc;
+}
+#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 07758f53db..423ab6bdd3 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 = 374;
-int OS_nativeFunctionCallCount[374];
+int OS_nativeFunctionCount = 375;
+int OS_nativeFunctionCallCount[375];
char * OS_nativeFunctionNames[] = {
"CFRelease",
"CFURLCreateStringByAddingPercentEscapes",
@@ -247,6 +247,7 @@ char * OS_nativeFunctionNames[] = {
"highlightSelectionInClipRect_1CALLBACK",
"hitTest_1CALLBACK",
"instrumentObjcMessageSends",
+ "isFlipped_1CALLBACK",
"markedRange_1CALLBACK",
#ifndef JNI64
"memmove__ILorg_eclipse_swt_internal_cocoa_CGPathElement_2I",
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 06109344ac..5869190cc4 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
@@ -255,6 +255,7 @@ typedef enum {
highlightSelectionInClipRect_1CALLBACK_FUNC,
hitTest_1CALLBACK_FUNC,
instrumentObjcMessageSends_FUNC,
+ isFlipped_1CALLBACK_FUNC,
markedRange_1CALLBACK_FUNC,
#ifndef JNI64
memmove__ILorg_eclipse_swt_internal_cocoa_CGPathElement_2I_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 78fba070c3..63f95c65a6 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
@@ -130,6 +130,8 @@ public static final int kQDRegionToRectsMsgParse = 2;
/** Custom callbacks */
/** @method flags=no_gen */
+public static final native int /*long*/ isFlipped_CALLBACK();
+/** @method flags=no_gen */
public static final native int /*long*/ drawRect_CALLBACK(int /*long*/ func);
/** @method flags=no_gen */
public static final native int /*long*/ drawImage_withFrame_inView_CALLBACK(int /*long*/ func);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java
index 35014f3a8f..929cc9b2c1 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java
@@ -46,8 +46,6 @@ public final class Printer extends Device {
NSWindow window;
boolean isGCCreated;
- static Callback IsFlipped;
-
static final String DRIVER = "Mac";
/**
@@ -224,9 +222,8 @@ protected void create(DeviceData deviceData) {
window.initWithContentRect(rect, OS.NSBorderlessWindowMask, OS.NSBackingStoreBuffered, false);
String className = "SWTPrinterView"; //$NON-NLS-1$
if (OS.objc_lookUpClass(className) == 0) {
- IsFlipped = new Callback(getClass(), "isFlipped", 2); //$NON-NLS-1$
int /*long*/ cls = OS.objc_allocateClassPair(OS.class_NSView, className, 0);
- OS.class_addMethod(cls, OS.sel_isFlipped, IsFlipped.getAddress(), "@:");
+ OS.class_addMethod(cls, OS.sel_isFlipped, OS.isFlipped_CALLBACK(), "@:");
OS.objc_registerClassPair(cls);
}
view = (NSView)new SWTPrinterView().alloc();
@@ -324,10 +321,6 @@ public void internal_dispose_GC(int /*long*/ context, GCData data) {
if (data != null) isGCCreated = false;
}
-static int /*long*/ isFlipped(int /*long*/ id, int /*long*/ sel) {
- return 1;
-}
-
/**
* Releases any internal state prior to destroying this printer.
* This method is called internally by the dispose
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index aa808b4e71..23ca078890 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -1776,6 +1776,7 @@ void initClasses () {
int /*long*/ proc6 = windowDelegateCallback6.getAddress();
if (proc6 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+ int /*long*/ isFlippedProc = OS.isFlipped_CALLBACK();
int /*long*/ drawRectProc = OS.drawRect_CALLBACK(proc3);
int /*long*/ drawInteriorWithFrameInViewProc = OS.drawInteriorWithFrame_inView_CALLBACK (proc4);
int /*long*/ drawImageWithFrameInViewProc = OS.drawImage_withFrame_inView_CALLBACK (proc5);
@@ -1828,7 +1829,7 @@ void initClasses () {
cls = OS.objc_allocateClassPair(OS.class_NSView, className, 0);
OS.class_addProtocol(cls, OS.objc_getProtocol("NSTextInput"));
OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types);
- OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_isFlipped, isFlippedProc, "@:");
OS.class_addMethod(cls, OS.sel_acceptsFirstResponder, proc2, "@:");
OS.class_addMethod(cls, OS.sel_isOpaque, proc2, "@:");
OS.class_addMethod(cls, OS.sel_hitTest_, hitTestProc, "@:{NSPoint}");
@@ -3783,8 +3784,6 @@ static int /*long*/ windowDelegateProc(int /*long*/ id, int /*long*/ sel) {
return widget.becomeFirstResponder(id, sel) ? 1 : 0;
} else if (sel == OS.sel_resignFirstResponder) {
return widget.resignFirstResponder(id, sel) ? 1 : 0;
- } else if (sel == OS.sel_isFlipped) {
- return widget.isFlipped(id, sel) ? 1 : 0;
} else if (sel == OS.sel_isOpaque) {
return widget.isOpaque(id, sel) ? 1 : 0;
} else if (sel == OS.sel_unmarkText) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
index 8662f48ac0..4de7abbe54 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
@@ -769,10 +769,6 @@ boolean isDrawing (NSView control) {
return visibleRect.width != 0 && visibleRect.height != 0 && getDrawCount () == 0;
}
-boolean isFlipped (int /*long*/ id, int /*long*/ sel) {
- return true;
-}
-
/**
* Returns <code>true</code> if there are any listeners
* for the specified event type associated with the receiver,