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

Print this page




 380  * Class:     sun_lwawt_macosx_CWrapper$NSWindow
 381  * Method:    setBackgroundColor
 382  * Signature: (J)V
 383  */
 384 JNIEXPORT void JNICALL
 385 Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setBackgroundColor
 386 (JNIEnv *env, jclass cls, jlong windowPtr, jlong colorPtr)
 387 {
 388 JNF_COCOA_ENTER(env);
 389 
 390     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
 391     NSColor *color = (NSColor *)jlong_to_ptr(colorPtr);
 392     [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 393         [window setBackgroundColor:color];
 394     }];
 395 
 396 JNF_COCOA_EXIT(env);
 397 }
 398 
 399 /*
 400  * Class:     sun_lwawt_macosx_CWrapper$NSWindow
 401  * Method:    screen
 402  * Signature: (J)J
 403  */
 404 JNIEXPORT jlong JNICALL
 405 Java_sun_lwawt_macosx_CWrapper_00024NSWindow_screen
 406 (JNIEnv *env, jclass cls, jlong windowPtr)
 407 {
 408     __block jlong screenPtr = 0L;
 409 
 410 JNF_COCOA_ENTER(env);
 411 
 412     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
 413     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 414         const NSScreen *screen = [window screen];
 415         CFRetain(screen); // GC
 416         screenPtr = ptr_to_jlong(screen);
 417     }];
 418 
 419 JNF_COCOA_EXIT(env);
 420 
 421     return screenPtr;
 422 }
 423 
 424 /*
 425  * Method:    miniaturize
 426  * Signature: (J)V
 427  */
 428 JNIEXPORT void JNICALL
 429 Java_sun_lwawt_macosx_CWrapper_00024NSWindow_miniaturize
 430 (JNIEnv *env, jclass cls, jlong windowPtr)
 431 {
 432 JNF_COCOA_ENTER(env);
 433 
 434     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
 435     [ThreadUtilities performOnMainThread:@selector(miniaturize:)
 436                                       on:window
 437                               withObject:nil
 438                            waitUntilDone:NO];
 439 
 440 JNF_COCOA_EXIT(env);
 441 }
 442 
 443 /*
 444  * Class:     sun_lwawt_macosx_CWrapper$NSWindow




 380  * Class:     sun_lwawt_macosx_CWrapper$NSWindow
 381  * Method:    setBackgroundColor
 382  * Signature: (J)V
 383  */
 384 JNIEXPORT void JNICALL
 385 Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setBackgroundColor
 386 (JNIEnv *env, jclass cls, jlong windowPtr, jlong colorPtr)
 387 {
 388 JNF_COCOA_ENTER(env);
 389 
 390     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
 391     NSColor *color = (NSColor *)jlong_to_ptr(colorPtr);
 392     [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 393         [window setBackgroundColor:color];
 394     }];
 395 
 396 JNF_COCOA_EXIT(env);
 397 }
 398 
 399 /*

























 400  * Method:    miniaturize
 401  * Signature: (J)V
 402  */
 403 JNIEXPORT void JNICALL
 404 Java_sun_lwawt_macosx_CWrapper_00024NSWindow_miniaturize
 405 (JNIEnv *env, jclass cls, jlong windowPtr)
 406 {
 407 JNF_COCOA_ENTER(env);
 408 
 409     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
 410     [ThreadUtilities performOnMainThread:@selector(miniaturize:)
 411                                       on:window
 412                               withObject:nil
 413                            waitUntilDone:NO];
 414 
 415 JNF_COCOA_EXIT(env);
 416 }
 417 
 418 /*
 419  * Class:     sun_lwawt_macosx_CWrapper$NSWindow