diff options
author | Sven Gothel <[email protected]> | 2015-08-11 17:43:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-11 17:43:57 +0200 |
commit | 8df37534138e15061e66e6460391dcdc413b521f (patch) | |
tree | a25bbd355520a83d85a6edb25504a97deef9b2b1 | |
parent | bb4e7c5d3e13d91810a7530d6ffa0a909fdfc233 (diff) |
NEWT WindowImpl + WindowDriver: Remove updateInsetsImpl(Insets insets) and rely solely on insetsChanged(..) (event driven)
Only affected WindowDriver is AWT, which now updates the insets when setVisible(true).
11 files changed, 5 insertions, 64 deletions
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java index 09e318957..819435331 100644 --- a/src/newt/classes/jogamp/newt/OffscreenWindow.java +++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java @@ -147,10 +147,5 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { protected Point getLocationOnScreenImpl(final int x, final int y) { return new Point(x,y); } - - @Override - protected void updateInsetsImpl(final Insets insets) { - // nop .. - } } diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 241192c6c..9a12286fe 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -896,16 +896,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer */ protected abstract Point getLocationOnScreenImpl(int x, int y); - /** - * Triggered by user via {@link #getInsets()}.<br> - * Implementations may implement this hook to update the insets.<br> - * However, they may prefer the event driven path via {@link #insetsChanged(boolean, int, int, int, int)}. - * - * @see #getInsets() - * @see #insetsChanged(boolean, int, int, int, int) - */ - protected abstract void updateInsetsImpl(Insets insets); - protected boolean setPointerVisibleImpl(final boolean pointerVisible) { return false; } protected boolean confinePointerImpl(final boolean confine) { return false; } protected void warpPointerImpl(final int x, final int y) { } @@ -2265,11 +2255,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer @Override public final InsetsImmutable getInsets() { - if(isUndecorated()) { + if( isUndecorated() ) { return Insets.getZero(); + } else { + return insets; } - updateInsetsImpl(insets); - return insets; } @Override diff --git a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java index 83832eeb4..959e75df8 100644 --- a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java @@ -489,11 +489,6 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 { return new Point(x,y); } - @Override - protected final void updateInsetsImpl(final Insets insets) { - // nop .. - } - //---------------------------------------------------------------------- // Virtual On-Screen Keyboard / SoftInput // diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java index edc884366..222ac8ae9 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java @@ -191,12 +191,6 @@ public class WindowDriver extends WindowImpl { return res; } - @Override - protected void updateInsetsImpl(final com.jogamp.nativewindow.util.Insets insets) { - final Insets contInsets = awtContainer.getInsets(); - insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom); - } - private void setCanvasSizeImpl(final int width, final int height) { final Dimension szClient = new Dimension(width, height); final java.awt.Window awtWindow = AWTMisc.getWindow(awtCanvas); @@ -250,6 +244,8 @@ public class WindowDriver extends WindowImpl { if( 0 != ( STATE_MASK_VISIBLE & flags) ) { setCanvasSizeImpl(width, height); awtContainer.setVisible( true ); + final Insets contInsets = awtContainer.getInsets(); + insetsChanged(false, contInsets.left, contInsets.right, contInsets.top, contInsets.bottom); } else { awtContainer.setVisible( false ); } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java index f20f938b6..f95d23364 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java @@ -128,11 +128,6 @@ public class WindowDriver extends jogamp.newt.WindowImpl { } @Override - protected void updateInsetsImpl(final Insets insets) { - // nop .. - } - - @Override public boolean surfaceSwap() { SwapWindow(getDisplayHandle(), getWindowHandle()); return true; 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 34212d012..16b0f2ee9 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 @@ -263,11 +263,6 @@ public class WindowDriver extends WindowImpl { } @Override - protected void updateInsetsImpl(final Insets insets) { - // nop .. - } - - @Override protected final void doMouseEvent(final boolean enqueue, final boolean wait, final short eventType, final int modifiers, final int x, final int y, final short button, final float[] rotationXYZ, final float rotationScale) { if( MouseEvent.EVENT_MOUSE_MOVED == eventType || MouseEvent.EVENT_MOUSE_DRAGGED == eventType ) { diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java index a083f420f..ceda0997b 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java @@ -132,11 +132,6 @@ public class WindowDriver extends jogamp.newt.WindowImpl { return new Point(x,y); } - @Override - protected void updateInsetsImpl(final Insets insets) { - // nop .. - } - //---------------------------------------------------------------------- // Internals only // diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java index 242f644f6..c18eff217 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java @@ -134,11 +134,6 @@ public class WindowDriver extends WindowImpl { return new Point(x,y); } - @Override - protected void updateInsetsImpl(final Insets insets) { - // nop .. - } - //---------------------------------------------------------------------- // Internals only // diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index 0d144775a..e62e0f5aa 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -554,11 +554,6 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl return p; } - @Override - protected void updateInsetsImpl(final Insets insets) { - // nop - using event driven insetsChange(..) - } - /** Callback for native screen position change event of the client area. */ protected void screenPositionChanged(final boolean defer, final int newX, final int newY) { // passed coordinates are in screen position of the client area diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 6f2660358..973b6ec4d 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -279,11 +279,6 @@ public class WindowDriver extends WindowImpl { return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y); } - @Override - protected void updateInsetsImpl(final Insets insets) { - // nop - using event driven insetsChange(..) - } - // // PointerEvent Handling // diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java index d0026deaf..5b6ea45d5 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java @@ -347,11 +347,6 @@ public class WindowDriver extends WindowImpl { } @Override - protected void updateInsetsImpl(final Insets insets) { - // nop - using event driven insetsChange(..) - } - - @Override protected final void doMouseEvent(final boolean enqueue, final boolean wait, short eventType, int modifiers, final int x, final int y, short button, final float[] rotationXYZ, final float rotationScale) { switch(eventType) { |