author | dmarkov |
Mon, 04 Jul 2016 11:04:18 +0300 | |
changeset 39551 | 7eaf6bb9bc67 |
parent 37787 | de878aeb7ed2 |
child 41773 | 58254fa6487a |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
12047 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
32872 | 26 |
#import "jni_util.h" |
12047 | 27 |
#import "CGLGraphicsConfig.h" |
28 |
#import "AWTView.h" |
|
29 |
#import "AWTWindow.h" |
|
30 |
#import "JavaComponentAccessibility.h" |
|
31 |
#import "JavaTextAccessibility.h" |
|
37787 | 32 |
#import "JavaAccessibilityUtilities.h" |
12047 | 33 |
#import "GeomUtilities.h" |
34 |
#import "OSVersion.h" |
|
32872 | 35 |
#import "ThreadUtilities.h" |
36 |
||
37 |
#import <JavaNativeFoundation/JavaNativeFoundation.h> |
|
12047 | 38 |
|
39 |
@interface AWTView() |
|
40 |
@property (retain) CDropTarget *_dropTarget; |
|
41 |
@property (retain) CDragSource *_dragSource; |
|
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
21278
diff
changeset
|
42 |
|
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
21278
diff
changeset
|
43 |
-(void) deliverResize: (NSRect) rect; |
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
21278
diff
changeset
|
44 |
-(void) resetTrackingArea; |
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
21278
diff
changeset
|
45 |
-(void) deliverJavaKeyEventHelper: (NSEvent*) event; |
33858
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
46 |
-(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
47 |
-(NSMutableString *) parseString : (id) complexString; |
12047 | 48 |
@end |
49 |
||
50 |
// Uncomment this line to see fprintfs of each InputMethod API being called on this View |
|
51 |
//#define IM_DEBUG TRUE |
|
52 |
//#define EXTRA_DEBUG |
|
53 |
||
54 |
static BOOL shouldUsePressAndHold() { |
|
55 |
static int shouldUsePressAndHold = -1; |
|
56 |
if (shouldUsePressAndHold != -1) return shouldUsePressAndHold; |
|
57 |
shouldUsePressAndHold = !isSnowLeopardOrLower(); |
|
58 |
return shouldUsePressAndHold; |
|
59 |
} |
|
60 |
||
61 |
@implementation AWTView |
|
62 |
||
63 |
@synthesize _dropTarget; |
|
64 |
@synthesize _dragSource; |
|
65 |
@synthesize cglLayer; |
|
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
66 |
@synthesize mouseIsOver; |
12047 | 67 |
|
68 |
// Note: Must be called on main (AppKit) thread only |
|
69 |
- (id) initWithRect: (NSRect) rect |
|
70 |
platformView: (jobject) cPlatformView |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
71 |
windowLayer: (CALayer*) windowLayer |
12047 | 72 |
{ |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
73 |
AWT_ASSERT_APPKIT_THREAD; |
12047 | 74 |
// Initialize ourselves |
75 |
self = [super initWithFrame: rect]; |
|
76 |
if (self == nil) return self; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
77 |
|
12047 | 78 |
m_cPlatformView = cPlatformView; |
79 |
fInputMethodLOCKABLE = NULL; |
|
80 |
fKeyEventsNeeded = NO; |
|
81 |
fProcessingKeystroke = NO; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
82 |
|
12047 | 83 |
fEnablePressAndHold = shouldUsePressAndHold(); |
84 |
fInPressAndHold = NO; |
|
85 |
fPAHNeedsToSelect = NO; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
86 |
|
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
87 |
mouseIsOver = NO; |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
88 |
[self resetTrackingArea]; |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
89 |
[self setAutoresizesSubviews:NO]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
90 |
|
12047 | 91 |
if (windowLayer != nil) { |
92 |
self.cglLayer = windowLayer; |
|
14306
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
93 |
//Layer hosting view |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
94 |
[self setLayer: cglLayer]; |
12047 | 95 |
[self setWantsLayer: YES]; |
14306
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
96 |
//Layer backed view |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
97 |
//[self.layer addSublayer: (CALayer *)cglLayer]; |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
98 |
//[self setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize]; |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
99 |
//[self setLayerContentsPlacement: NSViewLayerContentsPlacementTopLeft]; |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
13990
diff
changeset
|
100 |
//[self setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
101 |
|
12047 | 102 |
#ifdef REMOTELAYER |
103 |
CGLLayer *parentLayer = (CGLLayer*)self.cglLayer; |
|
104 |
parentLayer.parentLayer = NULL; |
|
105 |
parentLayer.remoteLayer = NULL; |
|
106 |
if (JRSRemotePort != 0 && remoteSocketFD > 0) { |
|
107 |
CGLLayer *remoteLayer = [[CGLLayer alloc] initWithJavaLayer: parentLayer.javaLayer]; |
|
108 |
remoteLayer.target = GL_TEXTURE_2D; |
|
109 |
NSLog(@"Creating Parent=%p, Remote=%p", parentLayer, remoteLayer); |
|
110 |
parentLayer.remoteLayer = remoteLayer; |
|
111 |
remoteLayer.parentLayer = parentLayer; |
|
112 |
remoteLayer.remoteLayer = NULL; |
|
113 |
remoteLayer.jrsRemoteLayer = [remoteLayer createRemoteLayerBoundTo:JRSRemotePort]; |
|
23651
e41298d0da2f
8037099: [macosx] Remove all references to GC from native OBJ-C code
pchelko
parents:
23625
diff
changeset
|
114 |
[remoteLayer retain]; // REMIND |
12047 | 115 |
remoteLayer.frame = CGRectMake(0, 0, 720, 500); // REMIND |
23651
e41298d0da2f
8037099: [macosx] Remove all references to GC from native OBJ-C code
pchelko
parents:
23625
diff
changeset
|
116 |
[remoteLayer.jrsRemoteLayer retain]; // REMIND |
12047 | 117 |
int layerID = [remoteLayer.jrsRemoteLayer layerID]; |
118 |
NSLog(@"layer id to send = %d", layerID); |
|
119 |
sendLayerID(layerID); |
|
120 |
} |
|
121 |
#endif /* REMOTELAYER */ |
|
122 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
123 |
|
12047 | 124 |
return self; |
125 |
} |
|
126 |
||
127 |
- (void) dealloc { |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
128 |
AWT_ASSERT_APPKIT_THREAD; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
129 |
|
12047 | 130 |
self.cglLayer = nil; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
131 |
|
20139 | 132 |
JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; |
37787 | 133 |
(*env)->DeleteWeakGlobalRef(env, m_cPlatformView); |
12047 | 134 |
m_cPlatformView = NULL; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
135 |
|
12047 | 136 |
if (fInputMethodLOCKABLE != NULL) |
137 |
{ |
|
138 |
JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
139 |
|
12047 | 140 |
JNFDeleteGlobalRef(env, fInputMethodLOCKABLE); |
141 |
fInputMethodLOCKABLE = NULL; |
|
142 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
143 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
144 |
|
12047 | 145 |
[super dealloc]; |
146 |
} |
|
147 |
||
148 |
- (void) viewDidMoveToWindow { |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
149 |
AWT_ASSERT_APPKIT_THREAD; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
150 |
|
12047 | 151 |
[AWTToolkit eventCountPlusPlus]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
152 |
|
12047 | 153 |
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() { |
154 |
[[self window] makeFirstResponder: self]; |
|
155 |
}]; |
|
156 |
if ([self window] != NULL) { |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
157 |
[self resetTrackingArea]; |
12047 | 158 |
} |
159 |
} |
|
160 |
||
161 |
- (BOOL) acceptsFirstMouse: (NSEvent *)event { |
|
162 |
return YES; |
|
163 |
} |
|
164 |
||
165 |
- (BOOL) acceptsFirstResponder { |
|
166 |
return YES; |
|
167 |
} |
|
168 |
||
169 |
- (BOOL) becomeFirstResponder { |
|
170 |
return YES; |
|
171 |
} |
|
172 |
||
173 |
- (BOOL) preservesContentDuringLiveResize { |
|
174 |
return YES; |
|
175 |
} |
|
176 |
||
177 |
/* |
|
178 |
* Automatically triggered functions. |
|
179 |
*/ |
|
180 |
||
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
181 |
- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize { |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
182 |
[super resizeWithOldSuperviewSize: oldBoundsSize]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
183 |
[self deliverResize: [self frame]]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
184 |
} |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
185 |
|
12047 | 186 |
/* |
187 |
* MouseEvents support |
|
188 |
*/ |
|
189 |
||
190 |
- (void) mouseDown: (NSEvent *)event { |
|
191 |
NSInputManager *inputManager = [NSInputManager currentInputManager]; |
|
192 |
if ([inputManager wantsToHandleMouseEvents]) { |
|
193 |
#if IM_DEBUG |
|
194 |
NSLog(@"-> IM wants to handle event"); |
|
195 |
#endif |
|
196 |
if (![inputManager handleMouseEvent:event]) { |
|
197 |
[self deliverJavaMouseEvent: event]; |
|
198 |
} else { |
|
199 |
#if IM_DEBUG |
|
200 |
NSLog(@"-> Event was handled."); |
|
201 |
#endif |
|
202 |
} |
|
203 |
} else { |
|
13007
f6bf3300b455
7172430: [macosx] debug message in non debug jdk build
kizune
parents:
12660
diff
changeset
|
204 |
#if IM_DEBUG |
12047 | 205 |
NSLog(@"-> IM does not want to handle event"); |
13007
f6bf3300b455
7172430: [macosx] debug message in non debug jdk build
kizune
parents:
12660
diff
changeset
|
206 |
#endif |
12047 | 207 |
[self deliverJavaMouseEvent: event]; |
208 |
} |
|
209 |
} |
|
210 |
||
211 |
- (void) mouseUp: (NSEvent *)event { |
|
212 |
[self deliverJavaMouseEvent: event]; |
|
213 |
} |
|
214 |
||
215 |
- (void) rightMouseDown: (NSEvent *)event { |
|
216 |
[self deliverJavaMouseEvent: event]; |
|
217 |
} |
|
218 |
||
219 |
- (void) rightMouseUp: (NSEvent *)event { |
|
220 |
[self deliverJavaMouseEvent: event]; |
|
221 |
} |
|
222 |
||
223 |
- (void) otherMouseDown: (NSEvent *)event { |
|
224 |
[self deliverJavaMouseEvent: event]; |
|
225 |
} |
|
226 |
||
227 |
- (void) otherMouseUp: (NSEvent *)event { |
|
228 |
[self deliverJavaMouseEvent: event]; |
|
229 |
} |
|
230 |
||
231 |
- (void) mouseMoved: (NSEvent *)event { |
|
232 |
// TODO: better way to redirect move events to the "under" view |
|
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15322
diff
changeset
|
233 |
|
12047 | 234 |
NSPoint eventLocation = [event locationInWindow]; |
235 |
NSPoint localPoint = [self convertPoint: eventLocation fromView: nil]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
236 |
|
12047 | 237 |
if ([self mouse: localPoint inRect: [self bounds]]) { |
238 |
[self deliverJavaMouseEvent: event]; |
|
239 |
} else { |
|
240 |
[[self nextResponder] mouseDown:event]; |
|
241 |
} |
|
242 |
} |
|
243 |
||
244 |
- (void) mouseDragged: (NSEvent *)event { |
|
245 |
[self deliverJavaMouseEvent: event]; |
|
246 |
} |
|
247 |
||
248 |
- (void) rightMouseDragged: (NSEvent *)event { |
|
249 |
[self deliverJavaMouseEvent: event]; |
|
250 |
} |
|
251 |
||
252 |
- (void) otherMouseDragged: (NSEvent *)event { |
|
253 |
[self deliverJavaMouseEvent: event]; |
|
254 |
} |
|
255 |
||
256 |
- (void) mouseEntered: (NSEvent *)event { |
|
257 |
[[self window] setAcceptsMouseMovedEvents:YES]; |
|
258 |
//[[self window] makeFirstResponder:self]; |
|
259 |
[self deliverJavaMouseEvent: event]; |
|
260 |
} |
|
261 |
||
262 |
- (void) mouseExited: (NSEvent *)event { |
|
263 |
[[self window] setAcceptsMouseMovedEvents:NO]; |
|
264 |
[self deliverJavaMouseEvent: event]; |
|
265 |
//Restore the cursor back. |
|
266 |
//[CCursorManager _setCursor: [NSCursor arrowCursor]]; |
|
267 |
} |
|
268 |
||
269 |
- (void) scrollWheel: (NSEvent*) event { |
|
270 |
[self deliverJavaMouseEvent: event]; |
|
271 |
} |
|
272 |
||
273 |
/* |
|
274 |
* KeyEvents support |
|
275 |
*/ |
|
276 |
||
277 |
- (void) keyDown: (NSEvent *)event { |
|
278 |
fProcessingKeystroke = YES; |
|
279 |
fKeyEventsNeeded = YES; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
280 |
|
12047 | 281 |
// Allow TSM to look at the event and potentially send back NSTextInputClient messages. |
282 |
[self interpretKeyEvents:[NSArray arrayWithObject:event]]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
283 |
|
12047 | 284 |
if (fEnablePressAndHold && [event willBeHandledByComplexInputMethod]) { |
285 |
fProcessingKeystroke = NO; |
|
286 |
if (!fInPressAndHold) { |
|
287 |
fInPressAndHold = YES; |
|
288 |
fPAHNeedsToSelect = YES; |
|
289 |
} |
|
290 |
return; |
|
291 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
292 |
|
13990
3e72145fd93a
7199180: [macosx] Dead keys handling for input methods
alexsch
parents:
13647
diff
changeset
|
293 |
NSString *eventCharacters = [event characters]; |
3e72145fd93a
7199180: [macosx] Dead keys handling for input methods
alexsch
parents:
13647
diff
changeset
|
294 |
BOOL isDeadKey = (eventCharacters != nil && [eventCharacters length] == 0); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
295 |
|
13990
3e72145fd93a
7199180: [macosx] Dead keys handling for input methods
alexsch
parents:
13647
diff
changeset
|
296 |
if ((![self hasMarkedText] && fKeyEventsNeeded) || isDeadKey) { |
12047 | 297 |
[self deliverJavaKeyEventHelper: event]; |
298 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
299 |
|
12047 | 300 |
fProcessingKeystroke = NO; |
301 |
} |
|
302 |
||
303 |
- (void) keyUp: (NSEvent *)event { |
|
304 |
[self deliverJavaKeyEventHelper: event]; |
|
305 |
} |
|
306 |
||
307 |
- (void) flagsChanged: (NSEvent *)event { |
|
308 |
[self deliverJavaKeyEventHelper: event]; |
|
309 |
} |
|
310 |
||
311 |
- (BOOL) performKeyEquivalent: (NSEvent *) event { |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
312 |
// if IM is active key events should be ignored |
29727
34e49b091c62
8073008: press-and-hold input method for accented characters works incorrectly on OS X
anashaty
parents:
28990
diff
changeset
|
313 |
if (![self hasMarkedText] && !fInPressAndHold) { |
34e49b091c62
8073008: press-and-hold input method for accented characters works incorrectly on OS X
anashaty
parents:
28990
diff
changeset
|
314 |
[self deliverJavaKeyEventHelper: event]; |
34e49b091c62
8073008: press-and-hold input method for accented characters works incorrectly on OS X
anashaty
parents:
28990
diff
changeset
|
315 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
316 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
317 |
// Workaround for 8020209: special case for "Cmd =" and "Cmd ." |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
318 |
// because Cocoa calls performKeyEquivalent twice for these keystrokes |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
319 |
NSUInteger modFlags = [event modifierFlags] & |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
320 |
(NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask); |
21268
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
321 |
if (modFlags == NSCommandKeyMask) { |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
322 |
NSString *eventChars = [event charactersIgnoringModifiers]; |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
323 |
if ([eventChars length] == 1) { |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
324 |
unichar ch = [eventChars characterAtIndex:0]; |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
325 |
if (ch == '=' || ch == '.') { |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
326 |
[[NSApp mainMenu] performKeyEquivalent: event]; |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
327 |
return YES; |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
328 |
} |
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
329 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
330 |
|
21268
b3298f607368
8020209: [macosx] Mac OS X key event confusion for "COMMAND PLUS"
leonidr
parents:
20139
diff
changeset
|
331 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
332 |
|
12047 | 333 |
return NO; |
334 |
} |
|
335 |
||
336 |
/** |
|
337 |
* Utility methods and accessors |
|
338 |
*/ |
|
339 |
||
340 |
-(void) deliverJavaMouseEvent: (NSEvent *) event { |
|
12640 | 341 |
BOOL isEnabled = YES; |
342 |
NSWindow* window = [self window]; |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
343 |
if ([window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]]) { |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
344 |
isEnabled = [(AWTWindow*)[window delegate] isEnabled]; |
12640 | 345 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
346 |
|
12640 | 347 |
if (!isEnabled) { |
348 |
return; |
|
349 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
350 |
|
12640 | 351 |
NSEventType type = [event type]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
352 |
|
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
353 |
// check synthesized mouse entered/exited events |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
354 |
if ((type == NSMouseEntered && mouseIsOver) || (type == NSMouseExited && !mouseIsOver)) { |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
355 |
return; |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
356 |
}else if ((type == NSMouseEntered && !mouseIsOver) || (type == NSMouseExited && mouseIsOver)) { |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
357 |
mouseIsOver = !mouseIsOver; |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12178
diff
changeset
|
358 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
359 |
|
12047 | 360 |
[AWTToolkit eventCountPlusPlus]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
361 |
|
12047 | 362 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
363 |
|
12047 | 364 |
NSPoint eventLocation = [event locationInWindow]; |
365 |
NSPoint localPoint = [self convertPoint: eventLocation fromView: nil]; |
|
366 |
NSPoint absP = [NSEvent mouseLocation]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
367 |
|
12047 | 368 |
// Convert global numbers between Cocoa's coordinate system and Java. |
369 |
// TODO: need consitent way for doing that both with global as well as with local coordinates. |
|
370 |
// The reason to do it here is one more native method for getting screen dimension otherwise. |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
371 |
|
23316
e14d8640b158
8017472: [macosx] Transparency demo is not correctly dragged on the second monitor
azvegint
parents:
23268
diff
changeset
|
372 |
NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame]; |
12047 | 373 |
absP.y = screenRect.size.height - absP.y; |
374 |
jint clickCount; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
375 |
|
12047 | 376 |
if (type == NSMouseEntered || |
377 |
type == NSMouseExited || |
|
378 |
type == NSScrollWheel || |
|
379 |
type == NSMouseMoved) { |
|
380 |
clickCount = 0; |
|
381 |
} else { |
|
382 |
clickCount = [event clickCount]; |
|
383 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
384 |
|
23268 | 385 |
static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent"); |
12047 | 386 |
static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IIIIIIIIDD)V"); |
387 |
jobject jEvent = JNFNewObject(env, jctor_NSEvent, |
|
388 |
[event type], |
|
389 |
[event modifierFlags], |
|
390 |
clickCount, |
|
391 |
[event buttonNumber], |
|
392 |
(jint)localPoint.x, (jint)localPoint.y, |
|
393 |
(jint)absP.x, (jint)absP.y, |
|
394 |
[event deltaY], |
|
395 |
[event deltaX]); |
|
24555
42926c558bc8
8042752: [macosx] NSEvent instances leak throw JNI local references
pchelko
parents:
23651
diff
changeset
|
396 |
CHECK_NULL(jEvent); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
397 |
|
12047 | 398 |
static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); |
23268 | 399 |
static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); |
37787 | 400 |
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); |
401 |
if (!(*env)->IsSameObject(env, jlocal, NULL)) { |
|
402 |
JNFCallVoidMethod(env, jlocal, jm_deliverMouseEvent, jEvent); |
|
403 |
(*env)->DeleteLocalRef(env, jlocal); |
|
404 |
} |
|
24555
42926c558bc8
8042752: [macosx] NSEvent instances leak throw JNI local references
pchelko
parents:
23651
diff
changeset
|
405 |
(*env)->DeleteLocalRef(env, jEvent); |
12047 | 406 |
} |
407 |
||
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
408 |
- (void) resetTrackingArea { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
409 |
if (rolloverTrackingArea != nil) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
410 |
[self removeTrackingArea:rolloverTrackingArea]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
411 |
[rolloverTrackingArea release]; |
12047 | 412 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
413 |
|
20134
8711b271f96c
8012026: [macosx] Component.getMousePosition() does not work in an applet on MacOS
pchelko
parents:
15985
diff
changeset
|
414 |
int options = (NSTrackingActiveAlways | NSTrackingMouseEnteredAndExited | |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
415 |
NSTrackingMouseMoved | NSTrackingEnabledDuringMouseDrag); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
416 |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
417 |
rolloverTrackingArea = [[NSTrackingArea alloc] initWithRect:[self visibleRect] |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
418 |
options: options |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
419 |
owner:self |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
420 |
userInfo:nil |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
421 |
]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
422 |
[self addTrackingArea:rolloverTrackingArea]; |
12047 | 423 |
} |
424 |
||
425 |
- (void)updateTrackingAreas { |
|
426 |
[super updateTrackingAreas]; |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
427 |
[self resetTrackingArea]; |
12047 | 428 |
} |
429 |
||
430 |
- (void) resetCursorRects { |
|
431 |
[super resetCursorRects]; |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13007
diff
changeset
|
432 |
[self resetTrackingArea]; |
12047 | 433 |
} |
434 |
||
435 |
-(void) deliverJavaKeyEventHelper: (NSEvent *) event { |
|
12660 | 436 |
static NSEvent* sLastKeyEvent = nil; |
437 |
if (event == sLastKeyEvent) { |
|
12659
fa378682b3cb
7142565: [macosx] Many special keys processed twice in text fields
ant
parents:
12648
diff
changeset
|
438 |
// The event is repeatedly delivered by keyDown: after performKeyEquivalent: |
fa378682b3cb
7142565: [macosx] Many special keys processed twice in text fields
ant
parents:
12648
diff
changeset
|
439 |
return; |
fa378682b3cb
7142565: [macosx] Many special keys processed twice in text fields
ant
parents:
12648
diff
changeset
|
440 |
} |
12660 | 441 |
[sLastKeyEvent release]; |
442 |
sLastKeyEvent = [event retain]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
443 |
|
12047 | 444 |
[AWTToolkit eventCountPlusPlus]; |
445 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
446 |
|
12047 | 447 |
jstring characters = NULL; |
25114
cafd0de74734
8028617: Dvorak keyboard mapping not honored when ctrl key pressed
anashaty
parents:
24555
diff
changeset
|
448 |
jstring charactersIgnoringModifiers = NULL; |
12047 | 449 |
if ([event type] != NSFlagsChanged) { |
450 |
characters = JNFNSToJavaString(env, [event characters]); |
|
25114
cafd0de74734
8028617: Dvorak keyboard mapping not honored when ctrl key pressed
anashaty
parents:
24555
diff
changeset
|
451 |
charactersIgnoringModifiers = JNFNSToJavaString(env, [event charactersIgnoringModifiers]); |
12047 | 452 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
453 |
|
23268 | 454 |
static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent"); |
25114
cafd0de74734
8028617: Dvorak keyboard mapping not honored when ctrl key pressed
anashaty
parents:
24555
diff
changeset
|
455 |
static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;Ljava/lang/String;)V"); |
24555
42926c558bc8
8042752: [macosx] NSEvent instances leak throw JNI local references
pchelko
parents:
23651
diff
changeset
|
456 |
jobject jEvent = JNFNewObject(env, jctor_NSEvent, |
12047 | 457 |
[event type], |
458 |
[event modifierFlags], |
|
459 |
[event keyCode], |
|
25114
cafd0de74734
8028617: Dvorak keyboard mapping not honored when ctrl key pressed
anashaty
parents:
24555
diff
changeset
|
460 |
characters, |
cafd0de74734
8028617: Dvorak keyboard mapping not honored when ctrl key pressed
anashaty
parents:
24555
diff
changeset
|
461 |
charactersIgnoringModifiers); |
24555
42926c558bc8
8042752: [macosx] NSEvent instances leak throw JNI local references
pchelko
parents:
23651
diff
changeset
|
462 |
CHECK_NULL(jEvent); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
463 |
|
12047 | 464 |
static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); |
465 |
static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView, |
|
23268 | 466 |
"deliverKeyEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); |
37787 | 467 |
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); |
468 |
if (!(*env)->IsSameObject(env, jlocal, NULL)) { |
|
469 |
JNFCallVoidMethod(env, jlocal, jm_deliverKeyEvent, jEvent); |
|
470 |
(*env)->DeleteLocalRef(env, jlocal); |
|
471 |
} |
|
12047 | 472 |
if (characters != NULL) { |
473 |
(*env)->DeleteLocalRef(env, characters); |
|
474 |
} |
|
24555
42926c558bc8
8042752: [macosx] NSEvent instances leak throw JNI local references
pchelko
parents:
23651
diff
changeset
|
475 |
(*env)->DeleteLocalRef(env, jEvent); |
12047 | 476 |
} |
477 |
||
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
478 |
-(void) deliverResize: (NSRect) rect { |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
479 |
jint x = (jint) rect.origin.x; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
480 |
jint y = (jint) rect.origin.y; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
481 |
jint w = (jint) rect.size.width; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
482 |
jint h = (jint) rect.size.height; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
483 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
484 |
static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
485 |
static JNF_MEMBER_CACHE(jm_deliverResize, jc_PlatformView, "deliverResize", "(IIII)V"); |
37787 | 486 |
|
487 |
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); |
|
488 |
if (!(*env)->IsSameObject(env, jlocal, NULL)) { |
|
489 |
JNFCallVoidMethod(env, jlocal, jm_deliverResize, x,y,w,h); |
|
490 |
(*env)->DeleteLocalRef(env, jlocal); |
|
491 |
} |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
492 |
} |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
493 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
494 |
|
12047 | 495 |
- (void) drawRect:(NSRect)dirtyRect { |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
496 |
AWT_ASSERT_APPKIT_THREAD; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
497 |
|
12047 | 498 |
[super drawRect:dirtyRect]; |
499 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
500 |
if (env != NULL) { |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
501 |
/* |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
502 |
if ([self inLiveResize]) { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
503 |
NSRect rs[4]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
504 |
NSInteger count; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
505 |
[self getRectsExposedDuringLiveResize:rs count:&count]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
506 |
for (int i = 0; i < count; i++) { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
507 |
JNU_CallMethodByName(env, NULL, [m_awtWindow cPlatformView], |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
508 |
"deliverWindowDidExposeEvent", "(FFFF)V", |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
509 |
(jfloat)rs[i].origin.x, (jfloat)rs[i].origin.y, |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
510 |
(jfloat)rs[i].size.width, (jfloat)rs[i].size.height); |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
511 |
if ((*env)->ExceptionOccurred(env)) { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
512 |
(*env)->ExceptionDescribe(env); |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
513 |
(*env)->ExceptionClear(env); |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
514 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
515 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
516 |
} else { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
517 |
*/ |
12047 | 518 |
static JNF_CLASS_CACHE(jc_CPlatformView, "sun/lwawt/macosx/CPlatformView"); |
519 |
static JNF_MEMBER_CACHE(jm_deliverWindowDidExposeEvent, jc_CPlatformView, "deliverWindowDidExposeEvent", "()V"); |
|
37787 | 520 |
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); |
521 |
if (!(*env)->IsSameObject(env, jlocal, NULL)) { |
|
522 |
JNFCallVoidMethod(env, jlocal, jm_deliverWindowDidExposeEvent); |
|
523 |
(*env)->DeleteLocalRef(env, jlocal); |
|
524 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
525 |
/* |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
526 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
527 |
*/ |
12047 | 528 |
} |
529 |
} |
|
530 |
||
33858
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
531 |
-(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint { |
39551
7eaf6bb9bc67
8148984: [macosx] Chinese Comma cannot be entered using Pinyin Input Method on OS X
dmarkov
parents:
37787
diff
changeset
|
532 |
if (((codePoint >= 0x3000) && (codePoint <= 0x303F)) || |
7eaf6bb9bc67
8148984: [macosx] Chinese Comma cannot be entered using Pinyin Input Method on OS X
dmarkov
parents:
37787
diff
changeset
|
533 |
((codePoint >= 0xFF00) && (codePoint <= 0xFFEF))) { |
7eaf6bb9bc67
8148984: [macosx] Chinese Comma cannot be entered using Pinyin Input Method on OS X
dmarkov
parents:
37787
diff
changeset
|
534 |
// Code point is in 'CJK Symbols and Punctuation' or |
7eaf6bb9bc67
8148984: [macosx] Chinese Comma cannot be entered using Pinyin Input Method on OS X
dmarkov
parents:
37787
diff
changeset
|
535 |
// 'Halfwidth and Fullwidth Forms' Unicode block. |
33858
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
536 |
return YES; |
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
537 |
} |
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
538 |
return NO; |
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
539 |
} |
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
540 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
541 |
-(NSMutableString *) parseString : (id) complexString { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
542 |
if ([complexString isKindOfClass:[NSString class]]) { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
543 |
return [complexString mutableCopy]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
544 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
545 |
else { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
546 |
return [complexString mutableString]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
547 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
548 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
549 |
|
12047 | 550 |
// NSAccessibility support |
551 |
- (jobject)awtComponent:(JNIEnv*)env |
|
552 |
{ |
|
553 |
static JNF_CLASS_CACHE(jc_CPlatformView, "sun/lwawt/macosx/CPlatformView"); |
|
554 |
static JNF_MEMBER_CACHE(jf_Peer, jc_CPlatformView, "peer", "Lsun/lwawt/LWWindowPeer;"); |
|
555 |
if ((env == NULL) || (m_cPlatformView == NULL)) { |
|
556 |
NSLog(@"Apple AWT : Error AWTView:awtComponent given bad parameters."); |
|
557 |
if (env != NULL) |
|
558 |
{ |
|
559 |
JNFDumpJavaStack(env); |
|
560 |
} |
|
561 |
return NULL; |
|
562 |
} |
|
37787 | 563 |
|
564 |
jobject peer = NULL; |
|
565 |
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); |
|
566 |
if (!(*env)->IsSameObject(env, jlocal, NULL)) { |
|
567 |
peer = JNFGetObjectField(env, jlocal, jf_Peer); |
|
568 |
(*env)->DeleteLocalRef(env, jlocal); |
|
569 |
} |
|
12047 | 570 |
static JNF_CLASS_CACHE(jc_LWWindowPeer, "sun/lwawt/LWWindowPeer"); |
571 |
static JNF_MEMBER_CACHE(jf_Target, jc_LWWindowPeer, "target", "Ljava/awt/Component;"); |
|
572 |
if (peer == NULL) { |
|
573 |
NSLog(@"Apple AWT : Error AWTView:awtComponent got null peer from CPlatformView"); |
|
574 |
JNFDumpJavaStack(env); |
|
575 |
return NULL; |
|
576 |
} |
|
37787 | 577 |
jobject comp = JNFGetObjectField(env, peer, jf_Target); |
578 |
(*env)->DeleteLocalRef(env, peer); |
|
579 |
return comp; |
|
580 |
} |
|
581 |
||
582 |
+ (AWTView *) awtView:(JNIEnv*)env ofAccessible:(jobject)jaccessible |
|
583 |
{ |
|
584 |
static JNF_STATIC_MEMBER_CACHE(jm_getAWTView, sjc_CAccessibility, "getAWTView", "(Ljavax/accessibility/Accessible;)J"); |
|
585 |
||
586 |
jlong jptr = JNFCallStaticLongMethod(env, jm_getAWTView, jaccessible); |
|
587 |
if (jptr == 0) return nil; |
|
588 |
||
589 |
return (AWTView *)jlong_to_ptr(jptr); |
|
12047 | 590 |
} |
591 |
||
592 |
- (id)getAxData:(JNIEnv*)env |
|
593 |
{ |
|
37787 | 594 |
jobject jcomponent = [self awtComponent:env]; |
595 |
id ax = [[[JavaComponentAccessibility alloc] initWithParent:self withEnv:env withAccessible:jcomponent withIndex:-1 withView:self withJavaRole:nil] autorelease]; |
|
596 |
(*env)->DeleteLocalRef(env, jcomponent); |
|
597 |
return ax; |
|
12047 | 598 |
} |
599 |
||
600 |
- (NSArray *)accessibilityAttributeNames |
|
601 |
{ |
|
602 |
return [[super accessibilityAttributeNames] arrayByAddingObject:NSAccessibilityChildrenAttribute]; |
|
603 |
} |
|
604 |
||
605 |
// NSAccessibility messages |
|
606 |
// attribute methods |
|
607 |
- (id)accessibilityAttributeValue:(NSString *)attribute |
|
608 |
{ |
|
609 |
AWT_ASSERT_APPKIT_THREAD; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
610 |
|
12047 | 611 |
if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) |
612 |
{ |
|
613 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
614 |
|
12047 | 615 |
(*env)->PushLocalFrame(env, 4); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
616 |
|
12047 | 617 |
id result = NSAccessibilityUnignoredChildrenForOnlyChild([self getAxData:env]); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
618 |
|
12047 | 619 |
(*env)->PopLocalFrame(env, NULL); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
620 |
|
12047 | 621 |
return result; |
622 |
} |
|
623 |
else |
|
624 |
{ |
|
625 |
return [super accessibilityAttributeValue:attribute]; |
|
626 |
} |
|
627 |
} |
|
628 |
- (BOOL)accessibilityIsIgnored |
|
629 |
{ |
|
630 |
return YES; |
|
631 |
} |
|
632 |
||
633 |
- (id)accessibilityHitTest:(NSPoint)point |
|
634 |
{ |
|
635 |
AWT_ASSERT_APPKIT_THREAD; |
|
636 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
637 |
|
12047 | 638 |
(*env)->PushLocalFrame(env, 4); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
639 |
|
12047 | 640 |
id result = [[self getAxData:env] accessibilityHitTest:point withEnv:env]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
641 |
|
12047 | 642 |
(*env)->PopLocalFrame(env, NULL); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
643 |
|
12047 | 644 |
return result; |
645 |
} |
|
646 |
||
647 |
- (id)accessibilityFocusedUIElement |
|
648 |
{ |
|
649 |
AWT_ASSERT_APPKIT_THREAD; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
650 |
|
12047 | 651 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
652 |
|
12047 | 653 |
(*env)->PushLocalFrame(env, 4); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
654 |
|
12047 | 655 |
id result = [[self getAxData:env] accessibilityFocusedUIElement]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
656 |
|
12047 | 657 |
(*env)->PopLocalFrame(env, NULL); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
658 |
|
12047 | 659 |
return result; |
660 |
} |
|
661 |
||
662 |
// --- Services menu support for lightweights --- |
|
663 |
||
21278 | 664 |
// finds the focused accessible element, and if it is a text element, obtains the text from it |
12047 | 665 |
- (NSString *)accessibleSelectedText |
666 |
{ |
|
667 |
id focused = [self accessibilityFocusedUIElement]; |
|
668 |
if (![focused isKindOfClass:[JavaTextAccessibility class]]) return nil; |
|
669 |
return [(JavaTextAccessibility *)focused accessibilitySelectedTextAttribute]; |
|
670 |
} |
|
671 |
||
672 |
// same as above, but converts to RTFD |
|
673 |
- (NSData *)accessibleSelectedTextAsRTFD |
|
674 |
{ |
|
675 |
NSString *selectedText = [self accessibleSelectedText]; |
|
676 |
NSAttributedString *styledText = [[NSAttributedString alloc] initWithString:selectedText]; |
|
36462
dee5ee6606e2
8141553: [macosx] JDK fails to build with Xcode 7 on 10.11
serb
parents:
33858
diff
changeset
|
677 |
NSData *rtfdData = [styledText RTFDFromRange:NSMakeRange(0, [styledText length]) |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
678 |
documentAttributes: |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
679 |
@{NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType}]; |
12047 | 680 |
[styledText release]; |
681 |
return rtfdData; |
|
682 |
} |
|
683 |
||
21278 | 684 |
// finds the focused accessible element, and if it is a text element, sets the text in it |
12047 | 685 |
- (BOOL)replaceAccessibleTextSelection:(NSString *)text |
686 |
{ |
|
687 |
id focused = [self accessibilityFocusedUIElement]; |
|
688 |
if (![focused isKindOfClass:[JavaTextAccessibility class]]) return NO; |
|
689 |
[(JavaTextAccessibility *)focused accessibilitySetSelectedTextAttribute:text]; |
|
690 |
return YES; |
|
691 |
} |
|
692 |
||
693 |
// called for each service in the Services menu - only handle text for now |
|
694 |
- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType |
|
695 |
{ |
|
696 |
if ([[self window] firstResponder] != self) return nil; // let AWT components handle themselves |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
697 |
|
12047 | 698 |
if ([sendType isEqual:NSStringPboardType] || [returnType isEqual:NSStringPboardType]) { |
699 |
NSString *selectedText = [self accessibleSelectedText]; |
|
700 |
if (selectedText) return self; |
|
701 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
702 |
|
12047 | 703 |
return nil; |
704 |
} |
|
705 |
||
706 |
// fetch text from Java and hand off to the service |
|
707 |
- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray *)types |
|
708 |
{ |
|
709 |
if ([types containsObject:NSStringPboardType]) |
|
710 |
{ |
|
711 |
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; |
|
712 |
return [pboard setString:[self accessibleSelectedText] forType:NSStringPboardType]; |
|
713 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
714 |
|
12047 | 715 |
if ([types containsObject:NSRTFDPboardType]) |
716 |
{ |
|
717 |
[pboard declareTypes:[NSArray arrayWithObject:NSRTFDPboardType] owner:nil]; |
|
718 |
return [pboard setData:[self accessibleSelectedTextAsRTFD] forType:NSRTFDPboardType]; |
|
719 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
720 |
|
12047 | 721 |
return NO; |
722 |
} |
|
723 |
||
724 |
// write text back to Java from the service |
|
725 |
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard |
|
726 |
{ |
|
727 |
if ([[pboard types] containsObject:NSStringPboardType]) |
|
728 |
{ |
|
729 |
NSString *text = [pboard stringForType:NSStringPboardType]; |
|
730 |
return [self replaceAccessibleTextSelection:text]; |
|
731 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
732 |
|
12047 | 733 |
if ([[pboard types] containsObject:NSRTFDPboardType]) |
734 |
{ |
|
735 |
NSData *rtfdData = [pboard dataForType:NSRTFDPboardType]; |
|
36462
dee5ee6606e2
8141553: [macosx] JDK fails to build with Xcode 7 on 10.11
serb
parents:
33858
diff
changeset
|
736 |
NSAttributedString *styledText = [[NSAttributedString alloc] initWithRTFD:rtfdData documentAttributes:NULL]; |
12047 | 737 |
NSString *text = [styledText string]; |
738 |
[styledText release]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
739 |
|
12047 | 740 |
return [self replaceAccessibleTextSelection:text]; |
741 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
742 |
|
12047 | 743 |
return NO; |
744 |
} |
|
745 |
||
746 |
||
747 |
-(void) setDragSource:(CDragSource *)source { |
|
748 |
self._dragSource = source; |
|
749 |
} |
|
750 |
||
751 |
||
752 |
- (void) setDropTarget:(CDropTarget *)target { |
|
753 |
self._dropTarget = target; |
|
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15322
diff
changeset
|
754 |
[ThreadUtilities performOnMainThread:@selector(controlModelControlValid) on:self._dropTarget withObject:nil waitUntilDone:YES]; |
12047 | 755 |
} |
756 |
||
757 |
/******************************** BEGIN NSDraggingSource Interface ********************************/ |
|
758 |
||
759 |
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag |
|
760 |
{ |
|
761 |
// If draggingSource is nil route the message to the superclass (if responding to the selector): |
|
762 |
CDragSource *dragSource = self._dragSource; |
|
763 |
NSDragOperation dragOp = NSDragOperationNone; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
764 |
|
12047 | 765 |
if (dragSource != nil) |
766 |
dragOp = [dragSource draggingSourceOperationMaskForLocal:flag]; |
|
767 |
else if ([super respondsToSelector:@selector(draggingSourceOperationMaskForLocal:)]) |
|
768 |
dragOp = [super draggingSourceOperationMaskForLocal:flag]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
769 |
|
12047 | 770 |
return dragOp; |
771 |
} |
|
772 |
||
773 |
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination |
|
774 |
{ |
|
775 |
// If draggingSource is nil route the message to the superclass (if responding to the selector): |
|
776 |
CDragSource *dragSource = self._dragSource; |
|
777 |
NSArray* array = nil; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
778 |
|
12047 | 779 |
if (dragSource != nil) |
780 |
array = [dragSource namesOfPromisedFilesDroppedAtDestination:dropDestination]; |
|
781 |
else if ([super respondsToSelector:@selector(namesOfPromisedFilesDroppedAtDestination:)]) |
|
782 |
array = [super namesOfPromisedFilesDroppedAtDestination:dropDestination]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
783 |
|
12047 | 784 |
return array; |
785 |
} |
|
786 |
||
787 |
- (void)draggedImage:(NSImage *)image beganAt:(NSPoint)screenPoint |
|
788 |
{ |
|
789 |
// If draggingSource is nil route the message to the superclass (if responding to the selector): |
|
790 |
CDragSource *dragSource = self._dragSource; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
791 |
|
12047 | 792 |
if (dragSource != nil) |
793 |
[dragSource draggedImage:image beganAt:screenPoint]; |
|
794 |
else if ([super respondsToSelector:@selector(draggedImage::)]) |
|
795 |
[super draggedImage:image beganAt:screenPoint]; |
|
796 |
} |
|
797 |
||
798 |
- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation |
|
799 |
{ |
|
800 |
// If draggingSource is nil route the message to the superclass (if responding to the selector): |
|
801 |
CDragSource *dragSource = self._dragSource; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
802 |
|
12047 | 803 |
if (dragSource != nil) |
804 |
[dragSource draggedImage:image endedAt:screenPoint operation:operation]; |
|
805 |
else if ([super respondsToSelector:@selector(draggedImage:::)]) |
|
806 |
[super draggedImage:image endedAt:screenPoint operation:operation]; |
|
807 |
} |
|
808 |
||
809 |
- (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenPoint |
|
810 |
{ |
|
811 |
// If draggingSource is nil route the message to the superclass (if responding to the selector): |
|
812 |
CDragSource *dragSource = self._dragSource; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
813 |
|
12047 | 814 |
if (dragSource != nil) |
815 |
[dragSource draggedImage:image movedTo:screenPoint]; |
|
816 |
else if ([super respondsToSelector:@selector(draggedImage::)]) |
|
817 |
[super draggedImage:image movedTo:screenPoint]; |
|
818 |
} |
|
819 |
||
820 |
- (BOOL)ignoreModifierKeysWhileDragging |
|
821 |
{ |
|
822 |
// If draggingSource is nil route the message to the superclass (if responding to the selector): |
|
823 |
CDragSource *dragSource = self._dragSource; |
|
824 |
BOOL result = FALSE; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
825 |
|
12047 | 826 |
if (dragSource != nil) |
827 |
result = [dragSource ignoreModifierKeysWhileDragging]; |
|
828 |
else if ([super respondsToSelector:@selector(ignoreModifierKeysWhileDragging)]) |
|
829 |
result = [super ignoreModifierKeysWhileDragging]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
830 |
|
12047 | 831 |
return result; |
832 |
} |
|
833 |
||
834 |
/******************************** END NSDraggingSource Interface ********************************/ |
|
835 |
||
836 |
/******************************** BEGIN NSDraggingDestination Interface ********************************/ |
|
837 |
||
838 |
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender |
|
839 |
{ |
|
840 |
// If draggingDestination is nil route the message to the superclass: |
|
841 |
CDropTarget *dropTarget = self._dropTarget; |
|
842 |
NSDragOperation dragOp = NSDragOperationNone; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
843 |
|
12047 | 844 |
if (dropTarget != nil) |
845 |
dragOp = [dropTarget draggingEntered:sender]; |
|
846 |
else if ([super respondsToSelector:@selector(draggingEntered:)]) |
|
847 |
dragOp = [super draggingEntered:sender]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
848 |
|
12047 | 849 |
return dragOp; |
850 |
} |
|
851 |
||
852 |
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender |
|
853 |
{ |
|
854 |
// If draggingDestination is nil route the message to the superclass: |
|
855 |
CDropTarget *dropTarget = self._dropTarget; |
|
856 |
NSDragOperation dragOp = NSDragOperationNone; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
857 |
|
12047 | 858 |
if (dropTarget != nil) |
859 |
dragOp = [dropTarget draggingUpdated:sender]; |
|
860 |
else if ([super respondsToSelector:@selector(draggingUpdated:)]) |
|
861 |
dragOp = [super draggingUpdated:sender]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
862 |
|
12047 | 863 |
return dragOp; |
864 |
} |
|
865 |
||
866 |
- (void)draggingExited:(id <NSDraggingInfo>)sender |
|
867 |
{ |
|
868 |
// If draggingDestination is nil route the message to the superclass: |
|
869 |
CDropTarget *dropTarget = self._dropTarget; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
870 |
|
12047 | 871 |
if (dropTarget != nil) |
872 |
[dropTarget draggingExited:sender]; |
|
873 |
else if ([super respondsToSelector:@selector(draggingExited:)]) |
|
874 |
[super draggingExited:sender]; |
|
875 |
} |
|
876 |
||
877 |
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender |
|
878 |
{ |
|
879 |
// If draggingDestination is nil route the message to the superclass: |
|
880 |
CDropTarget *dropTarget = self._dropTarget; |
|
881 |
BOOL result = FALSE; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
882 |
|
12047 | 883 |
if (dropTarget != nil) |
884 |
result = [dropTarget prepareForDragOperation:sender]; |
|
885 |
else if ([super respondsToSelector:@selector(prepareForDragOperation:)]) |
|
886 |
result = [super prepareForDragOperation:sender]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
887 |
|
12047 | 888 |
return result; |
889 |
} |
|
890 |
||
891 |
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender |
|
892 |
{ |
|
893 |
// If draggingDestination is nil route the message to the superclass: |
|
894 |
CDropTarget *dropTarget = self._dropTarget; |
|
895 |
BOOL result = FALSE; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
896 |
|
12047 | 897 |
if (dropTarget != nil) |
898 |
result = [dropTarget performDragOperation:sender]; |
|
899 |
else if ([super respondsToSelector:@selector(performDragOperation:)]) |
|
900 |
result = [super performDragOperation:sender]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
901 |
|
12047 | 902 |
return result; |
903 |
} |
|
904 |
||
905 |
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender |
|
906 |
{ |
|
907 |
// If draggingDestination is nil route the message to the superclass: |
|
908 |
CDropTarget *dropTarget = self._dropTarget; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
909 |
|
12047 | 910 |
if (dropTarget != nil) |
911 |
[dropTarget concludeDragOperation:sender]; |
|
912 |
else if ([super respondsToSelector:@selector(concludeDragOperation:)]) |
|
913 |
[super concludeDragOperation:sender]; |
|
914 |
} |
|
915 |
||
916 |
- (void)draggingEnded:(id <NSDraggingInfo>)sender |
|
917 |
{ |
|
918 |
// If draggingDestination is nil route the message to the superclass: |
|
919 |
CDropTarget *dropTarget = self._dropTarget; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
920 |
|
12047 | 921 |
if (dropTarget != nil) |
922 |
[dropTarget draggingEnded:sender]; |
|
923 |
else if ([super respondsToSelector:@selector(draggingEnded:)]) |
|
924 |
[super draggingEnded:sender]; |
|
925 |
} |
|
926 |
||
927 |
/******************************** END NSDraggingDestination Interface ********************************/ |
|
928 |
||
929 |
/******************************** BEGIN NSTextInputClient Protocol ********************************/ |
|
930 |
||
931 |
||
932 |
JNF_CLASS_CACHE(jc_CInputMethod, "sun/lwawt/macosx/CInputMethod"); |
|
933 |
||
934 |
- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange |
|
935 |
{ |
|
936 |
#ifdef IM_DEBUG |
|
937 |
fprintf(stderr, "AWTView InputMethod Selector Called : [insertText]: %s\n", [aString UTF8String]); |
|
938 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
939 |
|
12047 | 940 |
if (fInputMethodLOCKABLE == NULL) { |
941 |
return; |
|
942 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
943 |
|
12047 | 944 |
// Insert happens at the end of PAH |
945 |
fInPressAndHold = NO; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
946 |
|
12047 | 947 |
// insertText gets called when the user commits text generated from an input method. It also gets |
948 |
// called during ordinary input as well. We only need to send an input method event when we have marked |
|
949 |
// text, or 'text in progress'. We also need to send the event if we get an insert text out of the blue! |
|
950 |
// (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex |
|
951 |
// Unicode value. |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
952 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
953 |
NSMutableString * useString = [self parseString:aString]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
954 |
NSUInteger utf16Length = [useString lengthOfBytesUsingEncoding:NSUTF16StringEncoding]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
955 |
NSUInteger utf8Length = [useString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; |
33858
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
956 |
BOOL aStringIsComplex = NO; |
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
957 |
if ((utf16Length > 2) || |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
958 |
((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:[useString characterAtIndex:0]])) { |
33858
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
959 |
aStringIsComplex = YES; |
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
960 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
961 |
|
33858
7554d0e25d7f
8132503: [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X
alitvinov
parents:
32872
diff
changeset
|
962 |
if ([self hasMarkedText] || !fProcessingKeystroke || aStringIsComplex) { |
12047 | 963 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
964 |
|
12047 | 965 |
static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V"); |
966 |
// We need to select the previous glyph so that it is overwritten. |
|
967 |
if (fPAHNeedsToSelect) { |
|
968 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_selectPreviousGlyph); |
|
969 |
fPAHNeedsToSelect = NO; |
|
970 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
971 |
|
12047 | 972 |
static JNF_MEMBER_CACHE(jm_insertText, jc_CInputMethod, "insertText", "(Ljava/lang/String;)V"); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
973 |
jstring insertedText = JNFNSToJavaString(env, useString); |
12047 | 974 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_insertText, insertedText); // AWT_THREADING Safe (AWTRunLoopMode) |
975 |
(*env)->DeleteLocalRef(env, insertedText); |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
976 |
|
12047 | 977 |
// The input method event will create psuedo-key events for each character in the committed string. |
978 |
// We also don't want to send the character that triggered the insertText, usually a return. [3337563] |
|
979 |
fKeyEventsNeeded = NO; |
|
980 |
} |
|
981 |
fPAHNeedsToSelect = NO; |
|
982 |
} |
|
983 |
||
984 |
- (void) doCommandBySelector:(SEL)aSelector |
|
985 |
{ |
|
986 |
#ifdef IM_DEBUG |
|
987 |
fprintf(stderr, "AWTView InputMethod Selector Called : [doCommandBySelector]\n"); |
|
988 |
NSLog(@"%@", NSStringFromSelector(aSelector)); |
|
989 |
#endif // IM_DEBUG |
|
990 |
if (@selector(insertNewline:) == aSelector || @selector(insertTab:) == aSelector || @selector(deleteBackward:) == aSelector) |
|
991 |
{ |
|
992 |
fKeyEventsNeeded = YES; |
|
993 |
} |
|
994 |
} |
|
995 |
||
996 |
// setMarkedText: cannot take a nil first argument. aString can be NSString or NSAttributedString |
|
997 |
- (void) setMarkedText:(id)aString selectedRange:(NSRange)selectionRange replacementRange:(NSRange)replacementRange |
|
998 |
{ |
|
999 |
if (!fInputMethodLOCKABLE) |
|
1000 |
return; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1001 |
|
12047 | 1002 |
BOOL isAttributedString = [aString isKindOfClass:[NSAttributedString class]]; |
1003 |
NSAttributedString *attrString = (isAttributedString ? (NSAttributedString *)aString : nil); |
|
1004 |
NSString *incomingString = (isAttributedString ? [aString string] : aString); |
|
1005 |
#ifdef IM_DEBUG |
|
1006 |
fprintf(stderr, "AWTView InputMethod Selector Called : [setMarkedText] \"%s\", loc=%lu, length=%lu\n", [incomingString UTF8String], (unsigned long)selectionRange.location, (unsigned long)selectionRange.length); |
|
1007 |
#endif // IM_DEBUG |
|
1008 |
static JNF_MEMBER_CACHE(jm_startIMUpdate, jc_CInputMethod, "startIMUpdate", "(Ljava/lang/String;)V"); |
|
1009 |
static JNF_MEMBER_CACHE(jm_addAttribute, jc_CInputMethod, "addAttribute", "(ZZII)V"); |
|
1010 |
static JNF_MEMBER_CACHE(jm_dispatchText, jc_CInputMethod, "dispatchText", "(IIZ)V"); |
|
1011 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1012 |
|
12047 | 1013 |
// NSInputContext already did the analysis of the TSM event and created attributes indicating |
1014 |
// the underlining and color that should be done to the string. We need to look at the underline |
|
1015 |
// style and color to determine what kind of Java hilighting needs to be done. |
|
1016 |
jstring inProcessText = JNFNSToJavaString(env, incomingString); |
|
1017 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_startIMUpdate, inProcessText); // AWT_THREADING Safe (AWTRunLoopMode) |
|
1018 |
(*env)->DeleteLocalRef(env, inProcessText); |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1019 |
|
12047 | 1020 |
if (isAttributedString) { |
1021 |
NSUInteger length; |
|
1022 |
NSRange effectiveRange; |
|
1023 |
NSDictionary *attributes; |
|
1024 |
length = [attrString length]; |
|
1025 |
effectiveRange = NSMakeRange(0, 0); |
|
1026 |
while (NSMaxRange(effectiveRange) < length) { |
|
1027 |
attributes = [attrString attributesAtIndex:NSMaxRange(effectiveRange) |
|
1028 |
effectiveRange:&effectiveRange]; |
|
1029 |
if (attributes) { |
|
1030 |
BOOL isThickUnderline, isGray; |
|
1031 |
NSNumber *underlineSizeObj = |
|
1032 |
(NSNumber *)[attributes objectForKey:NSUnderlineStyleAttributeName]; |
|
1033 |
NSInteger underlineSize = [underlineSizeObj integerValue]; |
|
1034 |
isThickUnderline = (underlineSize > 1); |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1035 |
|
12047 | 1036 |
NSColor *underlineColorObj = |
1037 |
(NSColor *)[attributes objectForKey:NSUnderlineColorAttributeName]; |
|
1038 |
isGray = !([underlineColorObj isEqual:[NSColor blackColor]]); |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1039 |
|
12047 | 1040 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_addAttribute, isThickUnderline, isGray, effectiveRange.location, effectiveRange.length); // AWT_THREADING Safe (AWTRunLoopMode) |
1041 |
} |
|
1042 |
} |
|
1043 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1044 |
|
12047 | 1045 |
static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V"); |
1046 |
// We need to select the previous glyph so that it is overwritten. |
|
1047 |
if (fPAHNeedsToSelect) { |
|
1048 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_selectPreviousGlyph); |
|
1049 |
fPAHNeedsToSelect = NO; |
|
1050 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1051 |
|
12047 | 1052 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_dispatchText, selectionRange.location, selectionRange.length, JNI_FALSE); // AWT_THREADING Safe (AWTRunLoopMode) |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1053 |
|
12047 | 1054 |
// If the marked text is being cleared (zero-length string) don't handle the key event. |
1055 |
if ([incomingString length] == 0) { |
|
1056 |
fKeyEventsNeeded = NO; |
|
1057 |
} |
|
1058 |
} |
|
1059 |
||
1060 |
- (void) unmarkText |
|
1061 |
{ |
|
1062 |
#ifdef IM_DEBUG |
|
1063 |
fprintf(stderr, "AWTView InputMethod Selector Called : [unmarkText]\n"); |
|
1064 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1065 |
|
12047 | 1066 |
if (!fInputMethodLOCKABLE) { |
1067 |
return; |
|
1068 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1069 |
|
12047 | 1070 |
// unmarkText cancels any input in progress and commits it to the text field. |
1071 |
static JNF_MEMBER_CACHE(jm_unmarkText, jc_CInputMethod, "unmarkText", "()V"); |
|
1072 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
1073 |
JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_unmarkText); // AWT_THREADING Safe (AWTRunLoopMode) |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1074 |
|
12047 | 1075 |
} |
1076 |
||
1077 |
- (BOOL) hasMarkedText |
|
1078 |
{ |
|
1079 |
#ifdef IM_DEBUG |
|
1080 |
fprintf(stderr, "AWTView InputMethod Selector Called : [hasMarkedText]\n"); |
|
1081 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1082 |
|
12047 | 1083 |
if (!fInputMethodLOCKABLE) { |
1084 |
return NO; |
|
1085 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1086 |
|
12047 | 1087 |
static JNF_MEMBER_CACHE(jf_fCurrentText, jc_CInputMethod, "fCurrentText", "Ljava/text/AttributedString;"); |
1088 |
static JNF_MEMBER_CACHE(jf_fCurrentTextLength, jc_CInputMethod, "fCurrentTextLength", "I"); |
|
1089 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
1090 |
jobject currentText = JNFGetObjectField(env, fInputMethodLOCKABLE, jf_fCurrentText); |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1091 |
|
12047 | 1092 |
jint currentTextLength = JNFGetIntField(env, fInputMethodLOCKABLE, jf_fCurrentTextLength); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1093 |
|
12047 | 1094 |
BOOL hasMarkedText = (currentText != NULL && currentTextLength > 0); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1095 |
|
12047 | 1096 |
if (currentText != NULL) { |
1097 |
(*env)->DeleteLocalRef(env, currentText); |
|
1098 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1099 |
|
12047 | 1100 |
return hasMarkedText; |
1101 |
} |
|
1102 |
||
1103 |
- (NSInteger) conversationIdentifier |
|
1104 |
{ |
|
1105 |
#ifdef IM_DEBUG |
|
1106 |
fprintf(stderr, "AWTView InputMethod Selector Called : [conversationIdentifier]\n"); |
|
1107 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1108 |
|
12047 | 1109 |
return (NSInteger) self; |
1110 |
} |
|
1111 |
||
1112 |
/* Returns attributed string at the range. This allows input mangers to |
|
1113 |
query any range in backing-store (Andy's request) |
|
1114 |
*/ |
|
1115 |
- (NSAttributedString *) attributedSubstringForProposedRange:(NSRange)theRange actualRange:(NSRangePointer)actualRange |
|
1116 |
{ |
|
1117 |
#ifdef IM_DEBUG |
|
1118 |
fprintf(stderr, "AWTView InputMethod Selector Called : [attributedSubstringFromRange] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length); |
|
1119 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1120 |
|
12047 | 1121 |
static JNF_MEMBER_CACHE(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;"); |
1122 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
1123 |
jobject theString = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length); // AWT_THREADING Safe (AWTRunLoopMode) |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1124 |
|
12047 | 1125 |
id result = [[[NSAttributedString alloc] initWithString:JNFJavaToNSString(env, theString)] autorelease]; |
1126 |
#ifdef IM_DEBUG |
|
1127 |
NSLog(@"attributedSubstringFromRange returning \"%@\"", result); |
|
1128 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1129 |
|
12047 | 1130 |
(*env)->DeleteLocalRef(env, theString); |
1131 |
return result; |
|
1132 |
} |
|
1133 |
||
1134 |
/* This method returns the range for marked region. If hasMarkedText == false, |
|
1135 |
it'll return NSNotFound location & 0 length range. |
|
1136 |
*/ |
|
1137 |
- (NSRange) markedRange |
|
1138 |
{ |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1139 |
|
12047 | 1140 |
#ifdef IM_DEBUG |
1141 |
fprintf(stderr, "AWTView InputMethod Selector Called : [markedRange]\n"); |
|
1142 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1143 |
|
12047 | 1144 |
if (!fInputMethodLOCKABLE) { |
1145 |
return NSMakeRange(NSNotFound, 0); |
|
1146 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1147 |
|
12047 | 1148 |
static JNF_MEMBER_CACHE(jm_markedRange, jc_CInputMethod, "markedRange", "()[I"); |
1149 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
1150 |
jarray array; |
|
1151 |
jboolean isCopy; |
|
1152 |
jint *_array; |
|
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1153 |
NSRange range = NSMakeRange(NSNotFound, 0); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1154 |
|
12047 | 1155 |
array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_markedRange); // AWT_THREADING Safe (AWTRunLoopMode) |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1156 |
|
12047 | 1157 |
if (array) { |
1158 |
_array = (*env)->GetIntArrayElements(env, array, &isCopy); |
|
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1159 |
if (_array != NULL) { |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1160 |
range.location = _array[0]; |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1161 |
range.length = _array[1]; |
12047 | 1162 |
#ifdef IM_DEBUG |
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1163 |
fprintf(stderr, "markedRange returning (%lu, %lu)\n", |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1164 |
(unsigned long)range.location, (unsigned long)range.length); |
12047 | 1165 |
#endif // IM_DEBUG |
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1166 |
(*env)->ReleaseIntArrayElements(env, array, _array, 0); |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1167 |
} |
12047 | 1168 |
(*env)->DeleteLocalRef(env, array); |
1169 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1170 |
|
12047 | 1171 |
return range; |
1172 |
} |
|
1173 |
||
1174 |
/* This method returns the range for selected region. Just like markedRange method, |
|
1175 |
its location field contains char index from the text beginning. |
|
1176 |
*/ |
|
1177 |
- (NSRange) selectedRange |
|
1178 |
{ |
|
1179 |
if (!fInputMethodLOCKABLE) { |
|
1180 |
return NSMakeRange(NSNotFound, 0); |
|
1181 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1182 |
|
12047 | 1183 |
static JNF_MEMBER_CACHE(jm_selectedRange, jc_CInputMethod, "selectedRange", "()[I"); |
1184 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
1185 |
jarray array; |
|
1186 |
jboolean isCopy; |
|
1187 |
jint *_array; |
|
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1188 |
NSRange range = NSMakeRange(NSNotFound, 0); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1189 |
|
12047 | 1190 |
#ifdef IM_DEBUG |
1191 |
fprintf(stderr, "AWTView InputMethod Selector Called : [selectedRange]\n"); |
|
1192 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1193 |
|
12047 | 1194 |
array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_selectedRange); // AWT_THREADING Safe (AWTRunLoopMode) |
1195 |
if (array) { |
|
1196 |
_array = (*env)->GetIntArrayElements(env, array, &isCopy); |
|
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1197 |
if (_array != NULL) { |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1198 |
range.location = _array[0]; |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1199 |
range.length = _array[1]; |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1200 |
(*env)->ReleaseIntArrayElements(env, array, _array, 0); |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1201 |
} |
12047 | 1202 |
(*env)->DeleteLocalRef(env, array); |
1203 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1204 |
|
12047 | 1205 |
return range; |
1206 |
} |
|
1207 |
||
1208 |
/* This method returns the first frame of rects for theRange in screen coordindate system. |
|
1209 |
*/ |
|
1210 |
- (NSRect) firstRectForCharacterRange:(NSRange)theRange actualRange:(NSRangePointer)actualRange |
|
1211 |
{ |
|
1212 |
if (!fInputMethodLOCKABLE) { |
|
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1213 |
return NSZeroRect; |
12047 | 1214 |
} |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1215 |
|
12047 | 1216 |
static JNF_MEMBER_CACHE(jm_firstRectForCharacterRange, jc_CInputMethod, |
1217 |
"firstRectForCharacterRange", "(I)[I"); |
|
1218 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
1219 |
jarray array; |
|
1220 |
jboolean isCopy; |
|
1221 |
jint *_array; |
|
1222 |
NSRect rect; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1223 |
|
12047 | 1224 |
#ifdef IM_DEBUG |
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1225 |
fprintf(stderr, |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1226 |
"AWTView InputMethod Selector Called : [firstRectForCharacterRange:] location=%lu, length=%lu\n", |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1227 |
(unsigned long)theRange.location, (unsigned long)theRange.length); |
12047 | 1228 |
#endif // IM_DEBUG |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1229 |
|
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1230 |
array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_firstRectForCharacterRange, |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1231 |
theRange.location); // AWT_THREADING Safe (AWTRunLoopMode) |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1232 |
|
12047 | 1233 |
_array = (*env)->GetIntArrayElements(env, array, &isCopy); |
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1234 |
if (_array) { |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1235 |
rect = ConvertNSScreenRect(env, NSMakeRect(_array[0], _array[1], _array[2], _array[3])); |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1236 |
(*env)->ReleaseIntArrayElements(env, array, _array, 0); |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1237 |
} else { |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1238 |
rect = NSZeroRect; |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1239 |
} |
12047 | 1240 |
(*env)->DeleteLocalRef(env, array); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1241 |
|
12047 | 1242 |
#ifdef IM_DEBUG |
23625
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1243 |
fprintf(stderr, |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1244 |
"firstRectForCharacterRange returning x=%f, y=%f, width=%f, height=%f\n", |
bb223c2c6fc0
8034037: [parfait] JNI exception pending in macosx/native/sun/awt/AWTEvent.m, AWTView.m
serb
parents:
23328
diff
changeset
|
1245 |
rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); |
12047 | 1246 |
#endif // IM_DEBUG |
1247 |
return rect; |
|
1248 |
} |
|
1249 |
||
1250 |
/* This method returns the index for character that is nearest to thePoint. thPoint is in |
|
1251 |
screen coordinate system. |
|
1252 |
*/ |
|
1253 |
- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint |
|
1254 |
{ |
|
1255 |
if (!fInputMethodLOCKABLE) { |
|
1256 |
return NSNotFound; |
|
1257 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1258 |
|
12047 | 1259 |
static JNF_MEMBER_CACHE(jm_characterIndexForPoint, jc_CInputMethod, |
1260 |
"characterIndexForPoint", "(II)I"); |
|
1261 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1262 |
|
12047 | 1263 |
NSPoint flippedLocation = ConvertNSScreenPoint(env, thePoint); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1264 |
|
12047 | 1265 |
#ifdef IM_DEBUG |
1266 |
fprintf(stderr, "AWTView InputMethod Selector Called : [characterIndexForPoint:(NSPoint)thePoint] x=%f, y=%f\n", flippedLocation.x, flippedLocation.y); |
|
1267 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1268 |
|
12047 | 1269 |
jint index = JNFCallIntMethod(env, fInputMethodLOCKABLE, jm_characterIndexForPoint, (jint)flippedLocation.x, (jint)flippedLocation.y); // AWT_THREADING Safe (AWTRunLoopMode) |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1270 |
|
12047 | 1271 |
#ifdef IM_DEBUG |
1272 |
fprintf(stderr, "characterIndexForPoint returning %ld\n", index); |
|
1273 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1274 |
|
12047 | 1275 |
if (index == -1) { |
1276 |
return NSNotFound; |
|
1277 |
} else { |
|
1278 |
return (NSUInteger)index; |
|
1279 |
} |
|
1280 |
} |
|
1281 |
||
1282 |
- (NSArray*) validAttributesForMarkedText |
|
1283 |
{ |
|
1284 |
#ifdef IM_DEBUG |
|
1285 |
fprintf(stderr, "AWTView InputMethod Selector Called : [validAttributesForMarkedText]\n"); |
|
1286 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1287 |
|
12047 | 1288 |
return [NSArray array]; |
1289 |
} |
|
1290 |
||
1291 |
- (void)setInputMethod:(jobject)inputMethod |
|
1292 |
{ |
|
1293 |
#ifdef IM_DEBUG |
|
1294 |
fprintf(stderr, "AWTView InputMethod Selector Called : [setInputMethod]\n"); |
|
1295 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1296 |
|
12047 | 1297 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1298 |
|
12047 | 1299 |
// Get rid of the old one |
1300 |
if (fInputMethodLOCKABLE) { |
|
1301 |
JNFDeleteGlobalRef(env, fInputMethodLOCKABLE); |
|
1302 |
} |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1303 |
|
12047 | 1304 |
// Save a global ref to the new input method. |
1305 |
if (inputMethod != NULL) |
|
1306 |
fInputMethodLOCKABLE = JNFNewGlobalRef(env, inputMethod); |
|
1307 |
else |
|
1308 |
fInputMethodLOCKABLE = NULL; |
|
1309 |
} |
|
1310 |
||
1311 |
- (void)abandonInput |
|
1312 |
{ |
|
1313 |
#ifdef IM_DEBUG |
|
1314 |
fprintf(stderr, "AWTView InputMethod Selector Called : [abandonInput]\n"); |
|
1315 |
#endif // IM_DEBUG |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1316 |
|
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15322
diff
changeset
|
1317 |
[ThreadUtilities performOnMainThread:@selector(markedTextAbandoned:) on:[NSInputManager currentInputManager] withObject:self waitUntilDone:YES]; |
12047 | 1318 |
[self unmarkText]; |
1319 |
} |
|
1320 |
||
1321 |
/******************************** END NSTextInputClient Protocol ********************************/ |
|
1322 |
||
1323 |
||
1324 |
||
1325 |
||
1326 |
@end // AWTView |
|
1327 |
||
1328 |
/* |
|
1329 |
* Class: sun_lwawt_macosx_CPlatformView |
|
1330 |
* Method: nativeCreateView |
|
1331 |
* Signature: (IIII)J |
|
1332 |
*/ |
|
1333 |
JNIEXPORT jlong JNICALL |
|
1334 |
Java_sun_lwawt_macosx_CPlatformView_nativeCreateView |
|
1335 |
(JNIEnv *env, jobject obj, jint originX, jint originY, jint width, jint height, jlong windowLayerPtr) |
|
1336 |
{ |
|
1337 |
__block AWTView *newView = nil; |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1338 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1339 |
JNF_COCOA_ENTER(env); |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1340 |
|
12047 | 1341 |
NSRect rect = NSMakeRect(originX, originY, width, height); |
37787 | 1342 |
jobject cPlatformView = (*env)->NewWeakGlobalRef(env, obj); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1343 |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1344 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1345 |
|
12047 | 1346 |
CALayer *windowLayer = jlong_to_ptr(windowLayerPtr); |
23651
e41298d0da2f
8037099: [macosx] Remove all references to GC from native OBJ-C code
pchelko
parents:
23625
diff
changeset
|
1347 |
newView = [[AWTView alloc] initWithRect:rect |
e41298d0da2f
8037099: [macosx] Remove all references to GC from native OBJ-C code
pchelko
parents:
23625
diff
changeset
|
1348 |
platformView:cPlatformView |
e41298d0da2f
8037099: [macosx] Remove all references to GC from native OBJ-C code
pchelko
parents:
23625
diff
changeset
|
1349 |
windowLayer:windowLayer]; |
12047 | 1350 |
}]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1351 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1352 |
JNF_COCOA_EXIT(env); |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1353 |
|
12047 | 1354 |
return ptr_to_jlong(newView); |
1355 |
} |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1356 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1357 |
/* |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1358 |
* Class: sun_lwawt_macosx_CPlatformView |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1359 |
* Method: nativeSetAutoResizable |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1360 |
* Signature: (JZ)V; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1361 |
*/ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1362 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1363 |
JNIEXPORT void JNICALL |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1364 |
Java_sun_lwawt_macosx_CPlatformView_nativeSetAutoResizable |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1365 |
(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toResize) |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1366 |
{ |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1367 |
JNF_COCOA_ENTER(env); |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1368 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1369 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1370 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1371 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1372 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1373 |
if (toResize) { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1374 |
[view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1375 |
} else { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1376 |
[view setAutoresizingMask: NSViewMinYMargin | NSViewMaxXMargin]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1377 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1378 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1379 |
if ([view superview] != nil) { |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1380 |
[[view superview] setAutoresizesSubviews:(BOOL)toResize]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1381 |
} |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1382 |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1383 |
}]; |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1384 |
JNF_COCOA_EXIT(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1385 |
} |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1386 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1387 |
/* |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1388 |
* Class: sun_lwawt_macosx_CPlatformView |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1389 |
* Method: nativeGetNSViewDisplayID |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1390 |
* Signature: (J)I; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1391 |
*/ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1392 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1393 |
JNIEXPORT jint JNICALL |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1394 |
Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1395 |
(JNIEnv *env, jclass cls, jlong viewPtr) |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1396 |
{ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1397 |
__block jint ret; //CGDirectDisplayID |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1398 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1399 |
JNF_COCOA_ENTER(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1400 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1401 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1402 |
NSWindow *window = [view window]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1403 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1404 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1405 |
|
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1406 |
ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue]; |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1407 |
}]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1408 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1409 |
JNF_COCOA_EXIT(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1410 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1411 |
return ret; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1412 |
} |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1413 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1414 |
/* |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1415 |
* Class: sun_lwawt_macosx_CPlatformView |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1416 |
* Method: nativeGetLocationOnScreen |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1417 |
* Signature: (J)Ljava/awt/Rectangle; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1418 |
*/ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1419 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1420 |
JNIEXPORT jobject JNICALL |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1421 |
Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1422 |
(JNIEnv *env, jclass cls, jlong viewPtr) |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1423 |
{ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1424 |
jobject jRect = NULL; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1425 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1426 |
JNF_COCOA_ENTER(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1427 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1428 |
__block NSRect rect = NSZeroRect; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1429 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1430 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1431 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1432 |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1433 |
NSRect viewBounds = [view bounds]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1434 |
NSRect frameInWindow = [view convertRect:viewBounds toView:nil]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1435 |
rect = [[view window] convertRectToScreen:frameInWindow]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1436 |
NSRect screenRect = [[NSScreen mainScreen] frame]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1437 |
//Convert coordinates to top-left corner origin |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1438 |
rect.origin.y = screenRect.size.height - rect.origin.y - viewBounds.size.height; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1439 |
}]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1440 |
jRect = NSToJavaRect(env, rect); |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1441 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1442 |
JNF_COCOA_EXIT(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1443 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1444 |
return jRect; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1445 |
} |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1446 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1447 |
/* |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1448 |
* Class: sun_lwawt_macosx_CPlatformView |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1449 |
* Method: nativeIsViewUnderMouse |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1450 |
* Signature: (J)Z; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1451 |
*/ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1452 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1453 |
JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CPlatformView_nativeIsViewUnderMouse |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1454 |
(JNIEnv *env, jclass clazz, jlong viewPtr) |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1455 |
{ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1456 |
__block jboolean underMouse = JNI_FALSE; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1457 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1458 |
JNF_COCOA_ENTER(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1459 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1460 |
NSView *nsView = OBJC(viewPtr); |
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1461 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1462 |
NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1463 |
NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil]; |
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1464 |
underMouse = [nsView hitTest:ptViewCoords] != nil; |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1465 |
}]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1466 |
|
36897
086e09a30b77
8148555: [macosx] An uncaught exception was raised entering Emoji into JTextArea
aniyogi
parents:
36462
diff
changeset
|
1467 |
JNF_COCOA_EXIT(env); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1468 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1469 |
return underMouse; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
1470 |
} |