summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-02-17 05:37:49 +0100
committerSven Gothel <[email protected]>2015-02-17 05:37:49 +0100
commit480f4251cf3cf530493611d8924f905cacc349d5 (patch)
tree8935fef2ff921d159c446aea6541bcf8cb8d9d5d /src
parentc6e79657acd2104edfe4354d7d52f228895250c9 (diff)
NativeWindowFactory: Add FIXME tag regarding Bug 973 (Needs service provider interface (SPI) for TK dependent implementation) ..
Also: - add 'AbstractGraphicsDevice createDevice(final String nwt, ..)' variant for explicit TK type passing. - 'AbstractGraphicsDevice createDevice(..)' uses DefaultGraphicsDevice for generic TK types, but TYPE_EGL and TYPE_AWT
Diffstat (limited to 'src')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java40
1 files changed, 30 insertions, 10 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java
index cba3a9214..d01e3a203 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java
@@ -70,8 +70,11 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
adapt their components to the {@link NativeWindow} interface,
which provides a platform-independent mechanism of accessing the
information required to perform operations like
- hardware-accelerated rendering using the OpenGL API. */
-
+ hardware-accelerated rendering using the OpenGL API.
+ * <p>
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ * </p>
+ */
public abstract class NativeWindowFactory {
protected static final boolean DEBUG;
@@ -421,6 +424,9 @@ public abstract class NativeWindowFactory {
}
/** Don't know if we shall add this factory here ..
+ * <p>
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ * </p>
public static AbstractGraphicsDevice createGraphicsDevice(String type, String connection, int unitID, long handle, ToolkitLock locker) {
if(TYPE_EGL == type) {
return new
@@ -632,6 +638,9 @@ public abstract class NativeWindowFactory {
* If the visualID is {@link VisualIDHolder#VID_UNDEFINED} and the platform requires it
* at creation time (see above), it is not valid for further processing.
* </p>
+ * <p>
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ * </p>
*/
public static boolean isNativeVisualIDValidForProcessing(final int visualID) {
return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) ||
@@ -645,7 +654,18 @@ public abstract class NativeWindowFactory {
* </p>
*/
public static AbstractGraphicsDevice createDevice(final String displayConnection, final boolean own) {
- final String nwt = NativeWindowFactory.getNativeWindowType(true);
+ return createDevice(NativeWindowFactory.getNativeWindowType(true), displayConnection, own);
+ }
+ /**
+ * Creates a native device type, following the given {@link #getNativeWindowType(boolean) native-window-type}.
+ * <p>
+ * The device will be opened if <code>own</code> is true, otherwise no native handle will ever be acquired.
+ * </p>
+ * <p>
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ * </p>
+ */
+ public static AbstractGraphicsDevice createDevice(final String nwt, final String displayConnection, final boolean own) {
if( NativeWindowFactory.TYPE_X11 == nwt ) {
if( own ) {
return new X11GraphicsDevice(displayConnection, AbstractGraphicsDevice.DEFAULT_UNIT, null /* ToolkitLock */);
@@ -656,16 +676,13 @@ public abstract class NativeWindowFactory {
return new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
} else if( NativeWindowFactory.TYPE_MACOSX == nwt ) {
return new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
- /**
- * FIXME: Needs service provider interface (SPI) for TK dependent implementation
- } else if( NativeWindowFactory.TYPE_BCM_VC_IV == nwt ) {
- } else if( NativeWindowFactory.TYPE_ANDROID== nwt ) {
} else if( NativeWindowFactory.TYPE_EGL == nwt ) {
- } else if( NativeWindowFactory.TYPE_BCM_VC_IV == nwt ) {
+ throw new UnsupportedOperationException("n/a for windowing system: "+nwt);
} else if( NativeWindowFactory.TYPE_AWT == nwt ) {
- */
+ throw new UnsupportedOperationException("n/a for windowing system: "+nwt);
+ } else {
+ return new DefaultGraphicsDevice(nwt, displayConnection, AbstractGraphicsDevice.DEFAULT_UNIT);
}
- throw new UnsupportedOperationException("n/a for windowing system: "+nwt);
}
/**
@@ -691,6 +708,9 @@ public abstract class NativeWindowFactory {
/**
* @param nw
* @return top-left client-area position in window units
+ * <p>
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ * </p>
*/
public static PointImmutable getLocationOnScreen(final NativeWindow nw) {
final String nwt = NativeWindowFactory.getNativeWindowType(true);