diff options
author | Sven Gothel <[email protected]> | 2015-08-31 05:51:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-31 05:51:13 +0200 |
commit | fcbd67ddd4c866b664db2c8b5f292996f277a4ac (patch) | |
tree | 3960ed18c9c664a7b000dfbc60d4a38e00f93e0f /src/newt | |
parent | 5acb70d3d301fe66e4d03037325a91528e4c2c1d (diff) |
Bug 1188: Refine getSupportedStateMask() semantics and minimum requirements (adding STATE_MASK_FULLSCREEN)
Refine getSupportedStateMask():
- always for _after_ native creation, i.e. first visibility
- removed STATE_MASK_AUTOPOSITION
- adding STATE_MASK_FULLSCREEN to minimum requirements
Diffstat (limited to 'src/newt')
8 files changed, 18 insertions, 20 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index cacac9f9b..1d514d548 100644 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -216,6 +216,10 @@ public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSur public static final int STATE_BIT_MAXIMIZED_HORZ = 10; // reconfig-flag /** * Set if window is in <i>fullscreen mode</i>, otherwise cleared. + * <p> + * Usually fullscreen mode implies {@link #STATE_BIT_UNDECORATED}, + * however, an implementation is allowed to ignore this if unavailable. + * </p> * <p>Bit number {@value}.</p> * <p>Defaults to {@code false}.</p> * @see #getStateMask() @@ -359,7 +363,10 @@ public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSur * <i>after</i> native window creation, i.e. first visibility. * </p> * <p> - * Default value is {@link #STATE_MASK_VISIBLE} | {@link #STATE_MASK_FOCUSED}, + * Please note that a window's size shall also be allowed to change, i.e. {@link #setSize(int, int)}. + * </p> + * <p> + * Default value is {@link #STATE_MASK_VISIBLE} | {@link #STATE_MASK_FOCUSED} | {@link #STATE_MASK_FULLSCREEN}, * i.e. the <b>minimum requirement</b> for all implementations. * </p> * <p> @@ -367,20 +374,19 @@ public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSur * i.e. it is assumed all features are supported. * </p> * <p> - * Semantic of the supported state-mask bits: + * Semantic of the supported state-mask bits (after native creation, i.e. 1st visibility): * <ul> - * <li>{@link #STATE_MASK_VISIBLE}: {@link #setVisible(boolean) Visibility} can be toggled after creation. <b>Minimum requirement</b>.</li> - * <li>{@link #STATE_MASK_AUTOPOSITION}: {@code WindowManager autoposition} is supported.</li> + * <li>{@link #STATE_MASK_VISIBLE}: {@link #setVisible(boolean) Visibility} can be toggled. <b>Minimum requirement</b>.</li> * <li>{@link #STATE_MASK_CHILDWIN}: {@link #reparentWindow(NativeWindow, int, int, int) Native window parenting} is supported.</li> * <li>{@link #STATE_MASK_FOCUSED}: Window {@link #requestFocus() focus management} is supported. <b>Minimum requirement</b>.</li> - * <li>{@link #STATE_MASK_UNDECORATED}: {@link #setUndecorated(boolean) Window decoration} can be toggled after creation.</li> + * <li>{@link #STATE_MASK_UNDECORATED}: {@link #setUndecorated(boolean) Window decoration} can be toggled.</li> * <li>{@link #STATE_MASK_ALWAYSONTOP}: Window can be set {@link #setAlwaysOnTop(boolean) always-on-top}. </li> * <li>{@link #STATE_MASK_ALWAYSONBOTTOM}: Window can be set {@link #setAlwaysOnBottom(boolean) always-on-bottom}. </li> * <li>{@link #STATE_MASK_STICKY}: Window can be set {@link #setSticky(boolean) sticky}.</li> - * <li>{@link #STATE_MASK_RESIZABLE}: Window {@link #setResizable(boolean) resizability} can be disabled and toggled.</li> + * <li>{@link #STATE_MASK_RESIZABLE}: Window {@link #setResizable(boolean) resizability} can be toggled.</li> * <li>{@link #STATE_MASK_MAXIMIZED_VERT}: Window can be {@link #setMaximized(boolean, boolean) maximized-vertically}. </li> * <li>{@link #STATE_MASK_MAXIMIZED_HORZ}: Window can be {@link #setMaximized(boolean, boolean) maximized-horizontally}. </li> - * <li>{@link #STATE_MASK_FULLSCREEN}: Window {@link #setFullscreen(boolean) fullscreen} can be toggled after creation. </li> + * <li>{@link #STATE_MASK_FULLSCREEN}: Window {@link #setFullscreen(boolean) fullscreen} can be toggled. </li> * <li>{@link #STATE_MASK_POINTERVISIBLE}: Window {@link #setPointerVisible(boolean) pointer visibility} can be toggled. </li> * <li>{@link #STATE_MASK_POINTERCONFINED}: Window {@link #confinePointer(boolean) pointer can be confined}. </li> * </ul> @@ -739,7 +745,6 @@ public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSur boolean isSticky(); /** - * <p>Operation is ignored in {@link #isFullscreen() fullscreen mode}.</p> * <p>Operation is ignored if this instance {@link #isChildWindow() is a child window}.</p> * @see {@link #STATE_BIT_MAXIMIZED_HORZ} * @see {@link #STATE_BIT_MAXIMIZED_VERT} diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java index 8b99541b3..f4b8ecd42 100644 --- a/src/newt/classes/jogamp/newt/OffscreenWindow.java +++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java @@ -117,8 +117,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { @Override protected final int getSupportedReconfigMaskImpl() { - return minimumReconfigStateMask | - STATE_MASK_FULLSCREEN; // due to size change + return minimumReconfigStateMask; } @Override diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 1f91a759c..21105ba51 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -254,8 +254,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer /* pp */ final Bitfield stateMask = Bitfield.Factory.synchronize(Bitfield.Factory.create(32)); /** Default is all but {@link #STATE_MASK_FULLSCREEN_SPAN}. */ protected int supportedReconfigStateMask = 0; - /** See {@link #getSupportedStateMask()}, i.e. {@link #STATE_MASK_VISIBLE} | {@link #STATE_MASK_FOCUSED}. */ - protected static final int minimumReconfigStateMask = STATE_MASK_VISIBLE | STATE_MASK_FOCUSED; + /** See {@link #getSupportedStateMask()}, i.e. {@link #STATE_MASK_VISIBLE} | {@link #STATE_MASK_FOCUSED} | {@link STATE_MASK_FULLSCREEN}. */ + protected static final int minimumReconfigStateMask = STATE_MASK_VISIBLE | STATE_MASK_FOCUSED | STATE_MASK_FULLSCREEN; /* pp */ final void resetStateMask() { stateMask.clearField(false); diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java index 315a41b1f..b0a4ee34a 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java @@ -257,7 +257,6 @@ public class WindowDriver extends WindowImpl { // STATE_MASK_RESIZABLE | // STATE_MASK_MAXIMIZED_VERT | // STATE_MASK_MAXIMIZED_HORZ | - STATE_MASK_FULLSCREEN | // due to size change STATE_MASK_POINTERVISIBLE | STATE_MASK_POINTERCONFINED; } diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java index 4319bedc1..ce5d208db 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java @@ -96,8 +96,7 @@ public class WindowDriver extends WindowImpl { @Override protected final int getSupportedReconfigMaskImpl() { - return minimumReconfigStateMask | - STATE_MASK_FULLSCREEN; + return minimumReconfigStateMask; } @Override diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index 5f90b29f4..a38ba4c13 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -392,7 +392,6 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl @Override protected final int getSupportedReconfigMaskImpl() { return minimumReconfigStateMask | - STATE_MASK_AUTOPOSITION | STATE_MASK_CHILDWIN | STATE_MASK_UNDECORATED | STATE_MASK_ALWAYSONTOP | @@ -401,7 +400,6 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl STATE_MASK_RESIZABLE | STATE_MASK_MAXIMIZED_VERT | STATE_MASK_MAXIMIZED_HORZ | - STATE_MASK_FULLSCREEN | STATE_MASK_POINTERVISIBLE | STATE_MASK_POINTERCONFINED; } diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 70a8ec558..c1aa4cb90 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -202,7 +202,6 @@ public class WindowDriver extends WindowImpl { @Override protected final int getSupportedReconfigMaskImpl() { return minimumReconfigStateMask | - STATE_MASK_AUTOPOSITION | STATE_MASK_CHILDWIN | STATE_MASK_UNDECORATED | STATE_MASK_ALWAYSONTOP | @@ -211,7 +210,6 @@ public class WindowDriver extends WindowImpl { STATE_MASK_RESIZABLE | STATE_MASK_MAXIMIZED_VERT | STATE_MASK_MAXIMIZED_HORZ | - STATE_MASK_FULLSCREEN | STATE_MASK_POINTERVISIBLE | STATE_MASK_POINTERCONFINED; } diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java index 5749f0dc3..9e1d2869b 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java @@ -170,7 +170,7 @@ public class WindowDriver extends WindowImpl { @Override protected final int getSupportedReconfigMaskImpl() { - return GetSupportedReconfigMask0(javaWindowHandle) & STATE_MASK_ALL_RECONFIG; + return ( minimumReconfigStateMask | GetSupportedReconfigMask0(javaWindowHandle) ) & STATE_MASK_ALL_RECONFIG; } @Override |