src/macosx/native/sun/awt/AWTWindow.m

Print this page




 923 JNF_COCOA_ENTER(env);
 924 AWT_ASSERT_NOT_APPKIT_THREAD;
 925 
 926     NSWindow *nsWindow = OBJC(windowPtr);
 927     [nsWindow performSelectorOnMainThread:@selector(setTitle:)
 928                               withObject:JNFJavaToNSString(env, jtitle)
 929                            waitUntilDone:NO];
 930 
 931 JNF_COCOA_EXIT(env);
 932 }
 933 
 934 /*
 935  * Class:     sun_lwawt_macosx_CPlatformWindow
 936  * Method:    nativeRevalidateNSWindowShadow
 937  * Signature: (J)V
 938  */
 939 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSWindowShadow
 940 (JNIEnv *env, jclass clazz, jlong windowPtr)
 941 {
 942 JNF_COCOA_ENTER(env);
 943 AWT_ASSERT_NOT_APPKIT_THREAD;
 944 
 945     NSWindow *nsWindow = OBJC(windowPtr);



 946     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
 947         AWT_ASSERT_APPKIT_THREAD;
 948 
 949         [nsWindow invalidateShadow];
 950     }];

 951 
 952 JNF_COCOA_EXIT(env);
 953 }
 954 
 955 /*
 956  * Class:     sun_lwawt_macosx_CPlatformWindow
 957  * Method:    nativeScreenOn_AppKitThread
 958  * Signature: (J)I
 959  */
 960 JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeScreenOn_1AppKitThread
 961 (JNIEnv *env, jclass clazz, jlong windowPtr)
 962 {
 963     jint ret = 0;
 964 
 965 JNF_COCOA_ENTER(env);
 966 AWT_ASSERT_APPKIT_THREAD;
 967 
 968     NSWindow *nsWindow = OBJC(windowPtr);
 969     NSDictionary *props = [[nsWindow screen] deviceDescription];
 970     ret = [[props objectForKey:@"NSScreenNumber"] intValue];




 923 JNF_COCOA_ENTER(env);
 924 AWT_ASSERT_NOT_APPKIT_THREAD;
 925 
 926     NSWindow *nsWindow = OBJC(windowPtr);
 927     [nsWindow performSelectorOnMainThread:@selector(setTitle:)
 928                               withObject:JNFJavaToNSString(env, jtitle)
 929                            waitUntilDone:NO];
 930 
 931 JNF_COCOA_EXIT(env);
 932 }
 933 
 934 /*
 935  * Class:     sun_lwawt_macosx_CPlatformWindow
 936  * Method:    nativeRevalidateNSWindowShadow
 937  * Signature: (J)V
 938  */
 939 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSWindowShadow
 940 (JNIEnv *env, jclass clazz, jlong windowPtr)
 941 {
 942 JNF_COCOA_ENTER(env);

 943 
 944     NSWindow *nsWindow = OBJC(windowPtr);
 945     if ([NSThread isMainThread]) {
 946         [nsWindow invalidateShadow];
 947     } else {
 948         [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
 949             AWT_ASSERT_APPKIT_THREAD;
 950 
 951             [nsWindow invalidateShadow];
 952         }];
 953     }
 954 
 955 JNF_COCOA_EXIT(env);
 956 }
 957 
 958 /*
 959  * Class:     sun_lwawt_macosx_CPlatformWindow
 960  * Method:    nativeScreenOn_AppKitThread
 961  * Signature: (J)I
 962  */
 963 JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeScreenOn_1AppKitThread
 964 (JNIEnv *env, jclass clazz, jlong windowPtr)
 965 {
 966     jint ret = 0;
 967 
 968 JNF_COCOA_ENTER(env);
 969 AWT_ASSERT_APPKIT_THREAD;
 970 
 971     NSWindow *nsWindow = OBJC(windowPtr);
 972     NSDictionary *props = [[nsWindow screen] deviceDescription];
 973     ret = [[props objectForKey:@"NSScreenNumber"] intValue];