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