diff options
author | Sven Gothel <[email protected]> | 2008-06-21 02:33:51 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-06-21 02:33:51 +0000 |
commit | 006acbb9463af33a8b45aa0b3a298604eba72d82 (patch) | |
tree | 2c71662575a2c098b22c4b19b471bb5c732041c5 /src/classes/com/sun/javafx/newt/x11 | |
parent | cbc45e816f4ee81031bffce19a99550681462a24 (diff) |
2nd big refactoring.
Goals are orthogonal components for:
- OS Windowing system
- NEWT, X11, Windows, MacOsX
- GL Windowing GLUE
- EGL, GLX, WGL, CGL
- GL profiles
- core and util packages
- generate all Java components from any platform
All above goals are achieved.
TODO:
- Native compilation fix and test
- Check/Fix Win32, MacOSX and the mobile devices
- ..
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1665 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/javafx/newt/x11')
-rwxr-xr-x | src/classes/com/sun/javafx/newt/x11/X11Display.java | 2 | ||||
-rwxr-xr-x | src/classes/com/sun/javafx/newt/x11/X11Screen.java | 2 | ||||
-rwxr-xr-x | src/classes/com/sun/javafx/newt/x11/X11Window.java | 54 |
3 files changed, 16 insertions, 42 deletions
diff --git a/src/classes/com/sun/javafx/newt/x11/X11Display.java b/src/classes/com/sun/javafx/newt/x11/X11Display.java index 5a4ed8eed..00df325c6 100755 --- a/src/classes/com/sun/javafx/newt/x11/X11Display.java +++ b/src/classes/com/sun/javafx/newt/x11/X11Display.java @@ -44,7 +44,7 @@ public class X11Display extends Display { public X11Display() { } - public void initNative() { + protected void createNative() { handle = CreateDisplay(name); if (handle == 0 ) { throw new RuntimeException("Error creating display: "+name); diff --git a/src/classes/com/sun/javafx/newt/x11/X11Screen.java b/src/classes/com/sun/javafx/newt/x11/X11Screen.java index 279507fab..4094c557c 100755 --- a/src/classes/com/sun/javafx/newt/x11/X11Screen.java +++ b/src/classes/com/sun/javafx/newt/x11/X11Screen.java @@ -44,7 +44,7 @@ public class X11Screen extends Screen { public X11Screen() { } - public void initNative() { + protected void createNative() { handle = GetScreen(display.getHandle(), index); if (handle == 0 ) { throw new RuntimeException("Error creating screen: "+index); diff --git a/src/classes/com/sun/javafx/newt/x11/X11Window.java b/src/classes/com/sun/javafx/newt/x11/X11Window.java index d9a6e07ba..63e558bbc 100755 --- a/src/classes/com/sun/javafx/newt/x11/X11Window.java +++ b/src/classes/com/sun/javafx/newt/x11/X11Window.java @@ -38,13 +38,7 @@ import com.sun.opengl.impl.*; public class X11Window extends Window { private static final String WINDOW_CLASS_NAME = "NewtWindow"; - // Default width and height -- will likely be re-set immediately by user - private int width = 100; - private int height = 100; - private int x=0; - private int y=0; // non fullscreen dimensions .. - private boolean fullscreen, visible; private int nfs_width, nfs_height, nfs_x, nfs_y; static { @@ -58,19 +52,22 @@ public class X11Window extends Window { public X11Window() { } - public void initNative() { - fullscreen=false; - visible=false; + protected void createNative() { long w = CreateWindow(getDisplayHandle(), getScreenHandle(), getScreenIndex(), visualID, x, y, width, height); if (w == 0 || w!=windowHandle) { throw new RuntimeException("Error creating window: "+w); } } + protected void closeNative() { + CloseWindow(getDisplayHandle(), windowHandle); + } + public void setVisible(boolean visible) { if(this.visible!=visible) { this.visible=visible; setVisible0(getDisplayHandle(), windowHandle, visible); + clearEventMask(); } } @@ -82,26 +79,6 @@ public class X11Window extends Window { setPosition0(getDisplayHandle(), windowHandle, x, y); } - public boolean isVisible() { - return visible; - } - - public int getX() { - return x; - } - - public int getY() { - return y; - } - - public int getWidth() { - return width; - } - - public int getHeight() { - return height; - } - public boolean setFullscreen(boolean fullscreen) { if(this.fullscreen!=fullscreen) { int x,y,w,h; @@ -122,14 +99,6 @@ public class X11Window extends Window { return true; } - public boolean isFullscreen() { - return fullscreen; - } - - public void pumpMessages() { - DispatchMessages(getDisplayHandle(), windowHandle); - } - public int getDisplayWidth() { return getDisplayWidth0(getDisplayHandle(), getScreenIndex()); } @@ -138,15 +107,20 @@ public class X11Window extends Window { return getDisplayHeight0(getDisplayHandle(), getScreenIndex()); } + public void dispatchMessages(int eventMask) { + DispatchMessages(getDisplayHandle(), windowHandle, eventMask); + } + //---------------------------------------------------------------------- // Internals only // private static native boolean initIDs(); private native long CreateWindow(long display, long screen, int screen_index, - int visualID, int x, int y, int width, int height); + long visualID, int x, int y, int width, int height); + private native void CloseWindow(long display, long windowHandle); private native void setVisible0(long display, long windowHandle, boolean visible); - private native void DispatchMessages(long display, long windowHandle); + private native void DispatchMessages(long display, long windowHandle, int eventMask); private native void setSize0(long display, long windowHandle, int width, int height); private native void setPosition0(long display, long windowHandle, int x, int y); private native int getDisplayWidth0(long display, int scrn_idx); @@ -170,7 +144,7 @@ public class X11Window extends Window { } } - private void windowCreated(int visualID, long windowHandle) { + private void windowCreated(long visualID, long windowHandle) { this.visualID = visualID; this.windowHandle = windowHandle; } |