From d149c554b453c86a880a4f0595bb8e340c80d041 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 27 May 2014 00:05:17 +0200 Subject: Bug 741 HiDPI: [Core API Change] Bring back get[Width|Height]() in NativeWindow, i.e. getWindow[Width|Height]() -> get[Width|Height]() We have distinguished pixel- and window units in commit f9a00b91dcd146c72a50237b62270f33bd0da98e and introduced NativeWindow.getWindow[Width|Height]() and NativeSurface.getSurface[Width|Height](). To have a unique naming scheme, we could rename all method using 'Window', but for simplicity and since there will be no 'semantic override' just use the simple version. --- .../UpstreamWindowHookMutableSizePos.java | 4 +- .../com/jogamp/nativewindow/awt/JAWTWindow.java | 10 +-- .../javax/media/nativewindow/NativeSurface.java | 4 +- .../javax/media/nativewindow/NativeWindow.java | 10 +-- .../classes/jogamp/nativewindow/WrappedWindow.java | 8 +-- .../nativewindow/jawt/macosx/MacOSXJAWTWindow.java | 4 +- src/newt/classes/com/jogamp/newt/NewtFactory.java | 2 +- .../classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 2 +- .../classes/com/jogamp/newt/opengl/GLWindow.java | 8 +-- .../classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 4 +- .../newt/util/applet/JOGLNewtApplet3Run.java | 2 +- src/newt/classes/jogamp/newt/WindowImpl.java | 76 +++++++++++----------- .../newt/awt/event/AWTParentWindowAdapter.java | 2 +- .../newt/driver/android/NewtBaseActivity.java | 4 +- .../jogamp/newt/driver/android/WindowDriver.java | 10 +-- .../jogamp/newt/driver/awt/WindowDriver.java | 2 +- .../jogamp/newt/driver/bcm/egl/WindowDriver.java | 4 +- .../jogamp/newt/driver/bcm/vc/iv/WindowDriver.java | 2 +- .../jogamp/newt/driver/kd/WindowDriver.java | 6 +- .../jogamp/newt/driver/macosx/WindowDriver.java | 8 +-- .../jogamp/newt/driver/windows/WindowDriver.java | 2 +- .../jogamp/newt/driver/x11/WindowDriver.java | 4 +- .../opengl/test/junit/newt/TestWindows01NEWT.java | 8 +-- .../test/junit/newt/mm/TestScreenMode01dNEWT.java | 8 +-- .../junit/newt/parenting/TestParenting02NEWT.java | 8 +-- .../opengl/test/junit/util/AWTRobotUtil.java | 4 +- 26 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java index 2e9a33801..5f9720a0e 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java @@ -40,10 +40,10 @@ public class UpstreamWindowHookMutableSizePos extends UpstreamSurfaceHookMutable public final int getY() { return winY; } - public final int getWindowWidth() { + public final int getWidth() { return winWidth; } - public final int getWindowHeight() { + public final int getHeight() { return winHeight; } diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index d4f058201..ea6ec893e 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -625,12 +625,12 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, @Override public final int getSurfaceWidth() { - return getWindowWidth() * getPixelScale(); + return getWidth() * getPixelScale(); } @Override public final int getSurfaceHeight() { - return getWindowHeight() * getPixelScale(); + return getHeight() * getPixelScale(); } // @@ -638,12 +638,12 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, // @Override - public final int getWindowWidth() { + public final int getWidth() { return component.getWidth(); } @Override - public final int getWindowHeight() { + public final int getHeight() { return component.getHeight(); } @@ -826,7 +826,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, ", surfaceHandle "+toHexString(getSurfaceHandle())+ ", bounds "+bounds+", insets "+insets ); - sb.append(", window ["+getX()+"/"+getY()+" "+getWindowWidth()+"x"+getWindowHeight()+ + sb.append(", window ["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+ "], pixels[x"+getPixelScale()+" -> "+getSurfaceWidth()+"x"+getSurfaceHeight()+"]"+ ", visible "+component.isVisible()); sb.append(", lockedExt "+isSurfaceLockedByOtherThread()+ diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java index 8131ee283..733f12d49 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java @@ -180,7 +180,7 @@ public interface NativeSurface extends SurfaceUpdatedListener { /** * Returns the width of the client area excluding insets (window decorations) in pixel units. * @return width of the client area in pixel units - * @see NativeWindow#getWindowWidth() + * @see NativeWindow#getWidth() * @see #convertToWindowUnits(int[]) */ public int getSurfaceWidth(); @@ -188,7 +188,7 @@ public interface NativeSurface extends SurfaceUpdatedListener { /** * Returns the height of the client area excluding insets (window decorations) in pixel units. * @return height of the client area in pixel units - * @see NativeWindow#getWindowHeight() + * @see NativeWindow#getHeight() * @see #convertToWindowUnits(int[]) */ public int getSurfaceHeight(); diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java index 63a643f3c..5e5f99aac 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java @@ -46,7 +46,7 @@ import javax.media.nativewindow.util.Point; /** * Extend the {@link NativeSurface} interface with windowing * information such as {@link #getWindowHandle() window-handle}, - * {@link #getWindowWidth() window-size} and {@link #getX() window-position}. + * {@link #getWidth() window-size} and {@link #getX() window-position}. *

* All values of this interface are represented in window units, if not stated otherwise. * See {@link NativeSurface}. @@ -110,8 +110,8 @@ public interface NativeWindow extends NativeSurface { * * The top-level window size is *

-   *   {@link #getWindowWidth()}  + getInsets().{@link InsetsImmutable#getTotalWidth() getTotalWidth()}
-   *   {@link #getWindowHeight()} + getInsets().{@link InsetsImmutable#getTotalHeight() getTotalHeight()}
+   *   {@link #getWidth()}  + getInsets().{@link InsetsImmutable#getTotalWidth() getTotalWidth()}
+   *   {@link #getHeight()} + getInsets().{@link InsetsImmutable#getTotalHeight() getTotalHeight()}
    * 
* * @return insets @@ -159,14 +159,14 @@ public interface NativeWindow extends NativeSurface { * @return width of the client area in window units * @see NativeSurface#getSurfaceWidth() */ - public int getWindowWidth(); + public int getWidth(); /** * Returns the height of the client area excluding insets (window decorations) in window units. * @return height of the client area in window units * @see NativeSurface#getSurfaceHeight() */ - public int getWindowHeight(); + public int getHeight(); /** * Returns the window's top-left client-area position in the screen. diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java index 3cbfcd4d9..b93cbe7f5 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java @@ -91,13 +91,13 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow { } @Override - public int getWindowWidth() { - return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getWindowWidth(); + public int getWidth() { + return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getWidth(); } @Override - public int getWindowHeight() { - return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getWindowHeight(); + public int getHeight() { + return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getHeight(); } @Override diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index 58dc7e47e..3b91fc8ab 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -143,7 +143,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { } else if( DEBUG ) { System.err.println("JAWTWindow.attachSurfaceLayerImpl: "+toHexString(layerHandle) + ", [ins "+outterInsets+"], p0 "+p0+" -> "+p1+", bounds "+bounds); } - OSXUtil.AddCASublayer(rootSurfaceLayer, layerHandle, p1.getX(), p1.getY(), getWindowWidth(), getWindowHeight(), getPixelScale(), JAWTUtil.getOSXCALayerQuirks()); + OSXUtil.AddCASublayer(rootSurfaceLayer, layerHandle, p1.getX(), p1.getY(), getWidth(), getHeight(), getPixelScale(), JAWTUtil.getOSXCALayerQuirks()); } } ); } @@ -177,7 +177,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { System.err.println("JAWTWindow.layoutSurfaceLayerImpl: "+toHexString(layerHandle) + ", quirks "+caLayerQuirks+", visible "+visible+ ", [ins "+outterInsets+"], p0 "+p0+" -> "+p1+", bounds "+bounds); } - OSXUtil.FixCALayerLayout(rootSurfaceLayer, layerHandle, visible, p1.getX(), p1.getY(), getWindowWidth(), getWindowHeight(), caLayerQuirks); + OSXUtil.FixCALayerLayout(rootSurfaceLayer, layerHandle, visible, p1.getX(), p1.getY(), getWidth(), getHeight(), caLayerQuirks); } @Override diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index 4443c70c9..9685200eb 100644 --- a/src/newt/classes/com/jogamp/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -296,7 +296,7 @@ public class NewtFactory { } final Window win = WindowImpl.create(parentWindow, 0, screen, caps); - win.setSize(parentWindow.getWindowWidth(), parentWindow.getWindowHeight()); + win.setSize(parentWindow.getWidth(), parentWindow.getHeight()); if ( null != newtParentWindow ) { newtParentWindow.addChild(win); win.setVisible(newtParentWindow.isVisible()); diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 0d70b5f8c..f6b2bab1f 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -400,7 +400,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto final Window w = newtChild; if( null != w ) { // use NEWT child's size for min/pref size! - java.awt.Dimension minSize = new java.awt.Dimension(w.getWindowWidth(), w.getWindowHeight()); + java.awt.Dimension minSize = new java.awt.Dimension(w.getWidth(), w.getHeight()); setMinimumSize(minSize); setPreferredSize(minSize); } diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index ecd50aa5f..a61085fb0 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -354,13 +354,13 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind } @Override - public final int getWindowWidth() { - return window.getWindowWidth(); + public final int getWidth() { + return window.getWidth(); } @Override - public final int getWindowHeight() { - return window.getWindowHeight(); + public final int getHeight() { + return window.getHeight(); } @Override diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java index 51a7984b4..93ecc8bb2 100644 --- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java +++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java @@ -518,12 +518,12 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol { } @Override - public int getWindowWidth() { + public int getWidth() { return getSurfaceWidth(); // FIXME: Use 'scale' or an actual window-width } @Override - public int getWindowHeight() { + public int getHeight() { return getSurfaceHeight(); // FIXME: Use 'scale' or an actual window-width } diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java index 7b6a1c8cd..459db11b2 100644 --- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java +++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java @@ -172,7 +172,7 @@ public class JOGLNewtApplet3Run implements Applet3 { glWindow = GLWindow.create(w); glWindow.setUndecorated(glUndecorated); glWindow.setAlwaysOnTop(glAlwaysOnTop); - glWindow.setSize(browserWin.getWindowWidth(), browserWin.getWindowHeight()); + glWindow.setSize(browserWin.getWidth(), browserWin.getHeight()); return new NativeWindowDownstream() { @Override diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 5f901ce10..2411f6595 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -948,7 +948,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } } if(!isNativeValid() && visible) { - if( 0 "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow)); + System.err.println("Window setVisible: START ("+getThreadName()+") "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow)); } runOnEDTIfAvail(wait, new VisibleAction(visible)); } @@ -1032,9 +1032,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer final RecursiveLock _lock = windowLock; _lock.lock(); try { - if ( force || ( !isFullscreen() && ( getWindowWidth() != width || getWindowHeight() != height ) ) ) { + if ( force || ( !isFullscreen() && ( getWidth() != width || getHeight() != height ) ) ) { if(DEBUG_IMPLEMENTATION) { - System.err.println("Window setSize: START force "+force+", "+getWindowWidth()+"x"+getWindowHeight()+" -> "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible "+visible); + System.err.println("Window setSize: START force "+force+", "+getWidth()+"x"+getHeight()+" -> "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible "+visible); } int visibleAction; // 0 nop, 1 invisible, 2 visible (create) if ( visible && isNativeValid() && ( 0 >= width || 0 >= height ) ) { @@ -1054,7 +1054,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer defineSize(width, height); } if(DEBUG_IMPLEMENTATION) { - System.err.println("Window setSize: END "+getWindowWidth()+"x"+getWindowHeight()+", visibleAction "+visibleAction); + System.err.println("Window setSize: END "+getWidth()+"x"+getHeight()+", visibleAction "+visibleAction); } switch(visibleAction) { case 1: setVisibleActionImpl(false); break; @@ -1261,8 +1261,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // mirror pos/size so native change notification can get overwritten final int oldX = getX(); final int oldY = getY(); - final int oldWidth = getWindowWidth(); - final int oldHeight = getWindowHeight(); + final int oldWidth = getWidth(); + final int oldHeight = getHeight(); final int x, y; int width = oldWidth; int height = oldHeight; @@ -1313,11 +1313,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer y = 0; // refit if size is bigger than parent - if( width > newParentWindow.getWindowWidth() ) { - width = newParentWindow.getWindowWidth(); + if( width > newParentWindow.getWidth() ) { + width = newParentWindow.getWidth(); } - if( height > newParentWindow.getWindowHeight() ) { - height = newParentWindow.getWindowHeight(); + if( height > newParentWindow.getHeight() ) { + height = newParentWindow.getHeight(); } // Case: Child Window @@ -1527,7 +1527,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+ ", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+ ", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+ - getX()+"/"+getY()+" "+getWindowWidth()+"x"+getWindowHeight()); + getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()); } } finally { if(null!=lifecycleHook) { @@ -1554,7 +1554,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer System.err.println("Window.reparent: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+ ", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+ ", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+ - getX()+"/"+getY()+" "+getWindowWidth()+"x"+getWindowHeight()); + getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()); } } } @@ -1631,8 +1631,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // Mirror pos/size so native change notification can get overwritten final int x = getX(); final int y = getY(); - final int width = getWindowWidth(); - final int height = getWindowHeight(); + final int width = getWidth(); + final int height = getHeight(); DisplayImpl display = (DisplayImpl) screen.getDisplay(); display.dispatchMessagesNative(); // status up2date @@ -1677,8 +1677,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // Mirror pos/size so native change notification can get overwritten final int x = getX(); final int y = getY(); - final int width = getWindowWidth(); - final int height = getWindowHeight(); + final int width = getWidth(); + final int height = getHeight(); DisplayImpl display = (DisplayImpl) screen.getDisplay(); display.dispatchMessagesNative(); // status up2date @@ -1887,12 +1887,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } @Override - public final int getWindowWidth() { + public final int getWidth() { return winWidth; } @Override - public final int getWindowHeight() { + public final int getHeight() { return winHeight; } @@ -2050,7 +2050,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer ",\n ParentWindowHandle "+toHexString(parentWindowHandle)+" ("+(0!=getParentWindowHandle())+")"+ ",\n WindowHandle "+toHexString(getWindowHandle())+ ",\n SurfaceHandle "+toHexString(getSurfaceHandle())+ " (lockedExt window "+windowLock.isLockedByOtherThread()+", surface "+isSurfaceLockedByOtherThread()+")"+ - ",\n window["+getX()+"/"+getY()+" (auto "+autoPosition()+") "+getWindowWidth()+"x"+getWindowHeight()+"], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+ + ",\n window["+getX()+"/"+getY()+" (auto "+autoPosition()+") "+getWidth()+"x"+getHeight()+"], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+ "],\n Visible "+isVisible()+", focus "+hasFocus()+ ",\n Undecorated "+undecorated+" ("+isUndecorated()+")"+ ",\n AlwaysOnTop "+alwaysOnTop+", Fullscreen "+fullscreen+ @@ -2196,7 +2196,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer if ( !isFullscreen() && ( getX() != x || getY() != y || null != getParent()) ) { if(isNativeValid()) { // this.x/this.y will be set by sizeChanged, triggered by windowing event system - reconfigureWindowImpl(x, y, getWindowWidth(), getWindowHeight(), getReconfigureFlags(0, isVisible())); + reconfigureWindowImpl(x, y, getWidth(), getHeight(), getReconfigureFlags(0, isVisible())); if( null == parentWindow ) { // Wait until custom position is reached within tolerances waitForPosition(true, x, y, Window.TIMEOUT_NATIVEWINDOW); @@ -2244,8 +2244,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer try { final int oldX = getX(); final int oldY = getY(); - final int oldWidth = getWindowWidth(); - final int oldHeight = getWindowHeight(); + final int oldWidth = getWidth(); + final int oldHeight = getHeight(); int x,y,w,h; @@ -2302,11 +2302,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer y = 0; // refit if size is bigger than parent - if( w > parentWindow.getWindowWidth() ) { - w = parentWindow.getWindowWidth(); + if( w > parentWindow.getWidth() ) { + w = parentWindow.getWidth(); } - if( h > parentWindow.getWindowHeight() ) { - h = parentWindow.getWindowHeight(); + if( h > parentWindow.getHeight() ) { + h = parentWindow.getHeight(); } } } @@ -2495,10 +2495,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // Simply move/resize window to fit in virtual screen if required final RectangleImmutable viewport = screen.getViewportInWindowUnits(); if( viewport.getWidth() > 0 && viewport.getHeight() > 0 ) { // failsafe - final RectangleImmutable rect = new Rectangle(getX(), getY(), getWindowWidth(), getWindowHeight()); + final RectangleImmutable rect = new Rectangle(getX(), getY(), getWidth(), getHeight()); final RectangleImmutable isect = viewport.intersection(rect); - if ( getWindowHeight() > isect.getHeight() || - getWindowWidth() > isect.getWidth() ) { + if ( getHeight() > isect.getHeight() || + getWidth() > isect.getWidth() ) { if(DEBUG_IMPLEMENTATION) { System.err.println("Window.monitorModeChanged.1: Non-FS - Fit window "+rect+" into screen viewport "+viewport+ ", due to minimal intersection "+isect); @@ -3052,7 +3052,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer int y = pe.getY(); if(DEBUG_MOUSE_EVENT) { - System.err.println("consumePointerEvent.in: "+pe+", "+pState0+", pos "+x+"/"+y+", win["+getX()+"/"+getY()+" "+getWindowWidth()+"x"+getWindowHeight()+ + System.err.println("consumePointerEvent.in: "+pe+", "+pState0+", pos "+x+"/"+y+", win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+ "], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"]"); } @@ -3620,7 +3620,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer protected void consumeWindowEvent(WindowEvent e) { if(DEBUG_IMPLEMENTATION) { - System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+", win["+getX()+"/"+getY()+" "+getWindowWidth()+"x"+getWindowHeight()+ + System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+", win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+ "], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"]"); } for(int i = 0; !e.isConsumed() && i < windowListeners.size(); i++ ) { @@ -3713,10 +3713,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer /** Triggered by implementation's WM events to update the client-area size in window units w/o insets/decorations. */ protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) { - if(force || getWindowWidth() != newWidth || getWindowHeight() != newHeight) { + if(force || getWidth() != newWidth || getHeight() != newHeight) { if(DEBUG_IMPLEMENTATION) { System.err.println("Window.sizeChanged: ("+getThreadName()+"): (defer: "+defer+") force "+force+", "+ - getWindowWidth()+"x"+getWindowHeight()+" -> "+newWidth+"x"+newHeight+ + getWidth()+"x"+getHeight()+" -> "+newWidth+"x"+newHeight+ " - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)); } if(0>newWidth || 0>newHeight) { @@ -3737,12 +3737,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer final DisplayImpl display = (DisplayImpl) screen.getDisplay(); display.dispatchMessagesNative(); // status up2date long sleep; - for(sleep = timeOut; 0= sleep) { - final String msg = "Size/Pos not reached as requested within "+timeOut+"ms : requested "+w+"x"+h+", is "+getWindowWidth()+"x"+getWindowHeight(); + final String msg = "Size/Pos not reached as requested within "+timeOut+"ms : requested "+w+"x"+h+", is "+getWidth()+"x"+getHeight(); if(failFast) { throw new NativeWindowException(msg); } else if (DEBUG_IMPLEMENTATION) { diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java index 26faa4550..770502326 100644 --- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java +++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java @@ -124,7 +124,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt final int cw = comp.getWidth(); final int ch = comp.getHeight(); if( 0 < cw && 0 < ch ) { - if( newtChild.getWindowWidth() != cw || newtChild.getWindowHeight() != ch ) { + if( newtChild.getWidth() != cw || newtChild.getHeight() != ch ) { newtChild.setSize(cw, ch); final boolean v = comp.isShowing(); // compute showing-state throughout hierarchy if(v != newtChild.isVisible()) { diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java index 22294a212..27c570722 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java @@ -228,8 +228,8 @@ public class NewtBaseActivity extends Activity { androidWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } - if(newtWindow.getWindowWidth()>0 && newtWindow.getWindowHeight()>0 && !newtWindow.isFullscreen()) { - androidWindow.setLayout(newtWindow.getWindowWidth(), newtWindow.getWindowHeight()); + if(newtWindow.getWidth()>0 && newtWindow.getHeight()>0 && !newtWindow.isFullscreen()) { + androidWindow.setLayout(newtWindow.getWidth(), newtWindow.getHeight()); } } diff --git a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java index 5671a05e4..db530cb7e 100644 --- a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java @@ -304,7 +304,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 { if(null == androidView) { setupAndroidView( StaticContext.getContext() ); } - viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(getWindowWidth(), getWindowHeight(), Gravity.BOTTOM|Gravity.RIGHT)); + viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(getWidth(), getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); Log.d(MD.TAG, "canCreateNativeImpl: added to static ViewGroup - on thread "+Thread.currentThread().getName()); } }); for(long sleep = TIMEOUT_NATIVEWINDOW; 00)?width:getWindowWidth(), (height>0)?height:getWindowHeight()); + defineSize((width>0)?width:getWidth(), (height>0)?height:getHeight()); } } if(x>=0 || y>=0) { 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 188e5b964..b5e874f65 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 @@ -110,7 +110,7 @@ public class WindowDriver extends WindowImpl { chosenCaps.setBackgroundOpaque(capsRequested.isBackgroundOpaque()); } setGraphicsConfiguration(cfg); - nativeWindowHandle = CreateWindow0(display.getBCMHandle(), layer, getX(), getY(), getWindowWidth(), getWindowHeight(), + nativeWindowHandle = CreateWindow0(display.getBCMHandle(), layer, getX(), getY(), getWidth(), getHeight(), chosenCaps.isBackgroundOpaque(), chosenCaps.getAlphaBits()); if (nativeWindowHandle == 0) { throw new NativeWindowException("Error creating egl window: "+cfg); diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java index 0b909bc08..158e6ab2f 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java @@ -112,8 +112,8 @@ public class WindowDriver extends WindowImpl { } // int _x=(x>=0)?x:this.x; // int _y=(x>=0)?y:this.y; - width=(width>0)?width:getWindowWidth(); - height=(height>0)?height:getWindowHeight(); + width=(width>0)?width:getWidth(); + height=(height>0)?height:getHeight(); if(width>0 || height>0) { setSize0(eglWindowHandle, width, height); } @@ -158,7 +158,7 @@ public class WindowDriver extends WindowImpl { @Override protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) { if(isFullscreen()) { - ((ScreenDriver)getScreen()).sizeChanged(getWindowWidth(), getWindowHeight()); + ((ScreenDriver)getScreen()).sizeChanged(getWidth(), getHeight()); } super.sizeChanged(defer, newWidth, newHeight, force); } diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index bcdd5116f..fe9d4a08e 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -77,9 +77,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( changed ) { pixelScale = newPixelScaleSafe; if( sendEvent ) { - super.sizeChanged(defer, getWindowWidth(), getWindowHeight(), true); + super.sizeChanged(defer, getWidth(), getHeight(), true); } else { - defineSize(getWindowWidth(), getWindowHeight()); + defineSize(getWidth(), getHeight()); } } return changed; @@ -151,7 +151,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); } setGraphicsConfiguration(cfg); - reconfigureWindowImpl(getX(), getY(), getWindowWidth(), getWindowHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY, true)); + reconfigureWindowImpl(getX(), getY(), getWidth(), getHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY, true)); if (0 == getWindowHandle()) { throw new NativeWindowException("Error creating window"); } @@ -317,7 +317,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( 0 != handle && !isOffscreenInstance ) { final NativeWindow parent = getParent(); final boolean useParent = useParent(parent); - if( useParent && ( getWindowWidth() != newWidth || getWindowHeight() != newHeight ) ) { + if( useParent && ( getWidth() != newWidth || getHeight() != newHeight ) ) { final int x=getX(), y=getY(); final Point p0S = getLocationOnScreenImpl(x, y, parent, useParent); if(DEBUG_IMPLEMENTATION) { diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 00f935f86..bda844bb5 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -146,7 +146,7 @@ public class WindowDriver extends WindowImpl { final long _windowHandle = CreateWindow0(DisplayDriver.getHInstance(), display.getWindowClassName(), display.getWindowClassName(), winVer.getMajor(), winVer.getMinor(), getParentWindowHandle(), - getX(), getY(), getWindowWidth(), getWindowHeight(), autoPosition(), flags); + getX(), getY(), getWidth(), getHeight(), autoPosition(), flags); if ( 0 == _windowHandle ) { throw new NativeWindowException("Error creating window"); } diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java index 9538f31a2..0eda37eac 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java @@ -129,7 +129,7 @@ public class WindowDriver extends WindowImpl { setWindowHandle(CreateWindow(getParentWindowHandle(), edtDevice.getHandle(), screen.getIndex(), visualID, display.getJavaObjectAtom(), display.getWindowDeleteAtom(), - getX(), getY(), getWindowWidth(), getWindowHeight(), autoPosition(), flags, + getX(), getY(), getWidth(), getHeight(), autoPosition(), flags, defaultIconDataSize, defaultIconData)); } finally { edtDevice.unlock(); @@ -238,7 +238,7 @@ public class WindowDriver extends WindowImpl { public Object run(long dpy) { reconfigureWindow0( dpy, getScreenIndex(), getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(), - getX(), getY(), getWindowWidth(), getWindowHeight(), flags); + getX(), getY(), getWidth(), getHeight(), flags); return null; } }); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java index 082a900a0..02ea610d8 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java @@ -80,8 +80,8 @@ public class TestWindows01NEWT extends UITestCase { Assert.assertEquals(true,screen.isNativeValid()); Assert.assertEquals(true,window.isVisible()); Assert.assertEquals(true,window.isNativeValid()); - Assert.assertEquals(width, window.getWindowWidth()); - Assert.assertEquals(height, window.getWindowHeight()); + Assert.assertEquals(width, window.getWidth()); + Assert.assertEquals(height, window.getHeight()); /** we don't sync on position - unreliable test Point p0 = window.getLocationOnScreen(null); @@ -152,8 +152,8 @@ public class TestWindows01NEWT extends UITestCase { window.setVisible(true); Assert.assertEquals(true,window.isNativeValid()); Assert.assertEquals(true,window.isVisible()); - Assert.assertEquals(width, window.getWindowWidth()); - Assert.assertEquals(height, window.getWindowHeight()); + Assert.assertEquals(width, window.getWidth()); + Assert.assertEquals(height, window.getHeight()); destroyWindow(window, true); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java index d03306c4f..2f86d120d 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java @@ -163,8 +163,8 @@ public class TestScreenMode01dNEWT extends UITestCase { final MonitorDevice monitor = window.getMainMonitor(); Assert.assertEquals(false, window.isFullscreen()); - Assert.assertEquals(width, window.getWindowWidth()); - Assert.assertEquals(height, window.getWindowHeight()); + Assert.assertEquals(width, window.getWidth()); + Assert.assertEquals(height, window.getHeight()); window.setFullscreen(true); Assert.assertEquals(true, window.isFullscreen()); @@ -175,8 +175,8 @@ public class TestScreenMode01dNEWT extends UITestCase { window.setFullscreen(false); Assert.assertEquals(false, window.isFullscreen()); - Assert.assertEquals(width, window.getWindowWidth()); - Assert.assertEquals(height, window.getWindowHeight()); + Assert.assertEquals(width, window.getWidth()); + Assert.assertEquals(height, window.getHeight()); Thread.sleep(waitTimeShort); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java index a02a0bac7..9f56ecdbf 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java @@ -110,8 +110,8 @@ public class TestParenting02NEWT extends UITestCase { GLWindow glWindow1 = GLWindow.create(window1); Assert.assertNotNull(glWindow1); glWindow1.setSize(width, height); - Assert.assertEquals(width,glWindow1.getWindowWidth()); - Assert.assertEquals(height,glWindow1.getWindowHeight()); + Assert.assertEquals(width,glWindow1.getWidth()); + Assert.assertEquals(height,glWindow1.getHeight()); glWindow1.setTitle("test01NewtOnNewtParentChildDraw - PARENT"); glWindow1.setPosition(x,y); //glWindow1.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo))); @@ -134,7 +134,7 @@ public class TestParenting02NEWT extends UITestCase { //Assert.assertEquals(width/2,glWindow2.getWidth()); //Assert.assertEquals(height/2,glWindow2.getHeight()); glWindow2.setTitle("test01NewtOnNewtParentChildDraw - CHILD"); - glWindow2.setPosition(glWindow1.getWindowWidth()/2, glWindow1.getWindowHeight()/2); + glWindow2.setPosition(glWindow1.getWidth()/2, glWindow1.getHeight()/2); //glWindow2.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo))); //glWindow2.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo))); // glWindow2.addMouseListener(new TraceMouseAdapter()); @@ -163,7 +163,7 @@ public class TestParenting02NEWT extends UITestCase { x += 1; y += 1; // glWindow1.setPosition(x,y); - glWindow2.setPosition(glWindow1.getWindowWidth()/2,glWindow1.getWindowHeight()/2-y); + glWindow2.setPosition(glWindow1.getWidth()/2,glWindow1.getHeight()/2-y); Thread.sleep(step); while( null != ( event = eventFifo.get() ) ) { diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java index a9fc53eec..aa9611c6f 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java @@ -137,9 +137,9 @@ public class AWTRobotUtil { javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null); if( onTitleBarIfWindow ) { javax.media.nativewindow.util.InsetsImmutable insets = win.getInsets(); - p0.translate(win.getWindowWidth()/2, insets.getTopHeight()/2); + p0.translate(win.getWidth()/2, insets.getTopHeight()/2); } else { - p0.translate(win.getWindowWidth()/2, win.getWindowHeight()/2); + p0.translate(win.getWidth()/2, win.getHeight()/2); } return new int[] { p0.getX(), p0.getY() }; } -- cgit v1.2.3