src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
Print this page
@@ -65,18 +65,20 @@
#define AWT_NS_WINDOW_IMPLEMENTATION \
- (id) initWithDelegate:(AWTWindow *)delegate \
frameRect:(NSRect)contectRect \
styleMask:(NSUInteger)styleMask \
contentView:(NSView *)view \
+ zoomed:(BOOL)zoomed \
{ \
self = [super initWithContentRect:contectRect \
styleMask:styleMask \
backing:NSBackingStoreBuffered \
defer:NO]; \
\
if (self == nil) return nil; \
\
+ if (zoomed) [self zoom:nil]; \
[self setDelegate:delegate]; \
[self setContentView:view]; \
[self setInitialFirstResponder:view]; \
[self setReleasedWhenClosed:NO]; \
[self setPreservesContentDuringLiveResize:YES]; \
@@ -267,10 +269,11 @@
- (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)platformWindow
ownerWindow:owner
styleBits:(jint)bits
frameRect:(NSRect)rect
contentView:(NSView *)view
+ zoomed:(BOOL)zoomed
{
AWT_ASSERT_APPKIT_THREAD;
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:bits];
NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask];
@@ -291,19 +294,21 @@
IS(bits, HIDES_ON_DEACTIVATE))
{
self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self
frameRect:contentRect
styleMask:styleMask
- contentView:view];
+ contentView:view
+ zoomed:NO];
}
else
{
// These windows will appear in the window list in the dock icon menu
self.nsWindow = [[AWTWindow_Normal alloc] initWithDelegate:self
frameRect:contentRect
styleMask:styleMask
- contentView:view];
+ contentView:view
+ zoomed: zoomed];
}
if (self.nsWindow == nil) return nil; // no hope either
[self.nsWindow release]; // the property retains the object already
@@ -781,11 +786,12 @@
* Class: sun_lwawt_macosx_CPlatformWindow
* Method: nativeCreateNSWindow
* Signature: (JJIIII)J
*/
JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWindow
-(JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits, jdouble x, jdouble y, jdouble w, jdouble h)
+(JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits,
+ jdouble x, jdouble y, jdouble w, jdouble h, jboolean zoomed)
{
__block AWTWindow *window = nil;
JNF_COCOA_ENTER(env);
@@ -797,11 +803,12 @@
window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow
ownerWindow:owner
styleBits:styleBits
frameRect:frameRect
- contentView:contentView];
+ contentView:contentView
+ zoomed: zoomed ? YES : NO];
// the window is released is CPlatformWindow.nativeDispose()
if (window) [window.nsWindow retain];
}];