< prev index next >
src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
Print this page
*** 40,49 ****
--- 40,50 ----
@property (retain) CDragSource *_dragSource;
-(void) deliverResize: (NSRect) rect;
-(void) resetTrackingArea;
-(void) deliverJavaKeyEventHelper: (NSEvent*) event;
+ -(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint;
@end
// Uncomment this line to see fprintfs of each InputMethod API being called on this View
//#define IM_DEBUG TRUE
//#define EXTRA_DEBUG
*** 507,516 ****
--- 508,525 ----
}
*/
}
}
+ -(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint {
+ if ((codePoint >= 0x3000) && (codePoint <= 0x303F)) {
+ // Code point is in 'CJK Symbols and Punctuation' Unicode block.
+ return YES;
+ }
+ return NO;
+ }
+
// NSAccessibility support
- (jobject)awtComponent:(JNIEnv*)env
{
static JNF_CLASS_CACHE(jc_CPlatformView, "sun/lwawt/macosx/CPlatformView");
static JNF_MEMBER_CACHE(jf_Peer, jc_CPlatformView, "peer", "Lsun/lwawt/LWWindowPeer;");
*** 887,898 ****
// called during ordinary input as well. We only need to send an input method event when we have marked
// text, or 'text in progress'. We also need to send the event if we get an insert text out of the blue!
// (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
// Unicode value.
NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
! if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2)) {
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
// We need to select the previous glyph so that it is overwritten.
if (fPAHNeedsToSelect) {
--- 896,913 ----
// called during ordinary input as well. We only need to send an input method event when we have marked
// text, or 'text in progress'. We also need to send the event if we get an insert text out of the blue!
// (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
// Unicode value.
NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
+ NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+ BOOL aStringIsComplex = NO;
+ if ((utf16Length > 2) ||
+ ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:[aString characterAtIndex:0]])) {
+ aStringIsComplex = YES;
+ }
! if ([self hasMarkedText] || !fProcessingKeystroke || aStringIsComplex) {
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
// We need to select the previous glyph so that it is overwritten.
if (fPAHNeedsToSelect) {
< prev index next >