< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java

Print this page
rev 51957 : add support for full window content view and transparent title bar
rev 51961 : Update

*** 1,7 **** /* ! * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 119,129 **** public static final String WINDOW_DOC_MODAL_SHEET = "apple.awt.documentModalSheet"; public static final String WINDOW_FADE_DELEGATE = "apple.awt._windowFadeDelegate"; public static final String WINDOW_FADE_IN = "apple.awt._windowFadeIn"; public static final String WINDOW_FADE_OUT = "apple.awt._windowFadeOut"; public static final String WINDOW_FULLSCREENABLE = "apple.awt.fullscreenable"; ! // Yeah, I know. But it's easier to deal with ints from JNI static final int MODELESS = 0; static final int DOCUMENT_MODAL = 1; static final int APPLICATION_MODAL = 2; --- 119,130 ---- public static final String WINDOW_DOC_MODAL_SHEET = "apple.awt.documentModalSheet"; public static final String WINDOW_FADE_DELEGATE = "apple.awt._windowFadeDelegate"; public static final String WINDOW_FADE_IN = "apple.awt._windowFadeIn"; public static final String WINDOW_FADE_OUT = "apple.awt._windowFadeOut"; public static final String WINDOW_FULLSCREENABLE = "apple.awt.fullscreenable"; ! public static final String WINDOW_FULL_CONTENT = "apple.awt.fullWindowContent"; ! public static final String WINDOW_TRANSPARENT_TITLE_BAR = "apple.awt.transparentTitleBar"; // Yeah, I know. But it's easier to deal with ints from JNI static final int MODELESS = 0; static final int DOCUMENT_MODAL = 1; static final int APPLICATION_MODAL = 2;
*** 147,169 **** static final int NONACTIVATING = 1 << 24; static final int IS_DIALOG = 1 << 25; static final int IS_MODAL = 1 << 26; static final int IS_POPUP = 1 << 27; ! static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE; // corresponds to method-based properties static final int HAS_SHADOW = 1 << 10; static final int ZOOMABLE = 1 << 11; static final int ALWAYS_ON_TOP = 1 << 15; static final int HIDES_ON_DEACTIVATE = 1 << 17; static final int DRAGGABLE_BACKGROUND = 1 << 19; static final int DOCUMENT_MODIFIED = 1 << 21; static final int FULLSCREENABLE = 1 << 23; ! static final int _METHOD_PROP_BITMASK = RESIZABLE | HAS_SHADOW | ZOOMABLE | ALWAYS_ON_TOP | HIDES_ON_DEACTIVATE | DRAGGABLE_BACKGROUND | DOCUMENT_MODIFIED | FULLSCREENABLE; // corresponds to callback-based properties static final int SHOULD_BECOME_KEY = 1 << 12; static final int SHOULD_BECOME_MAIN = 1 << 13; static final int MODAL_EXCLUDED = 1 << 16; --- 148,176 ---- static final int NONACTIVATING = 1 << 24; static final int IS_DIALOG = 1 << 25; static final int IS_MODAL = 1 << 26; static final int IS_POPUP = 1 << 27; ! static final int FULL_WINDOW_CONTENT = 1 << 14; ! ! static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE ! | MINIMIZABLE | RESIZABLE | FULL_WINDOW_CONTENT; // corresponds to method-based properties static final int HAS_SHADOW = 1 << 10; static final int ZOOMABLE = 1 << 11; static final int ALWAYS_ON_TOP = 1 << 15; static final int HIDES_ON_DEACTIVATE = 1 << 17; static final int DRAGGABLE_BACKGROUND = 1 << 19; static final int DOCUMENT_MODIFIED = 1 << 21; static final int FULLSCREENABLE = 1 << 23; + static final int TRANSPARENT_TITLE_BAR = 1 << 18; ! static final int _METHOD_PROP_BITMASK = RESIZABLE | HAS_SHADOW | ZOOMABLE | ALWAYS_ON_TOP | HIDES_ON_DEACTIVATE ! | DRAGGABLE_BACKGROUND | DOCUMENT_MODIFIED | FULLSCREENABLE ! | TRANSPARENT_TITLE_BAR; // corresponds to callback-based properties static final int SHOULD_BECOME_KEY = 1 << 12; static final int SHOULD_BECOME_MAIN = 1 << 13; static final int MODAL_EXCLUDED = 1 << 16;
*** 228,238 **** return; } final String filename = ((java.io.File)value).getAbsolutePath(); c.execute(ptr->nativeSetNSWindowRepresentedFilename(ptr, filename)); ! }} }) { @SuppressWarnings("deprecation") public CPlatformWindow convertJComponentToTarget(final JRootPane p) { Component root = SwingUtilities.getRoot(p); final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); --- 235,257 ---- return; } final String filename = ((java.io.File)value).getAbsolutePath(); c.execute(ptr->nativeSetNSWindowRepresentedFilename(ptr, filename)); ! }}, ! new Property<CPlatformWindow>(WINDOW_FULL_CONTENT) { ! public void applyProperty(final CPlatformWindow c, final Object value) { ! boolean isFullWindowContent = Boolean.parseBoolean(value.toString()); ! c.setStyleBits(FULL_WINDOW_CONTENT, isFullWindowContent); ! } ! }, ! new Property<CPlatformWindow>(WINDOW_TRANSPARENT_TITLE_BAR) { ! public void applyProperty(final CPlatformWindow c, final Object value) { ! boolean isTransparentTitleBar = Boolean.parseBoolean(value.toString()); ! c.setStyleBits(TRANSPARENT_TITLE_BAR, isTransparentTitleBar); ! } ! } }) { @SuppressWarnings("deprecation") public CPlatformWindow convertJComponentToTarget(final JRootPane p) { Component root = SwingUtilities.getRoot(p); final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
*** 466,475 **** --- 485,504 ---- prop = rootpane.getClientProperty(WINDOW_DRAGGABLE_BACKGROUND); if (prop != null) { styleBits = SET(styleBits, DRAGGABLE_BACKGROUND, Boolean.parseBoolean(prop.toString())); } + + prop = rootpane.getClientProperty(WINDOW_FULL_CONTENT); + if (prop != null) { + styleBits = SET(styleBits, FULL_WINDOW_CONTENT, Boolean.parseBoolean(prop.toString())); + } + + prop = rootpane.getClientProperty(WINDOW_TRANSPARENT_TITLE_BAR); + if (prop != null) { + styleBits = SET(styleBits, TRANSPARENT_TITLE_BAR, Boolean.parseBoolean(prop.toString())); + } } if (isDialog) { styleBits = SET(styleBits, IS_DIALOG, true); if (((Dialog) target).isModal()) {
< prev index next >