34package com.jogamp.nativewindow.x11;
36import jogamp.nativewindow.x11.X11Lib;
37import jogamp.nativewindow.x11.X11Util;
39import com.jogamp.nativewindow.DefaultGraphicsDevice;
40import com.jogamp.nativewindow.NativeWindowException;
41import com.jogamp.nativewindow.NativeWindowFactory;
42import com.jogamp.nativewindow.ToolkitLock;
48 final boolean isXineramaEnabled;
58 setHandleOwnership(
false);
59 isXineramaEnabled =
false;
80 setHandleOwnership(owner);
81 isXineramaEnabled = X11Util.XineramaIsEnabled(
this);
95 setHandleOwnership(
true);
97 isXineramaEnabled = X11Util.XineramaIsEnabled(
this);
100 private static int getDefaultScreenImpl(
final long dpy) {
101 return X11Lib.DefaultScreen(dpy);
115 final int ds = getDefaultScreenImpl(display);
117 System.err.println(Thread.currentThread().getName() +
" - X11GraphicsDevice.getDefaultDisplay() of "+
this+
": "+ds+
", count "+X11Lib.ScreenCount(display));
127 return X11Lib.DefaultVisualID(display, getDefaultScreenImpl(display));
131 return isXineramaEnabled;
136 return super.clone();
143 System.err.println(Thread.currentThread().getName() +
" - X11GraphicsDevice.open(): "+
this);
158 System.err.println(Thread.currentThread().getName() +
" - X11GraphicsDevice.close(): "+
this);
160 X11Util.closeDisplay(
handle);
162 return super.close();
165 private boolean setHandleOwnership(
final boolean v) {
167 super.setHandleOwnership(v ? Boolean.valueOf(
true) :
null);
168 return null != o ? o.booleanValue() :
false;
final long getHandle()
Returns the native handle of the underlying native device, if such thing exist.
final Object getHandleOwnership()
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 final String TYPE_X11
X11 type, as retrieved with getNativeWindowType(boolean).
Encapsulates a graphics device on X11 platforms.
int getDefaultScreen()
Returns the default screen number as referenced by the display connection, i.e.
boolean close()
Optionally closing the device if handle is not null.
X11GraphicsDevice(final String displayConnection, final int unitID, final ToolkitLock locker)
Constructs a new X11GraphicsDevice corresponding to the given display connection.
boolean open()
Optionally [re]opening the device if handle is null.
X11GraphicsDevice(final long display, final int unitID, final boolean owner)
Constructs a new X11GraphicsDevice corresponding to the given native display handle and default com....
X11GraphicsDevice(final long display, final int unitID, final ToolkitLock locker, final boolean owner)
final boolean isXineramaEnabled()
X11GraphicsDevice(final String connection, final int unitID)
Constructs a new X11GraphicsDevice corresponding to the given connection and default com....
static final boolean DEBUG