diff options
author | Grant Gayed <ggayed> | 2008-07-15 18:59:28 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2008-07-15 18:59:28 +0000 |
commit | f5f68fabf893d045dff7842a39ab757567d0bd9c (patch) | |
tree | d69d01a67b1285494ffc18b59d3aa39e5d5a1e4c /bundles/org.eclipse.swt/Eclipse SWT PI | |
parent | 5ee76f68731beca27e439535faff552a72b10741 (diff) | |
download | eclipse.platform.swt-f5f68fabf893d045dff7842a39ab757567d0bd9c.tar.gz eclipse.platform.swt-f5f68fabf893d045dff7842a39ab757567d0bd9c.tar.xz eclipse.platform.swt-f5f68fabf893d045dff7842a39ab757567d0bd9c.zip |
preserve selection after focus loss
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c | 17 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java | 1 |
2 files changed, 18 insertions, 0 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 7a9317d96d..8fa35ddb62 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 @@ -534,3 +534,20 @@ JNIEXPORT SWT_PTR JNICALL OS_NATIVE(attributedSubstringFromRange_1CALLBACK) return (SWT_PTR)attributedSubstringFromRangeProc; } #endif + +#ifndef NO_textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK +static SWT_PTR textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK; +static NSRange textView_1willChangeSelectionFromCharacterRange_1toCharacterRange(id obj, SEL sel, NSTextView *aTextView, NSRange oldSelectedCharRange, NSRange newSelectedCharRange) +{ + NSRange* ptr = ((NSRange* (*)(id, SEL, NSTextView*, NSRange*, NSRange*))textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK)(obj, sel, aTextView, &oldSelectedCharRange, &newSelectedCharRange); + NSRange result = *ptr; + free(ptr); + return result; +} +JNIEXPORT SWT_PTR JNICALL OS_NATIVE(textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK) + (JNIEnv *env, jclass that, SWT_PTR func) +{ + textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK = func; + return (SWT_PTR)textView_1willChangeSelectionFromCharacterRange_1toCharacterRange; +} +#endif 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 7d5f4a0d36..139c96cdc7 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 @@ -372,6 +372,7 @@ 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 textView_willChangeSelectionFromCharacterRange_toCharacterRange_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); |