author | anashaty |
Tue, 20 Jan 2015 19:26:14 +0300 | |
changeset 28990 | 2656e19f0cd6 |
parent 27052 | 0b783c32e5c2 |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
2 |
* Copyright (c) 2011, 2014, 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 |
||
26 |
#import <JavaNativeFoundation/JavaNativeFoundation.h> |
|
27 |
#import "ThreadUtilities.h" |
|
28 |
#import "sun_lwawt_macosx_CWrapper_NSWindow.h" |
|
29 |
||
30 |
/* |
|
31 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
32 |
* Method: makeKeyAndOrderFront |
|
33 |
* Signature: (J)V |
|
34 |
*/ |
|
35 |
JNIEXPORT void JNICALL |
|
36 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyAndOrderFront |
|
37 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
38 |
{ |
|
39 |
JNF_COCOA_ENTER(env); |
|
40 |
||
41 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
42 |
[ThreadUtilities performOnMainThread:@selector(makeKeyAndOrderFront:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
43 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
44 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
45 |
waitUntilDone:NO]; |
12047 | 46 |
|
47 |
JNF_COCOA_EXIT(env); |
|
48 |
} |
|
49 |
||
50 |
/* |
|
51 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
12177
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
52 |
* Method: makeKeyWindow |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
53 |
* Signature: (J)V |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
54 |
*/ |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
55 |
JNIEXPORT void JNICALL |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
56 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
57 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
58 |
{ |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
59 |
JNF_COCOA_ENTER(env); |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
60 |
|
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
61 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
62 |
[ThreadUtilities performOnMainThread:@selector(makeKeyWindow) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
63 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
64 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
65 |
waitUntilDone:NO]; |
12177
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
66 |
|
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
67 |
JNF_COCOA_EXIT(env); |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
68 |
} |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
69 |
|
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
70 |
/* |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
71 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
12047 | 72 |
* Method: makeMainWindow |
73 |
* Signature: (J)V |
|
74 |
*/ |
|
75 |
JNIEXPORT void JNICALL |
|
76 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeMainWindow |
|
77 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
78 |
{ |
|
79 |
JNF_COCOA_ENTER(env); |
|
80 |
||
81 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
82 |
[ThreadUtilities performOnMainThread:@selector(makeMainWindow) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
83 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
84 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
85 |
waitUntilDone:NO]; |
12047 | 86 |
|
87 |
JNF_COCOA_EXIT(env); |
|
88 |
} |
|
89 |
||
90 |
/* |
|
91 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
92 |
* Method: canBecomeMainWindow |
|
93 |
* Signature: (J)V |
|
94 |
*/ |
|
95 |
JNIEXPORT jboolean JNICALL |
|
96 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_canBecomeMainWindow |
|
97 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
98 |
{ |
|
99 |
__block jboolean canBecomeMainWindow = JNI_FALSE; |
|
100 |
||
101 |
JNF_COCOA_ENTER(env); |
|
102 |
||
103 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
104 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
12047 | 105 |
canBecomeMainWindow = [window canBecomeMainWindow]; |
106 |
}]; |
|
107 |
||
108 |
JNF_COCOA_EXIT(env); |
|
109 |
||
110 |
return canBecomeMainWindow; |
|
111 |
} |
|
112 |
||
113 |
/* |
|
114 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
115 |
* Method: isKeyWindow |
|
116 |
* Signature: (J)Z |
|
117 |
*/ |
|
118 |
JNIEXPORT jboolean JNICALL |
|
119 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isKeyWindow |
|
120 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
121 |
{ |
|
122 |
__block jboolean isKeyWindow = JNI_FALSE; |
|
123 |
||
124 |
JNF_COCOA_ENTER(env); |
|
125 |
||
126 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
127 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
12047 | 128 |
isKeyWindow = [window isKeyWindow]; |
129 |
}]; |
|
130 |
||
131 |
JNF_COCOA_EXIT(env); |
|
132 |
||
133 |
return isKeyWindow; |
|
134 |
} |
|
135 |
||
136 |
/* |
|
137 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
138 |
* Method: orderFront |
|
139 |
* Signature: (J)V |
|
140 |
*/ |
|
141 |
JNIEXPORT void JNICALL |
|
142 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderFront |
|
143 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
144 |
{ |
|
145 |
JNF_COCOA_ENTER(env); |
|
146 |
||
147 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
148 |
[ThreadUtilities performOnMainThread:@selector(orderFront:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
149 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
150 |
withObject:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
151 |
waitUntilDone:NO]; |
12047 | 152 |
|
153 |
JNF_COCOA_EXIT(env); |
|
154 |
} |
|
155 |
||
156 |
/* |
|
157 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
158 |
* Method: orderOut |
|
159 |
* Signature: (J)V |
|
160 |
*/ |
|
161 |
JNIEXPORT void JNICALL |
|
162 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderOut |
|
163 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
164 |
{ |
|
165 |
JNF_COCOA_ENTER(env); |
|
166 |
||
167 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
168 |
[ThreadUtilities performOnMainThread:@selector(orderOut:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
169 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
170 |
withObject:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
171 |
waitUntilDone:NO]; |
12047 | 172 |
|
173 |
JNF_COCOA_EXIT(env); |
|
174 |
} |
|
175 |
||
176 |
/* |
|
177 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
27052
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
178 |
* Method: close |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
179 |
* Signature: (J)V |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
180 |
*/ |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
181 |
JNIEXPORT void JNICALL |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
182 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_close |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
183 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
184 |
{ |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
185 |
JNF_COCOA_ENTER(env); |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
186 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
187 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
188 |
[window close]; |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
189 |
}]; |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
190 |
JNF_COCOA_EXIT(env); |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
191 |
} |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
192 |
|
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
193 |
/* |
0b783c32e5c2
8041734: JFrame in full screen mode leaves empty workspace after close
serb
parents:
26751
diff
changeset
|
194 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
12047 | 195 |
* Method: orderFrontRegardless |
196 |
* Signature: (J)V |
|
197 |
*/ |
|
198 |
JNIEXPORT void JNICALL |
|
199 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderFrontRegardless |
|
200 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
201 |
{ |
|
202 |
JNF_COCOA_ENTER(env); |
|
203 |
||
204 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
205 |
[ThreadUtilities performOnMainThread:@selector(orderFrontRegardless) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
206 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
207 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
208 |
waitUntilDone:NO]; |
12047 | 209 |
|
210 |
JNF_COCOA_EXIT(env); |
|
211 |
} |
|
212 |
||
213 |
/* |
|
214 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
215 |
* Method: orderWindow |
|
216 |
* Signature: (JIJ)V |
|
217 |
*/ |
|
218 |
JNIEXPORT void JNICALL |
|
219 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderWindow |
|
220 |
(JNIEnv *env, jclass cls, jlong windowPtr, jint order, jlong relativeToPtr) |
|
221 |
{ |
|
222 |
JNF_COCOA_ENTER(env); |
|
223 |
||
224 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
225 |
NSWindow *relativeTo = (NSWindow *)jlong_to_ptr(relativeToPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
226 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 227 |
[window orderWindow:(NSWindowOrderingMode)order relativeTo:[relativeTo windowNumber]]; |
228 |
}]; |
|
229 |
||
230 |
JNF_COCOA_EXIT(env); |
|
231 |
} |
|
232 |
||
233 |
// Used for CWrapper.NSWindow.setLevel() (and level() which isn't implemented yet) |
|
234 |
static NSInteger LEVELS[sun_lwawt_macosx_CWrapper_NSWindow_MAX_WINDOW_LEVELS]; |
|
235 |
static void initLevels() |
|
236 |
{ |
|
237 |
static dispatch_once_t pred; |
|
238 |
||
239 |
dispatch_once(&pred, ^{ |
|
240 |
LEVELS[sun_lwawt_macosx_CWrapper_NSWindow_NSNormalWindowLevel] = NSNormalWindowLevel; |
|
241 |
LEVELS[sun_lwawt_macosx_CWrapper_NSWindow_NSFloatingWindowLevel] = NSFloatingWindowLevel; |
|
23253 | 242 |
LEVELS[sun_lwawt_macosx_CWrapper_NSWindow_NSPopUpMenuWindowLevel] = NSPopUpMenuWindowLevel; |
12047 | 243 |
}); |
244 |
} |
|
245 |
||
246 |
/* |
|
247 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
248 |
* Method: setLevel |
|
249 |
* Signature: (JI)V |
|
250 |
*/ |
|
251 |
JNIEXPORT void JNICALL |
|
252 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setLevel |
|
253 |
(JNIEnv *env, jclass cls, jlong windowPtr, jint level) |
|
254 |
{ |
|
255 |
JNF_COCOA_ENTER(env); |
|
256 |
||
257 |
if (level >= 0 && level < sun_lwawt_macosx_CWrapper_NSWindow_MAX_WINDOW_LEVELS) { |
|
258 |
initLevels(); |
|
259 |
||
260 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
261 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 262 |
[window setLevel: LEVELS[level]]; |
263 |
}]; |
|
264 |
} else { |
|
265 |
[JNFException raise:env as:kIllegalArgumentException reason:"unknown level"]; |
|
266 |
} |
|
267 |
||
268 |
JNF_COCOA_EXIT(env); |
|
269 |
} |
|
270 |
||
271 |
/* |
|
272 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
273 |
* Method: addChildWindow |
|
274 |
* Signature: (JJI)V |
|
275 |
*/ |
|
276 |
JNIEXPORT void JNICALL |
|
277 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_addChildWindow |
|
278 |
(JNIEnv *env, jclass cls, jlong parentPtr, jlong childPtr, jint order) |
|
279 |
{ |
|
280 |
JNF_COCOA_ENTER(env); |
|
281 |
||
282 |
NSWindow *parent = (NSWindow *)jlong_to_ptr(parentPtr); |
|
283 |
NSWindow *child = (NSWindow *)jlong_to_ptr(childPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
284 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 285 |
[parent addChildWindow:child ordered:order]; |
286 |
}]; |
|
287 |
||
288 |
JNF_COCOA_EXIT(env); |
|
289 |
} |
|
290 |
||
291 |
/* |
|
292 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
293 |
* Method: removeChildWindow |
|
294 |
* Signature: (JJ)V |
|
295 |
*/ |
|
296 |
JNIEXPORT void JNICALL |
|
297 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_removeChildWindow |
|
298 |
(JNIEnv *env, jclass cls, jlong parentPtr, jlong childPtr) |
|
299 |
{ |
|
300 |
JNF_COCOA_ENTER(env); |
|
301 |
||
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
302 |
NSWindow *parent = (NSWindow *)jlong_to_ptr(parentPtr); |
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
303 |
NSWindow *child = (NSWindow *)jlong_to_ptr(childPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
304 |
[ThreadUtilities performOnMainThread:@selector(removeChildWindow:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
305 |
on:parent |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
306 |
withObject:child |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
307 |
waitUntilDone:NO]; |
12047 | 308 |
|
309 |
JNF_COCOA_EXIT(env); |
|
310 |
} |
|
311 |
||
312 |
/* |
|
313 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
314 |
* Method: setAlphaValue |
|
315 |
* Signature: (JF)V |
|
316 |
*/ |
|
317 |
JNIEXPORT void JNICALL |
|
318 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setAlphaValue |
|
319 |
(JNIEnv *env, jclass cls, jlong windowPtr, jfloat alpha) |
|
320 |
{ |
|
321 |
JNF_COCOA_ENTER(env); |
|
322 |
||
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
323 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
324 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 325 |
[window setAlphaValue:(CGFloat)alpha]; |
326 |
}]; |
|
327 |
||
328 |
JNF_COCOA_EXIT(env); |
|
329 |
} |
|
330 |
||
331 |
/* |
|
332 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
333 |
* Method: setOpaque |
|
334 |
* Signature: (Z)V |
|
335 |
*/ |
|
336 |
JNIEXPORT void JNICALL |
|
337 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setOpaque |
|
338 |
(JNIEnv *env, jclass cls, jlong windowPtr, jboolean opaque) |
|
339 |
{ |
|
340 |
JNF_COCOA_ENTER(env); |
|
341 |
||
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
342 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
343 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 344 |
[window setOpaque:(BOOL)opaque]; |
345 |
}]; |
|
346 |
||
347 |
JNF_COCOA_EXIT(env); |
|
348 |
} |
|
349 |
||
350 |
/* |
|
351 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
352 |
* Method: setBackgroundColor |
|
353 |
* Signature: (J)V |
|
354 |
*/ |
|
355 |
JNIEXPORT void JNICALL |
|
356 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setBackgroundColor |
|
25196
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
357 |
(JNIEnv *env, jclass cls, jlong windowPtr, jint rgb) |
12047 | 358 |
{ |
359 |
JNF_COCOA_ENTER(env); |
|
360 |
||
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
361 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
25196
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
362 |
CGFloat alpha = (((rgb >> 24) & 0xff) / 255.0); |
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
363 |
CGFloat red = (((rgb >> 16) & 0xff) / 255.0); |
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
364 |
CGFloat green = (((rgb >> 8) & 0xff) / 255.0); |
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
365 |
CGFloat blue = (((rgb >> 0) & 0xff) / 255.0); |
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
366 |
NSColor *color = [NSColor colorWithCalibratedRed:red green:green blue:blue |
48d9cfe3f138
8033786: White flashing when opening Dialogs and Menus using Nimbus with dark background
serb
parents:
23255
diff
changeset
|
367 |
alpha:alpha]; |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
368 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 369 |
[window setBackgroundColor:color]; |
370 |
}]; |
|
371 |
||
372 |
JNF_COCOA_EXIT(env); |
|
373 |
} |
|
374 |
||
375 |
/* |
|
23255
ebd69e3d93c5
8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
pchelko
parents:
23253
diff
changeset
|
376 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
12047 | 377 |
* Method: miniaturize |
378 |
* Signature: (J)V |
|
379 |
*/ |
|
380 |
JNIEXPORT void JNICALL |
|
381 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_miniaturize |
|
382 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
383 |
{ |
|
384 |
JNF_COCOA_ENTER(env); |
|
385 |
||
386 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
387 |
[ThreadUtilities performOnMainThread:@selector(miniaturize:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
388 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
389 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
390 |
waitUntilDone:NO]; |
12047 | 391 |
|
392 |
JNF_COCOA_EXIT(env); |
|
393 |
} |
|
394 |
||
395 |
/* |
|
396 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
397 |
* Method: deminiaturize |
|
398 |
* Signature: (J)V |
|
399 |
*/ |
|
400 |
JNIEXPORT void JNICALL |
|
401 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_deminiaturize |
|
402 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
403 |
{ |
|
404 |
JNF_COCOA_ENTER(env); |
|
405 |
||
406 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
407 |
[ThreadUtilities performOnMainThread:@selector(deminiaturize:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
408 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
409 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
410 |
waitUntilDone:NO]; |
12047 | 411 |
|
412 |
JNF_COCOA_EXIT(env); |
|
413 |
} |
|
414 |
||
415 |
/* |
|
416 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
20457
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
417 |
* Method: isZoomed |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
418 |
* Signature: (J)Z |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
419 |
*/ |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
420 |
JNIEXPORT jboolean JNICALL |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
421 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isZoomed |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
422 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
423 |
{ |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
424 |
__block jboolean isZoomed = JNI_FALSE; |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
425 |
|
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
426 |
JNF_COCOA_ENTER(env); |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
427 |
|
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
428 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
429 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
430 |
isZoomed = [window isZoomed]; |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
431 |
}]; |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
432 |
|
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
433 |
JNF_COCOA_EXIT(env); |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
434 |
|
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
435 |
return isZoomed; |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
436 |
} |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
437 |
|
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
438 |
/* |
ecb935d774a3
8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
alexsch
parents:
18759
diff
changeset
|
439 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
12047 | 440 |
* Method: zoom |
441 |
* Signature: (J)V |
|
442 |
*/ |
|
443 |
JNIEXPORT void JNICALL |
|
444 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_zoom |
|
445 |
(JNIEnv *env, jclass cls, jlong windowPtr) |
|
446 |
{ |
|
447 |
JNF_COCOA_ENTER(env); |
|
448 |
||
449 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
450 |
[ThreadUtilities performOnMainThread:@selector(zoom:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
451 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
452 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
453 |
waitUntilDone:NO]; |
12047 | 454 |
|
455 |
JNF_COCOA_EXIT(env); |
|
456 |
} |
|
457 |
||
458 |
/* |
|
459 |
* Class: sun_lwawt_macosx_CWrapper$NSWindow |
|
460 |
* Method: makeFirstResponder |
|
461 |
* Signature: (JJ)V |
|
462 |
*/ |
|
463 |
JNIEXPORT void JNICALL |
|
464 |
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeFirstResponder |
|
465 |
(JNIEnv *env, jclass cls, jlong windowPtr, jlong responderPtr) |
|
466 |
{ |
|
467 |
JNF_COCOA_ENTER(env); |
|
468 |
||
469 |
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); |
|
470 |
NSResponder *responder = (NSResponder *)jlong_to_ptr(responderPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
471 |
[ThreadUtilities performOnMainThread:@selector(makeFirstResponder:) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
472 |
on:window |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
473 |
withObject:responder |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
474 |
waitUntilDone:NO]; |
12047 | 475 |
|
476 |
JNF_COCOA_EXIT(env); |
|
477 |
} |
|
478 |
||
479 |
/* |
|
480 |
* Class: sun_lwawt_macosx_CWrapper$NSView |
|
481 |
* Method: addSubview |
|
482 |
* Signature: (JJ)V |
|
483 |
*/ |
|
484 |
JNIEXPORT void JNICALL |
|
485 |
Java_sun_lwawt_macosx_CWrapper_00024NSView_addSubview |
|
486 |
(JNIEnv *env, jclass cls, jlong viewPtr, jlong subviewPtr) |
|
487 |
{ |
|
488 |
JNF_COCOA_ENTER(env); |
|
489 |
||
490 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
|
491 |
NSView *subview = (NSView *)jlong_to_ptr(subviewPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
492 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
12047 | 493 |
[view addSubview:subview]; |
494 |
}]; |
|
495 |
||
496 |
JNF_COCOA_EXIT(env); |
|
497 |
} |
|
498 |
||
499 |
/* |
|
500 |
* Class: sun_lwawt_macosx_CWrapper$NSView |
|
501 |
* Method: removeFromSuperview |
|
502 |
* Signature: (J)V |
|
503 |
*/ |
|
504 |
JNIEXPORT void JNICALL |
|
505 |
Java_sun_lwawt_macosx_CWrapper_00024NSView_removeFromSuperview |
|
506 |
(JNIEnv *env, jclass cls, jlong viewPtr) |
|
507 |
{ |
|
508 |
JNF_COCOA_ENTER(env); |
|
509 |
||
510 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
511 |
[ThreadUtilities performOnMainThread:@selector(removeFromSuperview) |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
512 |
on:view |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
513 |
withObject:nil |
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
514 |
waitUntilDone:NO]; |
12047 | 515 |
|
516 |
JNF_COCOA_EXIT(env); |
|
517 |
} |
|
518 |
||
519 |
/* |
|
520 |
* Class: sun_lwawt_macosx_CWrapper$NSView |
|
521 |
* Method: setFrame |
|
522 |
* Signature: (JIIII)V |
|
523 |
*/ |
|
524 |
JNIEXPORT void JNICALL |
|
525 |
Java_sun_lwawt_macosx_CWrapper_00024NSView_setFrame |
|
526 |
(JNIEnv *env, jclass cls, jlong viewPtr, jint x, jint y, jint w, jint h) |
|
527 |
{ |
|
528 |
JNF_COCOA_ENTER(env); |
|
529 |
||
530 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
531 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 532 |
[view setFrame:NSMakeRect(x, y, w, h)]; |
533 |
}]; |
|
534 |
||
535 |
JNF_COCOA_EXIT(env); |
|
536 |
} |
|
537 |
||
538 |
/* |
|
539 |
* Class: sun_lwawt_macosx_CWrapper$NSView |
|
540 |
* Method: window |
|
541 |
* Signature: (J)J |
|
542 |
*/ |
|
543 |
JNIEXPORT jlong JNICALL |
|
544 |
Java_sun_lwawt_macosx_CWrapper_00024NSView_window |
|
545 |
(JNIEnv *env, jclass cls, jlong viewPtr) |
|
546 |
{ |
|
547 |
__block jlong windowPtr = 0L; |
|
548 |
||
549 |
JNF_COCOA_ENTER(env); |
|
550 |
||
551 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
552 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
12047 | 553 |
windowPtr = ptr_to_jlong([view window]); |
554 |
}]; |
|
555 |
||
556 |
JNF_COCOA_EXIT(env); |
|
557 |
||
558 |
return windowPtr; |
|
559 |
} |
|
560 |
||
561 |
/* |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
562 |
* Class: sun_lwawt_macosx_CWrapper$NSView |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
563 |
* Method: setHidden |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
564 |
* Signature: (JZ)V |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
565 |
*/ |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
566 |
JNIEXPORT void JNICALL |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
567 |
Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
568 |
(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide) |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
569 |
{ |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
570 |
JNF_COCOA_ENTER(env); |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
571 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
572 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
573 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
574 |
[view setHidden:(BOOL)toHide]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
575 |
}]; |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
576 |
|
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
577 |
JNF_COCOA_EXIT(env); |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
578 |
} |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12177
diff
changeset
|
579 |
|
18241 | 580 |
/* |
581 |
* Class: sun_lwawt_macosx_CWrapper$NSView |
|
582 |
* Method: setToolTip |
|
583 |
* Signature: (JLjava/lang/String;)V |
|
584 |
*/ |
|
585 |
JNIEXPORT void JNICALL |
|
586 |
Java_sun_lwawt_macosx_CWrapper_00024NSView_setToolTip |
|
587 |
(JNIEnv *env, jclass cls, jlong viewPtr, jstring msg) |
|
588 |
{ |
|
589 |
||
590 |
JNF_COCOA_ENTER(env); |
|
591 |
||
592 |
NSView *view = (NSView *)jlong_to_ptr(viewPtr); |
|
593 |
NSString* s = JNFJavaToNSString(env, msg); |
|
594 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
|
595 |
[view setToolTip: s]; |
|
596 |
}]; |
|
597 |
||
598 |
JNF_COCOA_EXIT(env); |
|
599 |
} |