aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-12-11 05:23:31 +0100
committerSven Gothel <[email protected]>2013-12-11 05:23:31 +0100
commita00406f289ebaaae8d91e9ccc980829f202421a8 (patch)
tree1545d8a962a317b8de0bd37af39b0e5679b0334c /src/newt/classes/com
parent4fa4a60a8e536ab7270df1d74503dba9a945bb20 (diff)
Bug 922 (1/2): NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via new method variant using hints; Deprecate other reparentWindow(..) variants w/o hints.
NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via new method variant using hints: - Add REPARENT_HINT_FORCE_RECREATION, covering 'old' forceDestroyCreate boolean argument - Add REPARENT_HINT_BECOMES_VISIBLE, Claim window becomes visible after reparenting, which is important for e.g. preserving the GL-states in case window is invisible while reparenting. Deprecate other reparentWindow(..) variants w/o hints. Use only new variant using hints w/o semantical change.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/Window.java25
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java5
2 files changed, 29 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 869b56331..5c3bb7889 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -353,6 +353,11 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
ACTION_NATIVE_CREATION_PENDING;
}
+ /** Reparenting hint (bitfield value): Force destroy and hence {@link ReparentOperation#ACTION_NATIVE_CREATION re-creating} the window. */
+ public static final int REPARENT_HINT_FORCE_RECREATION = 1 << 0;
+ /** Reparenting hint (bitfield value): Claim window becomes visible after reparenting, which is important for e.g. preserving the GL-states in case window is invisible while reparenting. */
+ public static final int REPARENT_HINT_BECOMES_VISIBLE = 1 << 1;
+
/**
* Change this window's parent window.<br>
* <P>
@@ -365,6 +370,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
*
* @return The issued reparent action type (strategy) as defined in Window.ReparentAction
* @see #reparentWindow(NativeWindow, int, int, boolean)
+ * @deprecated Use {@link #reparentWindow(NativeWindow, int, int, int)}
*/
ReparentOperation reparentWindow(NativeWindow newParent);
@@ -382,11 +388,28 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
* @param forceDestroyCreate if true, uses re-creation strategy for reparenting, default is <code>false</code>.
*
* @return The issued reparent action type (strategy) as defined in Window.ReparentAction
- * @see #reparentWindow(NativeWindow)
+ * @deprecated Use {@link #reparentWindow(NativeWindow, int, int, int)}
*/
ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate);
/**
+ * Change this window's parent window.<br>
+ * <P>
+ * In case the old parent is not null and a Window,
+ * this window is removed from it's list of children.<br>
+ * In case the new parent is not null and a Window,
+ * this window is added to it's list of children.<br></P>
+ *
+ * @param newParent The new parent NativeWindow. If null, this Window becomes a top level window.
+ * @param x new top-level position, use -1 for default position.
+ * @param y new top-level position, use -1 for default position.
+ * @param hints May contain hints (bitfield values) like {@link #REPARENT_HINT_FORCE_RECREATION} or {@link #REPARENT_HINT_BECOMES_VISIBLE}.
+ *
+ * @return The issued reparent action type (strategy) as defined in Window.ReparentAction
+ */
+ ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints);
+
+ /**
* Enable or disable fullscreen mode for this window.
* <p>
* Fullscreen mode is established on the {@link #getMainMonitor() main monitor}.
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 52f19f783..208602aa1 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -397,6 +397,11 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
+ public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints) {
+ return window.reparentWindow(newParent, x, y, hints);
+ }
+
+ @Override
public final boolean removeChild(NativeWindow win) {
return window.removeChild(win);
}