Top Description Fields Constructors Methods
com.jogamp.nativewindow.x11

public Class X11GraphicsDevice

extends DefaultGraphicsDevice
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
jogamp.nativewindow.x11.X11Lib, .X11Util, com.jogamp.nativewindow.DefaultGraphicsDevice, .NativeWindowException, .NativeWindowFactory, .ToolkitLock

Encapsulates a graphics device on X11 platforms.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv final boolean
Inherited from com.jogamp.nativewindow.DefaultGraphicsDevice:
connectionhandletoolkitLockuniqueIDunitID

Constructor Summary

AccessConstructor and Description
public
X11GraphicsDevice(final String connection, final int unitID)

Constructs a new X11GraphicsDevice corresponding to the given connection and default com.jogamp.nativewindow.ToolkitLock via NativeWindowFactory#getDefaultToolkitLock(String).

public
X11GraphicsDevice(final long display, final int unitID, final boolean owner)

Constructs a new X11GraphicsDevice corresponding to the given native display handle and default com.jogamp.nativewindow.ToolkitLock via NativeWindowFactory#getDefaultToolkitLock(String, long).

public
X11GraphicsDevice(final long
the Display connection
display
,
final int unitID, final ToolkitLock
custom com.jogamp.nativewindow.ToolkitLock, eg to force null locking w/ private connection
locker
,
final boolean owner)

public
X11GraphicsDevice(final String
the semantic display connection name
displayConnection
,
final int unitID, final ToolkitLock
custom com.jogamp.nativewindow.ToolkitLock, eg to force null locking w/ private connection
locker
)

Constructs a new X11GraphicsDevice corresponding to the given display connection.

Method Summary

Modifier and TypeMethod and Description
public void
public Object
public boolean
close()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.close.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.close.

Optionally closing the device if handle is not null.
public int
getDefaultScreen()

Returns the default screen number as referenced by the display connection, i.e. 'somewhere:0.1' -> 1

Implementation uses the XLib macro DefaultScreen(display).

private static int
getDefaultScreenImpl(final long dpy)

public int
protected Object
public boolean
public final boolean
public boolean
open()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.open.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.open.

Optionally [re]opening the device if handle is null.
protected Object
Inherited from com.jogamp.nativewindow.DefaultGraphicsDevice:
getConnectiongetDefaultDisplayConnectiongetDefaultDisplayConnectiongetHandlegetToolkitLockgetTypegetUniqueIDgetUnitIDlocksetHandlesetToolkitLockswapDeviceHandleAndOwnershiptoStringunlockvalidateLocked

Field Detail

handleOwnerback to summary
pack-priv boolean handleOwner
isXineramaEnabledback to summary
pack-priv final boolean isXineramaEnabled

Constructor Detail

X11GraphicsDeviceback to summary
public X11GraphicsDevice(final String connection, final int unitID)

Constructs a new X11GraphicsDevice corresponding to the given connection and default com.jogamp.nativewindow.ToolkitLock via NativeWindowFactory#getDefaultToolkitLock(String).
Note that this is not an open connection, ie no native display handle exist. This constructor exist to setup a default device connection.

See Also
DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int)
X11GraphicsDeviceback to summary
public X11GraphicsDevice(final long display, final int unitID, final boolean owner)

Constructs a new X11GraphicsDevice corresponding to the given native display handle and default com.jogamp.nativewindow.ToolkitLock via NativeWindowFactory#getDefaultToolkitLock(String, long).

See Also
DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long)
X11GraphicsDeviceback to summary
public X11GraphicsDevice(final long display, final int unitID, final ToolkitLock locker, final boolean owner)
Parameters
display:long

the Display connection

locker:ToolkitLock

custom com.jogamp.nativewindow.ToolkitLock, eg to force null locking w/ private connection

See Also
DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long, ToolkitLock)
X11GraphicsDeviceback to summary
public X11GraphicsDevice(final String displayConnection, final int unitID, final ToolkitLock locker)

Constructs a new X11GraphicsDevice corresponding to the given display connection.

The constructor opens the native connection and takes ownership.

Parameters
displayConnection:String

the semantic display connection name

locker:ToolkitLock

custom com.jogamp.nativewindow.ToolkitLock, eg to force null locking w/ private connection

See Also
DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long, ToolkitLock)

Method Detail

clearHandleOwnerback to summary
public void clearHandleOwner()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.clearHandleOwner.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.clearHandleOwner.

Annotations
@Override
cloneback to summary
public Object clone()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.clone.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
closeback to summary
public boolean close()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.close.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.close.

Doc from com.jogamp.nativewindow.AbstractGraphicsDevice.close.

Optionally closing the device if handle is not null.

The default implementation dispose it's ToolkitLock and sets the handle to null.

Example implementations like com.jogamp.nativewindow.x11.X11GraphicsDevice or com.jogamp.nativewindow.egl.EGLGraphicsDevice issue the native close operation or skip it depending on the handles's ownership.

Returns:boolean

true if the handle was not null and closing was successful, otherwise false.

Annotations
@Override
getDefaultScreenback to summary
public int getDefaultScreen()

Returns the default screen number as referenced by the display connection, i.e. 'somewhere:0.1' -> 1

Implementation uses the XLib macro DefaultScreen(display).

getDefaultScreenImplback to summary
private static int getDefaultScreenImpl(final long dpy)
getDefaultVisualIDback to summary
public int getDefaultVisualID()
getHandleOwnershipback to summary
protected Object getHandleOwnership()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.getHandleOwnership.

Annotations
@Override
isHandleOwnerback to summary
public boolean isHandleOwner()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.isHandleOwner.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.isHandleOwner.

Returns:boolean

Doc from com.jogamp.nativewindow.AbstractGraphicsDevice.isHandleOwner.

true if instance owns the handle to issue close(), otherwise false.

Annotations
@Override
isXineramaEnabledback to summary
public final boolean isXineramaEnabled()
openback to summary
public boolean open()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.open.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.open.

Doc from com.jogamp.nativewindow.AbstractGraphicsDevice.open.

Optionally [re]opening the device if handle is null.

The default implementation is a NOP.

Example implementations like com.jogamp.nativewindow.x11.X11GraphicsDevice or com.jogamp.nativewindow.egl.EGLGraphicsDevice issue the native open operation in case handle is null.

Returns:boolean

true if the handle was null and opening was successful, otherwise false.

Annotations
@Override
setHandleOwnershipback to summary
protected Object setHandleOwnership(final Object newOwnership)

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.setHandleOwnership.

Annotations
@Override