< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m

Print this page




 937     if (IS(self.styleBits, ZOOMABLE)) {
 938         [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled: flag];
 939     }
 940 
 941     if (IS(self.styleBits, RESIZABLE)) {
 942         [self updateMinMaxSize:flag];
 943         [self.nsWindow setShowsResizeIndicator:flag];
 944     }
 945 }
 946 
 947 + (void) setLastKeyWindow:(AWTWindow *)window {
 948     [window retain];
 949     [lastKeyWindow release];
 950     lastKeyWindow = window;
 951 }
 952 
 953 + (AWTWindow *) lastKeyWindow {
 954     return lastKeyWindow;
 955 }
 956 
 957 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame {
 958     return !NSEqualSizes(self.nsWindow.frame.size, newFrame.size);
 959 }
 960 
 961 
 962 @end // AWTWindow
 963 
 964 
 965 /*
 966  * Class:     sun_lwawt_macosx_CPlatformWindow
 967  * Method:    nativeCreateNSWindow
 968  * Signature: (JJIIII)J
 969  */
 970 JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWindow
 971 (JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits, jdouble x, jdouble y, jdouble w, jdouble h)
 972 {
 973     __block AWTWindow *window = nil;
 974 
 975 JNF_COCOA_ENTER(env);
 976 
 977     JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env];
 978     NSView *contentView = OBJC(contentViewPtr);
 979     NSRect frameRect = NSMakeRect(x, y, w, h);
 980     AWTWindow *owner = [OBJC(ownerPtr) delegate];
 981     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){




 937     if (IS(self.styleBits, ZOOMABLE)) {
 938         [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled: flag];
 939     }
 940 
 941     if (IS(self.styleBits, RESIZABLE)) {
 942         [self updateMinMaxSize:flag];
 943         [self.nsWindow setShowsResizeIndicator:flag];
 944     }
 945 }
 946 
 947 + (void) setLastKeyWindow:(AWTWindow *)window {
 948     [window retain];
 949     [lastKeyWindow release];
 950     lastKeyWindow = window;
 951 }
 952 
 953 + (AWTWindow *) lastKeyWindow {
 954     return lastKeyWindow;
 955 }
 956 





 957 @end // AWTWindow
 958 
 959 
 960 /*
 961  * Class:     sun_lwawt_macosx_CPlatformWindow
 962  * Method:    nativeCreateNSWindow
 963  * Signature: (JJIIII)J
 964  */
 965 JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWindow
 966 (JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits, jdouble x, jdouble y, jdouble w, jdouble h)
 967 {
 968     __block AWTWindow *window = nil;
 969 
 970 JNF_COCOA_ENTER(env);
 971 
 972     JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env];
 973     NSView *contentView = OBJC(contentViewPtr);
 974     NSRect frameRect = NSMakeRect(x, y, w, h);
 975     AWTWindow *owner = [OBJC(ownerPtr) delegate];
 976     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){


< prev index next >