diff options
author | Sven Gothel <[email protected]> | 2012-08-18 14:12:54 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-08-18 14:12:54 +0200 |
commit | a694cadca4ab72481e777222f412f006f973f77e (patch) | |
tree | 93d79bf72cab0e98bad6382df100ad3aa69ff009 /src/newt/classes/jogamp | |
parent | 3ab518e90eb4cf82bcb8b990d337a5e4a531136b (diff) |
NEWT Platform Driver: Uniform impl. class names [DisplayDriver, ScreenDriver, WindowDriver] to reduce complexity and programatic selection.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/DisplayImpl.java | 22 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/ScreenImpl.java | 28 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 21 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java | 10 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java | 2 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/android/AndroidScreen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java) | 18 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java | 1 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java) | 4 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/awt/AWTScreen.java) | 4 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/awt/AWTWindow.java) | 14 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/bcm/egl/Display.java) | 8 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/bcm/egl/Screen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/bcm/egl/Window.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Display.java) | 10 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Screen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Window.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/intel/gdl/Display.java) | 19 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/intel/gdl/Screen.java) | 7 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/intel/gdl/Window.java) | 19 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/kd/Display.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/kd/Screen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/kd/Window.java) | 8 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/macosx/MacDisplay.java) | 7 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java | 27 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/macosx/MacScreen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/windows/WindowsDisplay.java) | 8 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/windows/WindowsScreen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java) | 12 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java (renamed from src/newt/classes/jogamp/newt/driver/x11/X11Display.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java (renamed from src/newt/classes/jogamp/newt/driver/x11/X11Screen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java (renamed from src/newt/classes/jogamp/newt/driver/x11/X11Window.java) | 16 |
34 files changed, 161 insertions, 182 deletions
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java index 867a1f176..bac4031f0 100644 --- a/src/newt/classes/jogamp/newt/DisplayImpl.java +++ b/src/newt/classes/jogamp/newt/DisplayImpl.java @@ -44,7 +44,6 @@ import com.jogamp.newt.util.EDTUtil; import java.util.ArrayList; import javax.media.nativewindow.AbstractGraphicsDevice; import javax.media.nativewindow.NativeWindowException; -import javax.media.nativewindow.NativeWindowFactory; public abstract class DisplayImpl extends Display { private static int serialno = 1; @@ -52,26 +51,9 @@ public abstract class DisplayImpl extends Display { private static Class<?> getDisplayClass(String type) throws ClassNotFoundException { - Class<?> displayClass = NewtFactory.getCustomClass(type, "Display"); + final Class<?> displayClass = NewtFactory.getCustomClass(type, "DisplayDriver"); if(null==displayClass) { - if (NativeWindowFactory.TYPE_ANDROID == type) { - displayClass = Class.forName("jogamp.newt.driver.android.AndroidDisplay"); - } else if (NativeWindowFactory.TYPE_EGL == type) { - displayClass = Class.forName("jogamp.newt.driver.kd.Display"); - } else if (NativeWindowFactory.TYPE_WINDOWS == type) { - displayClass = Class.forName("jogamp.newt.driver.windows.WindowsDisplay"); - } else if (NativeWindowFactory.TYPE_MACOSX == type) { - displayClass = Class.forName("jogamp.newt.driver.macosx.MacDisplay"); - } else if (NativeWindowFactory.TYPE_X11 == type) { - displayClass = Class.forName("jogamp.newt.driver.x11.X11Display"); - } else if (NativeWindowFactory.TYPE_AWT == type) { - displayClass = Class.forName("jogamp.newt.driver.awt.AWTDisplay"); - } else { - throw new RuntimeException("Unknown display type \"" + type + "\""); - } - } - if(null==displayClass) { - throw new ClassNotFoundException("Failed to find NEWT Display Class <"+type+".Display>"); + throw new ClassNotFoundException("Failed to find NEWT Display Class <"+type+".DisplayDriver>"); } return displayClass; } diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java index 9f75a0d25..e2c0f746f 100644 --- a/src/newt/classes/jogamp/newt/ScreenImpl.java +++ b/src/newt/classes/jogamp/newt/ScreenImpl.java @@ -90,31 +90,13 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { }); } - @SuppressWarnings("unchecked") - private static Class<? extends Screen> getScreenClass(String type) throws ClassNotFoundException + private static Class<?> getScreenClass(String type) throws ClassNotFoundException { - Class<?> screenClass = NewtFactory.getCustomClass(type, "Screen"); + final Class<?> screenClass = NewtFactory.getCustomClass(type, "ScreenDriver"); if(null==screenClass) { - if (NativeWindowFactory.TYPE_ANDROID == type) { - screenClass = Class.forName("jogamp.newt.driver.android.AndroidScreen"); - } else if (NativeWindowFactory.TYPE_EGL == type) { - screenClass = Class.forName("jogamp.newt.driver.kd.Screen"); - } else if (NativeWindowFactory.TYPE_WINDOWS == type) { - screenClass = Class.forName("jogamp.newt.driver.windows.WindowsScreen"); - } else if (NativeWindowFactory.TYPE_MACOSX == type) { - screenClass = Class.forName("jogamp.newt.driver.macosx.MacScreen"); - } else if (NativeWindowFactory.TYPE_X11 == type) { - screenClass = Class.forName("jogamp.newt.driver.x11.X11Screen"); - } else if (NativeWindowFactory.TYPE_AWT == type) { - screenClass = Class.forName("jogamp.newt.driver.awt.AWTScreen"); - } else { - throw new RuntimeException("Unknown window type \"" + type + "\""); - } - } - if(null==screenClass) { - throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".Screen>"); + throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".ScreenDriver>"); } - return (Class<? extends Screen>)screenClass; + return screenClass; } public static Screen create(Display display, int idx) { @@ -133,7 +115,7 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { } } synchronized(screenList) { - Class<? extends Screen> screenClass = getScreenClass(display.getType()); + Class<?> screenClass = getScreenClass(display.getType()); ScreenImpl screen = (ScreenImpl) screenClass.newInstance(); screen.display = (DisplayImpl) display; idx = screen.validateScreenIndex(idx); diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 2971fa07e..ad7195944 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -152,26 +152,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer private static Class<?> getWindowClass(String type) throws ClassNotFoundException { - Class<?> windowClass = NewtFactory.getCustomClass(type, "Window"); + final Class<?> windowClass = NewtFactory.getCustomClass(type, "WindowDriver"); if(null==windowClass) { - if (NativeWindowFactory.TYPE_ANDROID == type) { - windowClass = Class.forName("jogamp.newt.driver.android.AndroidWindow"); - } else if (NativeWindowFactory.TYPE_EGL == type) { - windowClass = Class.forName("jogamp.newt.driver.kd.Window"); - } else if (NativeWindowFactory.TYPE_WINDOWS == type) { - windowClass = Class.forName("jogamp.newt.driver.windows.WindowsWindow"); - } else if (NativeWindowFactory.TYPE_MACOSX == type) { - windowClass = Class.forName("jogamp.newt.driver.macosx.MacWindow"); - } else if (NativeWindowFactory.TYPE_X11 == type) { - windowClass = Class.forName("jogamp.newt.driver.x11.X11Window"); - } else if (NativeWindowFactory.TYPE_AWT == type) { - windowClass = Class.forName("jogamp.newt.driver.awt.AWTWindow"); - } else { - throw new NativeWindowException("Unknown window type \"" + type + "\""); - } - } - if(null==windowClass) { - throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".Window>"); + throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".WindowDriver>"); } return windowClass; } diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java b/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java index 0a43c9b8f..a367462c4 100644 --- a/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java @@ -33,11 +33,11 @@ import jogamp.opengl.egl.*; import javax.media.nativewindow.*; -public class AndroidDisplay extends jogamp.newt.DisplayImpl { +public class DisplayDriver extends jogamp.newt.DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); - if (!AndroidWindow.initIDs0()) { + if (!WindowDriver.initIDs0()) { throw new NativeWindowException("Failed to initialize Android NEWT Windowing library"); } } @@ -47,7 +47,7 @@ public class AndroidDisplay extends jogamp.newt.DisplayImpl { } - public AndroidDisplay() { + public DisplayDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java index 4537fa963..91c589beb 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java @@ -36,7 +36,7 @@ import javax.media.opengl.FPSCounter; import com.jogamp.newt.Window; import com.jogamp.opengl.util.Animator; -import jogamp.newt.driver.android.AndroidWindow; +import jogamp.newt.driver.android.WindowDriver; import android.app.Activity; import android.content.Context; @@ -83,10 +83,10 @@ public class NewtBaseActivity extends Activity { */ public void setContentView(android.view.Window androidWindow, Window newtWindow) { newtWindow = newtWindow.getDelegatedWindow(); - if(newtWindow instanceof AndroidWindow) { + if(newtWindow instanceof WindowDriver) { adaptTheme4Transparency(newtWindow.getRequestedCapabilities()); layoutForNEWTWindow(androidWindow, newtWindow); - AndroidWindow newtAWindow = (AndroidWindow)newtWindow; + WindowDriver newtAWindow = (WindowDriver)newtWindow; androidWindow.setContentView(newtAWindow.getAndroidView()); registerNEWTWindow(newtAWindow); } else { @@ -107,8 +107,8 @@ public class NewtBaseActivity extends Activity { */ public void addContentView(android.view.Window androidWindow, Window newtWindow, android.view.ViewGroup.LayoutParams params) { newtWindow = newtWindow.getDelegatedWindow(); - if(newtWindow instanceof AndroidWindow) { - AndroidWindow newtAWindow = (AndroidWindow)newtWindow; + if(newtWindow instanceof WindowDriver) { + WindowDriver newtAWindow = (WindowDriver)newtWindow; androidWindow.addContentView(newtAWindow.getAndroidView(), params); registerNEWTWindow(newtAWindow); } else { diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java index 36b83337a..a49f1648c 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java @@ -69,7 +69,7 @@ public class NewtVersionActivity extends NewtBaseActivity { glWindow.setUndecorated(true); glWindow.setSize(32, 32); glWindow.setPosition(0, 0); - final android.view.View androidGLView = ((AndroidWindow)glWindow.getDelegatedWindow()).getAndroidView(); + final android.view.View androidGLView = ((WindowDriver)glWindow.getDelegatedWindow()).getAndroidView(); viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getWidth(), glWindow.getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); registerNEWTWindow(glWindow); diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidScreen.java b/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java index e108ed0bb..795aac5fb 100644 --- a/src/newt/classes/jogamp/newt/driver/android/AndroidScreen.java +++ b/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java @@ -41,13 +41,13 @@ import android.util.DisplayMetrics; import android.view.Surface; import android.view.WindowManager; -public class AndroidScreen extends jogamp.newt.ScreenImpl { +public class ScreenDriver extends jogamp.newt.ScreenImpl { static { - AndroidDisplay.initSingleton(); + DisplayDriver.initSingleton(); } - public AndroidScreen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java index 73192a07f..8ad11b35f 100644 --- a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java +++ b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java @@ -59,9 +59,9 @@ import android.view.inputmethod.InputMethodManager; import android.view.SurfaceView; import android.view.View; -public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { +public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 { static { - AndroidDisplay.initSingleton(); + DisplayDriver.initSingleton(); } public static CapabilitiesImmutable fixCaps(boolean matchFormatPrecise, int format, CapabilitiesImmutable rCaps) { @@ -142,11 +142,11 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { @Override public boolean onTouch(View v, android.view.MotionEvent event) { - final com.jogamp.newt.event.MouseEvent[] newtEvents = AndroidNewtEventFactory.createMouseEvents(event, AndroidWindow.this); + final com.jogamp.newt.event.MouseEvent[] newtEvents = AndroidNewtEventFactory.createMouseEvents(event, WindowDriver.this); if(null != newtEvents) { focusChanged(false, true); for(int i=0; i<newtEvents.length; i++) { - AndroidWindow.this.enqueueEvent(false, newtEvents[i]); + WindowDriver.this.enqueueEvent(false, newtEvents[i]); } try { Thread.sleep((long) (1000.0F/30.0F)); } catch(InterruptedException e) { } @@ -157,10 +157,10 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { @Override public boolean onKey(View v, int keyCode, android.view.KeyEvent event) { - final com.jogamp.newt.event.KeyEvent[] newtEvents = AndroidNewtEventFactory.createKeyEvents(keyCode, event, AndroidWindow.this); + final com.jogamp.newt.event.KeyEvent[] newtEvents = AndroidNewtEventFactory.createKeyEvents(keyCode, event, WindowDriver.this); if(null != newtEvents) { for(int i=0; i<newtEvents.length; i++) { - AndroidWindow.this.enqueueEvent(false, newtEvents[i]); + WindowDriver.this.enqueueEvent(false, newtEvents[i]); } return true; } @@ -169,7 +169,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { @Override public void onFocusChange(View v, boolean hasFocus) { - AndroidWindow.this.focusChanged(false, hasFocus); + WindowDriver.this.focusChanged(false, hasFocus); } } @@ -178,7 +178,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { return new Class<?>[] { Context.class } ; } - public AndroidWindow() { + public WindowDriver() { reset(); } @@ -212,7 +212,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { androidView.setFocusableInTouchMode(true); final SurfaceHolder sh = androidView.getHolder(); - sh.addCallback(AndroidWindow.this); + sh.addCallback(WindowDriver.this); sh.setFormat(getFormat(getRequestedCapabilities())); // default size -> TBD ! diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java index a7950048a..b3fdcad41 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java +++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java index 65f8b4715..39d96585b 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java @@ -40,8 +40,8 @@ import com.jogamp.newt.util.EDTUtil; import jogamp.newt.DisplayImpl; -public class AWTDisplay extends DisplayImpl { - public AWTDisplay() { +public class DisplayDriver extends DisplayImpl { + public DisplayDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTScreen.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java index a3c0281b1..6b1283a00 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTScreen.java +++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java @@ -42,8 +42,8 @@ import javax.media.nativewindow.util.Point; import com.jogamp.nativewindow.awt.AWTGraphicsDevice; import com.jogamp.nativewindow.awt.AWTGraphicsScreen; -public class AWTScreen extends ScreenImpl { - public AWTScreen() { +public class ScreenDriver extends ScreenImpl { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTWindow.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java index 2b2fed545..1723ffee5 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTWindow.java +++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java @@ -55,9 +55,9 @@ import com.jogamp.newt.event.awt.AWTWindowAdapter; AWT. This is provided for convenience of porting to platforms supporting Java SE. */ -public class AWTWindow extends WindowImpl { +public class WindowDriver extends WindowImpl { - public AWTWindow() { + public WindowDriver() { this(null); } @@ -65,7 +65,7 @@ public class AWTWindow extends WindowImpl { return new Class<?>[] { Container.class } ; } - public AWTWindow(Container container) { + public WindowDriver(Container container) { super(); this.container = container; if(container instanceof Frame) { @@ -107,7 +107,7 @@ public class AWTWindow extends WindowImpl { frame.setTitle(getTitle()); } container.setLayout(new BorderLayout()); - canvas = new AWTCanvas(capsRequested, AWTWindow.this.capabilitiesChooser); + canvas = new AWTCanvas(capsRequested, WindowDriver.this.capabilitiesChooser); addWindowListener(new LocalWindowListener()); @@ -152,10 +152,10 @@ public class AWTWindow extends WindowImpl { setGraphicsConfiguration(cfg); // propagate new info .. - ((AWTScreen)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)cfg.getScreen()); - ((AWTDisplay)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)cfg.getScreen().getDevice()); + ((ScreenDriver)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)cfg.getScreen()); + ((DisplayDriver)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)cfg.getScreen().getDevice()); - ((AWTScreen)getScreen()).updateVirtualScreenOriginAndSize(); + ((ScreenDriver)getScreen()).updateVirtualScreenOriginAndSize(); } return res; } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/Display.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java index f08890da6..65ca63eec 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/Display.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java @@ -42,12 +42,12 @@ import jogamp.opengl.egl.EGL; import com.jogamp.nativewindow.egl.EGLGraphicsDevice; -public class Display extends jogamp.newt.DisplayImpl { +public class DisplayDriver extends jogamp.newt.DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); - if (!Window.initIDs()) { + if (!WindowDriver.initIDs()) { throw new NativeWindowException("Failed to initialize BCEGL Window jmethodIDs"); } } @@ -57,11 +57,11 @@ public class Display extends jogamp.newt.DisplayImpl { } - public Display() { + public DisplayDriver() { } protected void createNativeImpl() { - final long handle = CreateDisplay(Screen.fixedWidth, Screen.fixedHeight); + final long handle = CreateDisplay(ScreenDriver.fixedWidth, ScreenDriver.fixedHeight); if (handle == EGL.EGL_NO_DISPLAY) { throw new NativeWindowException("BC EGL CreateDisplay failed"); } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/Screen.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java index 909444d24..deb2a534b 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/Screen.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java @@ -38,14 +38,14 @@ import javax.media.nativewindow.DefaultGraphicsScreen; import javax.media.nativewindow.util.Dimension; import javax.media.nativewindow.util.Point; -public class Screen extends jogamp.newt.ScreenImpl { +public class ScreenDriver extends jogamp.newt.ScreenImpl { static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Screen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/Window.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java index 87170e4ab..49d3d98ba 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/Window.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java @@ -44,12 +44,12 @@ import javax.media.opengl.GLCapabilitiesImmutable; import jogamp.opengl.egl.EGLGraphicsConfiguration; -public class Window extends jogamp.newt.WindowImpl { +public class WindowDriver extends jogamp.newt.WindowImpl { static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Window() { + public WindowDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Display.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java index 62af02abb..08c5c573c 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Display.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java @@ -36,17 +36,17 @@ import jogamp.newt.NEWTJNILibLoader; import jogamp.opengl.egl.EGL; import jogamp.opengl.egl.EGLDisplayUtil; -public class Display extends DisplayImpl { +public class DisplayDriver extends DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); - if (!Display.initIDs()) { + if (!DisplayDriver.initIDs()) { throw new NativeWindowException("Failed to initialize bcm.vc.iv Display jmethodIDs"); } - if (!Screen.initIDs()) { + if (!ScreenDriver.initIDs()) { throw new NativeWindowException("Failed to initialize bcm.vc.iv Screen jmethodIDs"); } - if (!Window.initIDs()) { + if (!WindowDriver.initIDs()) { throw new NativeWindowException("Failed to initialize bcm.vc.iv Window jmethodIDs"); } } @@ -56,7 +56,7 @@ public class Display extends DisplayImpl { } - public Display() { + public DisplayDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Screen.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java index 484d4bf81..787d1a1b4 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Screen.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java @@ -34,12 +34,12 @@ import javax.media.nativewindow.util.Point; import jogamp.newt.ScreenImpl; -public class Screen extends ScreenImpl { +public class ScreenDriver extends ScreenImpl { static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Screen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Window.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java index 3d00949de..6d4f36964 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/Window.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java @@ -38,14 +38,14 @@ import javax.media.nativewindow.util.Point; import jogamp.newt.WindowImpl; import jogamp.newt.driver.linux.LinuxMouseTracker; -public class Window extends WindowImpl { +public class WindowDriver extends WindowImpl { private static final String WINDOW_CLASS_NAME = "NewtWindow"; static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Window() { + public WindowDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/Display.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java index 20e151eb3..97c384d33 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/Display.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2012 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -36,16 +37,16 @@ package jogamp.newt.driver.intel.gdl; import jogamp.newt.*; import javax.media.nativewindow.*; -public class Display extends jogamp.newt.DisplayImpl { +public class DisplayDriver extends jogamp.newt.DisplayImpl { static int initCounter = 0; static { NEWTJNILibLoader.loadNEWT(); - if (!Screen.initIDs()) { + if (!ScreenDriver.initIDs()) { throw new NativeWindowException("Failed to initialize GDL Screen jmethodIDs"); } - if (!Window.initIDs()) { + if (!WindowDriver.initIDs()) { throw new NativeWindowException("Failed to initialize GDL Window jmethodIDs"); } } @@ -55,11 +56,11 @@ public class Display extends jogamp.newt.DisplayImpl { } - public Display() { + public DisplayDriver() { } protected void createNativeImpl() { - synchronized(Display.class) { + synchronized(DisplayDriver.class) { if(0==initCounter) { displayHandle = CreateDisplay(); if(0==displayHandle) { @@ -75,7 +76,7 @@ public class Display extends jogamp.newt.DisplayImpl { if(0==displayHandle) { throw new NativeWindowException("displayHandle null; initCnt "+initCounter); } - synchronized(Display.class) { + synchronized(DisplayDriver.class) { if(initCounter>0) { initCounter--; if(0==initCounter) { @@ -91,14 +92,14 @@ public class Display extends jogamp.newt.DisplayImpl { } } - protected void setFocus(Window focus) { + protected void setFocus(WindowDriver focus) { focusedWindow = focus; } private long displayHandle = 0; - private Window focusedWindow = null; + private WindowDriver focusedWindow = null; private native long CreateDisplay(); private native void DestroyDisplay(long displayHandle); - private native void DispatchMessages(long displayHandle, Window focusedWindow); + private native void DispatchMessages(long displayHandle, WindowDriver focusedWindow); } diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/Screen.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java index 66ad1c691..8eed14dde 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/Screen.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2012 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -38,13 +39,13 @@ import javax.media.nativewindow.DefaultGraphicsScreen; import javax.media.nativewindow.util.Dimension; import javax.media.nativewindow.util.Point; -public class Screen extends jogamp.newt.ScreenImpl { +public class ScreenDriver extends jogamp.newt.ScreenImpl { static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Screen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/Window.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java index d5c75abd4..98335f192 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/Window.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2012 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -37,12 +38,12 @@ import javax.media.nativewindow.*; import javax.media.nativewindow.util.Insets; import javax.media.nativewindow.util.Point; -public class Window extends jogamp.newt.WindowImpl { +public class WindowDriver extends jogamp.newt.WindowImpl { static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Window() { + public WindowDriver() { } static long nextWindowHandle = 1; @@ -61,7 +62,7 @@ public class Window extends jogamp.newt.WindowImpl { } setGraphicsConfiguration(cfg); - synchronized(Window.class) { + synchronized(WindowDriver.class) { setWindowHandle(nextWindowHandle++); // just a marker surfaceHandle = CreateSurface(aDevice.getHandle(), getScreen().getWidth(), getScreen().getHeight(), getX(), getY(), getWidth(), getHeight()); @@ -73,16 +74,16 @@ public class Window extends jogamp.newt.WindowImpl { protected void closeNativeImpl() { if(0!=surfaceHandle) { - synchronized(Window.class) { + synchronized(WindowDriver.class) { CloseSurface(getDisplayHandle(), surfaceHandle); } surfaceHandle = 0; - ((Display)getScreen().getDisplay()).setFocus(null); + ((DisplayDriver)getScreen().getDisplay()).setFocus(null); } } protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { - Screen screen = (Screen) getScreen(); + ScreenDriver screen = (ScreenDriver) getScreen(); if(width>screen.getWidth()) { width=screen.getWidth(); @@ -103,7 +104,7 @@ public class Window extends jogamp.newt.WindowImpl { if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { if(0 != ( FLAG_IS_VISIBLE & flags)) { - ((Display)getScreen().getDisplay()).setFocus(this); + ((DisplayDriver)getScreen().getDisplay()).setFocus(this); } visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags)); } @@ -112,7 +113,7 @@ public class Window extends jogamp.newt.WindowImpl { } protected void requestFocusImpl(boolean reparented) { - ((Display)getScreen().getDisplay()).setFocus(this); + ((DisplayDriver)getScreen().getDisplay()).setFocus(this); } @Override diff --git a/src/newt/classes/jogamp/newt/driver/kd/Display.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java index a58ad477a..745be5dae 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/Display.java +++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java @@ -42,11 +42,11 @@ import jogamp.newt.NEWTJNILibLoader; import jogamp.opengl.egl.EGL; import jogamp.opengl.egl.EGLDisplayUtil; -public class Display extends DisplayImpl { +public class DisplayDriver extends DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); - if (!Window.initIDs()) { + if (!WindowDriver.initIDs()) { throw new NativeWindowException("Failed to initialize kd.Window jmethodIDs"); } } @@ -56,7 +56,7 @@ public class Display extends DisplayImpl { } - public Display() { + public DisplayDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/kd/Screen.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java index 53f5890b2..656bcf5c9 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/Screen.java +++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java @@ -40,12 +40,12 @@ import javax.media.nativewindow.util.Point; import jogamp.newt.ScreenImpl; -public class Screen extends ScreenImpl { +public class ScreenDriver extends ScreenImpl { static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Screen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/kd/Window.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java index ce65040c3..c733a3e94 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/Window.java +++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java @@ -46,14 +46,14 @@ import javax.media.opengl.GLCapabilitiesImmutable; import jogamp.newt.WindowImpl; import jogamp.opengl.egl.EGLGraphicsConfiguration; -public class Window extends WindowImpl { +public class WindowDriver extends WindowImpl { private static final String WINDOW_CLASS_NAME = "NewtWindow"; static { - Display.initSingleton(); + DisplayDriver.initSingleton(); } - public Window() { + public WindowDriver() { } protected void createNativeImpl() { @@ -152,7 +152,7 @@ public class Window extends WindowImpl { @Override protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) { if(isFullscreen()) { - ((Screen)getScreen()).sizeChanged(getWidth(), getHeight()); + ((ScreenDriver)getScreen()).sizeChanged(getWidth(), getHeight()); } super.sizeChanged(defer, newWidth, newHeight, force); } diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacDisplay.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java index 18f8d9538..1a3f14859 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/MacDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2012 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -41,14 +42,14 @@ import com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice; import jogamp.newt.DisplayImpl; import jogamp.newt.NEWTJNILibLoader; -public class MacDisplay extends DisplayImpl { +public class DisplayDriver extends DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); if(!initNSApplication0()) { throw new NativeWindowException("Failed to initialize native Application hook"); } - if(!MacWindow.initIDs0()) { + if(!WindowDriver.initIDs0()) { throw new NativeWindowException("Failed to initialize jmethodIDs"); } if(DEBUG) { @@ -60,7 +61,7 @@ public class MacDisplay extends DisplayImpl { // just exist to ensure static init has been run } - public MacDisplay() { + public DisplayDriver() { } protected void dispatchMessagesNative() { diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java index 46625f7a9..d39e0027b 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java @@ -1,3 +1,30 @@ +/** + * Copyright 2011 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ package jogamp.newt.driver.macosx; import com.jogamp.newt.event.KeyEvent; diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacScreen.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java index b9c725fd4..24e60ba0a 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/MacScreen.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java @@ -47,18 +47,18 @@ import com.jogamp.common.util.IntObjectHashMap; import com.jogamp.newt.ScreenMode; import com.jogamp.newt.util.ScreenModeUtil; -public class MacScreen extends ScreenImpl { +public class ScreenDriver extends ScreenImpl { // caching native CGDisplayScreenSize() results, since it's ridiculous slow (~6 ms each call) private static IntObjectHashMap/*<int, DimensionImmutable>*/ scrnIdx2Dimension; static { - MacDisplay.initSingleton(); + DisplayDriver.initSingleton(); scrnIdx2Dimension = new IntObjectHashMap(); scrnIdx2Dimension.setKeyNotFoundValue(null); } - public MacScreen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index 27d7a1679..ea48569bf 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -51,13 +51,13 @@ import jogamp.newt.driver.DriverUpdatePosition; import com.jogamp.newt.event.KeyEvent; -public class MacWindow extends WindowImpl implements MutableSurface, DriverClearFocus, DriverUpdatePosition { +public class WindowDriver extends WindowImpl implements MutableSurface, DriverClearFocus, DriverUpdatePosition { static { - MacDisplay.initSingleton(); + DisplayDriver.initSingleton(); } - public MacWindow() { + public WindowDriver() { } @Override diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowsDisplay.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java index 225b115e4..579ec5be8 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowsDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java @@ -43,7 +43,7 @@ import javax.media.nativewindow.NativeWindowException; import com.jogamp.nativewindow.windows.WindowsGraphicsDevice; -public class WindowsDisplay extends DisplayImpl { +public class DisplayDriver extends DisplayImpl { private static final String newtClassBaseName = "_newt_clazz" ; private static RegisteredClassFactory sharedClassFactory; @@ -51,10 +51,10 @@ public class WindowsDisplay extends DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); - if (!WindowsWindow.initIDs0()) { + if (!WindowDriver.initIDs0()) { throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs"); } - sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowsWindow.getNewtWndProc0()); + sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowDriver.getNewtWndProc0()); } public static void initSingleton() { @@ -63,7 +63,7 @@ public class WindowsDisplay extends DisplayImpl { private RegisteredClass sharedClass; - public WindowsDisplay() { + public DisplayDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowsScreen.java b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java index f8bce9da3..948b29460 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowsScreen.java +++ b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java @@ -42,13 +42,13 @@ import jogamp.newt.ScreenImpl; import com.jogamp.newt.ScreenMode; import com.jogamp.newt.util.ScreenModeUtil; -public class WindowsScreen extends ScreenImpl { +public class ScreenDriver extends ScreenImpl { static { - WindowsDisplay.initSingleton(); + DisplayDriver.initSingleton(); } - public WindowsScreen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 6a8c81f3d..39ea54575 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -50,7 +50,7 @@ import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.MouseAdapter; import com.jogamp.newt.event.MouseEvent; -public class WindowsWindow extends WindowImpl { +public class WindowDriver extends WindowImpl { private long hmon; private long hdc; @@ -58,10 +58,10 @@ public class WindowsWindow extends WindowImpl { private long windowHandleClose; static { - WindowsDisplay.initSingleton(); + DisplayDriver.initSingleton(); } - public WindowsWindow() { + public WindowDriver() { } @Override @@ -118,8 +118,8 @@ public class WindowsWindow extends WindowImpl { } protected void createNativeImpl() { - final WindowsScreen screen = (WindowsScreen) getScreen(); - final WindowsDisplay display = (WindowsDisplay) screen.getDisplay(); + final ScreenDriver screen = (ScreenDriver) getScreen(); + final DisplayDriver display = (DisplayDriver) screen.getDisplay(); final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration( capsRequested, capsRequested, capabilitiesChooser, screen.getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); if (null == cfg) { @@ -146,7 +146,7 @@ public class WindowsWindow extends WindowImpl { class MouseTracker extends MouseAdapter { public void mouseEntered(MouseEvent e) { - WindowsWindow.trackPointerLeave0(WindowsWindow.this.getWindowHandle()); + WindowDriver.trackPointerLeave0(WindowDriver.this.getWindowHandle()); } } diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java index 8243fcf9d..714324d63 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java +++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java @@ -44,7 +44,7 @@ import jogamp.nativewindow.x11.X11Util; import jogamp.newt.DisplayImpl; import jogamp.newt.NEWTJNILibLoader; -public class X11Display extends DisplayImpl { +public class DisplayDriver extends DisplayImpl { static { NEWTJNILibLoader.loadNEWT(); @@ -53,7 +53,7 @@ public class X11Display extends DisplayImpl { throw new NativeWindowException("Failed to initialize X11Display jmethodIDs"); } - if (!X11Window.initIDs0()) { + if (!WindowDriver.initIDs0()) { throw new NativeWindowException("Failed to initialize X11Window jmethodIDs"); } } @@ -63,7 +63,7 @@ public class X11Display extends DisplayImpl { } - public X11Display() { + public DisplayDriver() { } public String validateDisplayName(String name, long handle) { diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java index 93db854ac..10f6b84da 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java +++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java @@ -48,13 +48,13 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen; import com.jogamp.newt.ScreenMode; import com.jogamp.newt.util.ScreenModeUtil; -public class X11Screen extends ScreenImpl { +public class ScreenDriver extends ScreenImpl { static { - X11Display.initSingleton(); + DisplayDriver.initSingleton(); } - public X11Screen() { + public ScreenDriver() { } protected void createNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Window.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java index 5501f5a3c..97d1ae3db 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/X11Window.java +++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java @@ -46,7 +46,7 @@ import javax.media.nativewindow.util.Point; import com.jogamp.newt.event.MouseEvent; -public class X11Window extends WindowImpl { +public class WindowDriver extends WindowImpl { private static final String WINDOW_CLASS_NAME = "NewtWindow"; private static final int X11_WHEEL_ONE_UP_BUTTON = 4; private static final int X11_WHEEL_ONE_DOWN_BUTTON = 5; @@ -54,15 +54,15 @@ public class X11Window extends WindowImpl { private static final int X11_WHEEL_TWO_DOWN_BUTTON = 7; static { - X11Display.initSingleton(); + DisplayDriver.initSingleton(); } - public X11Window() { + public WindowDriver() { } protected void createNativeImpl() { - final X11Screen screen = (X11Screen) getScreen(); - final X11Display display = (X11Display) screen.getDisplay(); + final ScreenDriver screen = (ScreenDriver) getScreen(); + final DisplayDriver display = (DisplayDriver) screen.getDisplay(); final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice(), capsRequested); final AbstractGraphicsConfiguration cfg = factory.chooseGraphicsConfiguration( capsRequested, capsRequested, capabilitiesChooser, screen.getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); @@ -91,7 +91,7 @@ public class X11Window extends WindowImpl { protected void closeNativeImpl() { if(0!=windowHandleClose && null!=getScreen() ) { - X11Display display = (X11Display) getScreen().getDisplay(); + DisplayDriver display = (DisplayDriver) getScreen().getDisplay(); try { CloseWindow0(display.getEDTHandle(), windowHandleClose, display.getJavaObjectAtom(), display.getWindowDeleteAtom()); @@ -118,7 +118,7 @@ public class X11Window extends WindowImpl { x -= i.getLeftWidth() ; y -= i.getTopHeight() ; } - final X11Display display = (X11Display) getScreen().getDisplay(); + final DisplayDriver display = (DisplayDriver) getScreen().getDisplay(); reconfigureWindow0( getDisplayEDTHandle(), getScreenIndex(), getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(), x, y, width, height, flags); @@ -234,7 +234,7 @@ public class X11Window extends WindowImpl { private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI private final long getDisplayEDTHandle() { - return ((X11Display) getScreen().getDisplay()).getEDTHandle(); + return ((DisplayDriver) getScreen().getDisplay()).getEDTHandle(); } private final <T> T runWithLockedDisplayHandle(DisplayRunnable<T> action) { return ((DisplayImpl) getScreen().getDisplay()).runWithLockedDisplayHandle(action); |