34package com.jogamp.nativewindow;
36import jogamp.nativewindow.NativeWindowFactoryImpl;
39 private static final String separator =
"_";
40 private final String type;
45 private Object handleOwner;
96 this.handleOwner =
null;
97 this.toolkitLock =
null != locker ? locker : NativeWindowFactoryImpl.getNullToolkitLock();
103 return super.clone();
104 }
catch (
final CloneNotSupportedException e) {
184 return null != handleOwner;
203 final long oldHandle =
handle;
212 final Object old = handleOwner;
213 handleOwner = newOwnership;
223 final long bHandle = b.
setHandle(aHandle);
252 toolkitLock = (
null == locker ) ? NativeWindowFactoryImpl.getNullToolkitLock() : locker ;
boolean close()
Optionally closing the device if handle is not null.
static String getDefaultDisplayConnection(final String type)
Return the default display connection for the given windowing toolkit type gathered via NativeWindowF...
boolean open()
Optionally [re]opening the device if handle is null.
final String getUniqueID()
Returns a unique ID object of this device using type, connection and unitID as it's key components.
final void unlock()
Optionally unlocking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#unlock()....
final void lock()
Optionally locking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#lock()....
ToolkitLock setToolkitLock(final ToolkitLock locker)
Set the internal ToolkitLock, which is used within the lock() and unlock() implementation.
final String getType()
Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory....
DefaultGraphicsDevice(final String type, final String connection, final int unitID, final long handle)
Create an instance with the system default ToolkitLock.
DefaultGraphicsDevice(final String type, final String connection, final int unitID, final long handle, final ToolkitLock locker)
Create an instance with the given ToolkitLock instance, or null ToolkitLock if null.
final int getUnitID()
Returns the graphics device unit ID.
final void validateLocked()
final String getConnection()
Returns the semantic GraphicsDevice connection.
static final void swapHandleAndOwnership(final DefaultGraphicsDevice a, final DefaultGraphicsDevice b)
final long setHandle(final long newHandle)
Set the native handle of the underlying native device and return the previous one.
DefaultGraphicsDevice(final String type, final String connection, final int unitID)
Create an instance with the system default ToolkitLock, gathered via NativeWindowFactory#getDefaultTo...
final long getHandle()
Returns the native handle of the underlying native device, if such thing exist.
final Object getHandleOwnership()
final ToolkitLock getToolkitLock()
final void clearHandleOwner()
static String getDefaultDisplayConnection()
Return the default display connection for the given windowing toolkit type gathered via NativeWindowF...
final Object setHandleOwnership(final Object newOwnership)
final boolean isHandleOwner()
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeW...
static ToolkitLock getDefaultToolkitLock()
Provides the system default ToolkitLock for the default system windowing type.
static String getDefaultDisplayConnection()
A interface describing a graphics device in a toolkit-independent manner.