aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-09 20:07:58 +0100
committerSven Gothel <[email protected]>2011-11-09 20:07:58 +0100
commit8f5465396fe429ce6b7ecae808416691271c7867 (patch)
treec66604588e9047efd66add049975139698542b66 /src/nativewindow
parent30445211aab2edbb709dbda9d5b619a0f1a15a51 (diff)
NativeWindow: SurfaceChangeable::setSize() -> surfaceSizeChanged() to avoid conflicts with setSize()
This fixes the NEWT OffscreenWindow conflict w/ setSize() which represents the action of changing the window's size. SurfaceChangeable's surfaceSizeChanged() merily notifies the actual size. JAWTWindow: Remove setSize() since it propagates the surface size upstream only. MacOSXJAWTWindow is not SurfaceChangeable complete (no surfaceSizeChanged).
Diffstat (limited to 'src/nativewindow')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java2
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/SurfaceChangeable.java8
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java4
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java3
5 files changed, 10 insertions, 9 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
index e21c746ad..7380d19b6 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -76,7 +76,7 @@ public abstract class ProxySurface implements NativeSurface {
return height;
}
- public void setSize(int width, int height) {
+ public void surfaceSizeChanged(int width, int height) {
this.width = width;
this.height = height;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/SurfaceChangeable.java b/src/nativewindow/classes/javax/media/nativewindow/SurfaceChangeable.java
index fc32b57b3..956e68e61 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/SurfaceChangeable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/SurfaceChangeable.java
@@ -41,8 +41,14 @@ package javax.media.nativewindow;
public interface SurfaceChangeable {
+ /** Sets the surface handle which is created outside of this implementation */
public void setSurfaceHandle(long surfaceHandle);
- public void setSize(int width, int height);
+
+ /**
+ * The surface's size has been determined or changed.
+ * Implementation shall update the stored surface size with the given ones.
+ */
+ public void surfaceSizeChanged(int width, int height);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index 0460ccb56..c4c33707d 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -34,7 +34,7 @@ import javax.media.nativewindow.ProxySurface;
import javax.media.nativewindow.SurfaceChangeable;
-public class WrappedSurface extends ProxySurface implements SurfaceChangeable {
+public class WrappedSurface extends ProxySurface implements SurfaceChangeable {
protected long surfaceHandle;
public WrappedSurface(AbstractGraphicsConfiguration cfg) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
index 151099f26..c8ce13b40 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
@@ -235,10 +235,6 @@ public abstract class JAWTWindow implements NativeWindow {
return config.getScreen().getIndex();
}
- public final void setSize(int width, int height) {
- component.setSize(width, height);
- }
-
public final int getWidth() {
return component.getWidth();
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index 5ac42e21b..ec070e404 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -47,7 +47,6 @@ import java.security.PrivilegedAction;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
import javax.media.nativewindow.Capabilities;
import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.SurfaceChangeable;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.util.Point;
@@ -61,7 +60,7 @@ import jogamp.nativewindow.jawt.JAWT_DrawingSurfaceInfo;
import jogamp.nativewindow.jawt.JAWT_Rectangle;
import jogamp.nativewindow.macosx.OSXUtil;
-public class MacOSXJAWTWindow extends JAWTWindow implements SurfaceChangeable {
+public class MacOSXJAWTWindow extends JAWTWindow {
public MacOSXJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
super(comp, config);
isOffscreenLayerSurface = JAWTUtil.isCachedJAWTUsingOffscreenLayer();