Top Inners Fields Constructors Methods
org.lwjgl.opengl

pack-priv final Class LinuxDisplay

extends Object
implements DisplayImplementation
Class Inheritance
All Implemented Interfaces
org.lwjgl.opengl.DisplayImplementation, org.lwjgl.opengl.InputImplementation
Imports
java.awt.Canvas, java.awt.event.FocusListener, .FocusEvent, java.io.BufferedReader, .IOException, .InputStreamReader, java.nio.ByteOrder, .ByteBuffer, .FloatBuffer, .IntBuffer, java.lang.reflect.InvocationTargetException, org.lwjgl.BufferUtils, .LWJGLException, .LWJGLUtil, .MemoryUtil, org.lwjgl.opengl.XRandR.Screen, org.lwjgl.opengles.EGL, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .List

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
LinuxDisplay.Compiz

Helper class for managing Compiz's workarounds.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
private long
private static final int
private static final int
private boolean
private long
private int
current_displaymode_extension

Current mode swithcing API

private ByteBuffer
private DisplayMode
private static long
private static int
current_window_mode

Current window mode

public static final int
private long
delete_atom

Atom used for the pointer warp messages

private boolean
private static long
display

Current X11 Display pointer

private static int
private final LinuxEvent
event_buffer

Event buffer

private final FocusListener
private boolean
private static final int
FULLSCREEN_LEGACY

Window mode enum

private static final int
private boolean
public static final int
private boolean
private LinuxKeyboard
private boolean
private static final int
private static final int
private long
private boolean
private LinuxMouse
private boolean
public static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private Canvas
private boolean
private boolean
private long
private long
private PeerInfo
private boolean
private boolean
private boolean
private static long
private ByteBuffer
saved_gamma

Saved gamma used to restore display settings

private DisplayMode
saved_mode

Saved mode to restore with

private static final int
private static final int
private static final int
private final LinuxEvent
private int
private int
private int
private int
private static final int
private String
private static final int
private static boolean
private static final int
private static final int
XRANDR

Display mode switching API

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
public void
private static native int
callErrorHandler(long handler, long display, long error_ptr)

private void
pack-priv static native void
closeDisplay(long display)

private static ByteBuffer
convertIcons(ByteBuffer[]
Array of icons in RGBA format
icons
)

This method will convert icon bytebuffers into a single bytebuffer as the icon format required by _NET_WM_ICON should be in a cardinal 32 bit ARGB format i.e. all icons in a single buffer the data starting with 32 bit width & height followed by the color data as 32bit ARGB.

private static ByteBuffer
private static long
public Object
createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays)

Implements org.lwjgl.opengl.InputImplementation.createCursor.

Native cursor handles
public void
createKeyboard()

Implements org.lwjgl.opengl.InputImplementation.createKeyboard.

Method to create the keyboard
public void
createMouse()

Implements org.lwjgl.opengl.InputImplementation.createMouse.

Method to create the mouse.
public PeerInfo
createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs)

Implements org.lwjgl.opengl.DisplayImplementation.createPbuffer.

Method to create a Pbuffer
public PeerInfo
createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs)

Implements org.lwjgl.opengl.DisplayImplementation.createPeerInfo.

Create the native PeerInfo.
public void
pack-priv static void
public void
public void
destroyKeyboard()

Implements org.lwjgl.opengl.InputImplementation.destroyKeyboard.

Method to destroy the keyboard
public void
destroyMouse()

Implements org.lwjgl.opengl.InputImplementation.destroyMouse.

Method the destroy the mouse
public void
private void
doSetGamma(ByteBuffer native_gamma)

public String
getAdapter()

Implements org.lwjgl.opengl.DisplayImplementation.getAdapter.

Get the driver adapter string.
public DisplayMode[]
private static int
public int
private static native int
getChildCount(long display, long window)

private static ByteBuffer
private static DisplayMode
private static long
getCursorHandle(Object cursor_handle)

pack-priv static int
pack-priv static long
private static native String
getErrorText(long display, long error_code)

public int
getGammaRampLength()

Implements org.lwjgl.opengl.DisplayImplementation.getGammaRampLength.

Return the length of the gamma ramp arrays.
private static long
getHandle(Canvas parent)

public int
public int
getMaxCursorSize()

Implements org.lwjgl.opengl.InputImplementation.getMaxCursorSize.

Method returning the maximum cursor size
public int
getMinCursorSize()

Implements org.lwjgl.opengl.InputImplementation.getMinCursorSize.

Method returning the minimum cursor size
public int
private static native long
getParentWindow(long display, long window)

public int
public float
private static native long
getRootWindow(long display, int screen)

public String
public int
pack-priv static long
private int
getWindowMode(boolean fullscreen)

public int
public int
private static int
globalErrorHandler(long display, long event_ptr, long error_display, long serial, long error_code, long request_code, long minor_code)

private void
public void
private void
private static native boolean
hasProperty(long display, long window, long property)

public boolean
hasWheel()

Implements org.lwjgl.opengl.InputImplementation.hasWheel.

Query of wheel support
pack-priv static void
incDisplay()

increment and decrement display usage.

public DisplayMode
init()

Implements org.lwjgl.opengl.DisplayImplementation.init.

Initialize and return the current display mode.
private static long
internAtom(String atom_name, boolean only_if_exists)

public boolean
private static boolean
isAncestorXEmbedded(long window)

public boolean
isBufferLost(PeerInfo handle)

Implements org.lwjgl.opengl.DisplayImplementation.isBufferLost.

Method to test for buffer integrity
public boolean
public boolean
private static boolean
public boolean
private static boolean
private static boolean
private boolean
isParentWindowActive(long
- the window handle to test
window
)

This method will check if the parent window is active when running in xembed mode.

public boolean
private static boolean
private static boolean
pack-priv static void
private static native void
mapRaised(long display, long window)

private static native ByteBuffer
nConvertToNativeRamp(FloatBuffer ramp, int offset, int length)

pack-priv static native long
nCreateBlankCursor(long display, long window)

private static native long
nCreateCursor(long display, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset)

private static native long
nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle, boolean resizable)

private static native void
nDefineCursor(long display, long window, long cursor_handle)

pack-priv static native void
nDestroyCursor(long display, long cursorHandle)

pack-priv static native void
nDestroyWindow(long display, long window)

private static native DisplayMode[]
nGetAvailableDisplayModes(long display, int screen, int extension)

private static native ByteBuffer
nGetCurrentGammaRamp(long display, int screen)

private static native DisplayMode
nGetCurrentXRandrMode(long display, int screen)

Assumes extension == XRANDR

pack-priv static native int
nGetDefaultScreen(long display)

private static native int
nGetGammaRampLength(long display, int screen)

private static native int
nGetHeight(long display, long window)

private static native long
nGetInputFocus(long display)

private static native int
nGetMaxCursorSize(long display, long window)

private static native int
nGetMinCursorSize(long display, long window)

private static native int
private static native int
nGetPbufferCapabilities(long display, int screen)

private static native int
nGetWidth(long display, long window)

private static native int
nGetX(long display, long window)

private static native int
nGetY(long display, long window)

pack-priv static native int
nGrabKeyboard(long display, long window)

pack-priv static native int
nGrabPointer(long display, long window, long cursor)

private static native void
nIconifyWindow(long display, long window, int screen)

pack-priv static native long
nInternAtom(long display, String atom_name, boolean only_if_exists)

private static native boolean
nIsNetWMFullscreenSupported(long display, int screen)

private static native boolean
private static native boolean
nIsXrandrSupported(long display)

private static native void
private static native void
nReshape(long display, long window, int x, int y, int width, int height)

private static native void
nSetClassHint(long display, long window, long wm_name, long wm_class)

private static native void
nSetGammaRamp(long display, int screen, ByteBuffer gammaRamp)

private static native void
nSetInputFocus(long display, long window, long time)

private static native void
nSetTitle(long display, long window, long title, int len)

private static native void
nSetViewPort(long display, long window, int screen)

private static native void
nSetWindowIcon(long display, long window, ByteBuffer icons_data, int icons_size)

private static native void
nSetWindowSize(long display, long window, int width, int height, boolean resizable)

private static native void
nSwitchDisplayMode(long display, int screen, int extension, DisplayMode mode)

private static native void
nSync(long display, boolean throw_away_events)

pack-priv static native int
nUngrabKeyboard(long display)

pack-priv static native int
nUngrabPointer(long display)

private static native void
pack-priv static native long
public void
pollKeyboard(ByteBuffer
the address of a 256-byte buffer to place key states in.
keyDownBuffer
)

Implements org.lwjgl.opengl.InputImplementation.pollKeyboard.

Method to poll the keyboard.
public void
pollMouse(IntBuffer coord_buffer, ByteBuffer buttons)

Implements org.lwjgl.opengl.InputImplementation.pollMouse.

Method to poll the mouse
private void
public void
readKeyboard(ByteBuffer buffer)

Implements org.lwjgl.opengl.InputImplementation.readKeyboard.

Method to read the keyboard buffer
public void
readMouse(ByteBuffer buffer)

Implements org.lwjgl.opengl.InputImplementation.readMouse.

Method to read the mouse buffer
private void
relayEventToParent(LinuxEvent event_buffer, int event_mask)

private void
private void
public void
private static native void
reparentWindow(long display, long window, long parent, int x, int y)

public void
resetDisplayMode()

Implements org.lwjgl.opengl.DisplayImplementation.resetDisplayMode.

Reset the display mode to whatever it was when LWJGL was initialized.
private static native long
resetErrorHandler(long handler)

public void
reshape(int x, int y, int width, int height)

Implements org.lwjgl.opengl.DisplayImplementation.reshape.

private void
setClassHint(String wm_name, String wm_class)

the WM_CLASS hint is needed by some WM's e.g. gnome shell

public void
setCursorPosition(int x, int y)

Implements org.lwjgl.opengl.InputImplementation.setCursorPosition.

Method to set the native cursor position
private static native long
private void
setFocused(boolean got_focus, int focus_detail)

public void
setGammaRamp(FloatBuffer gammaRamp)

Implements org.lwjgl.opengl.DisplayImplementation.setGammaRamp.

Method to set the gamma ramp.
private static void
public int

Returns:

number of icons used.
setIcon
(ByteBuffer[]
Array of icons in RGBA mode
icons
)

Implements org.lwjgl.opengl.DisplayImplementation.setIcon.

Sets one or more icons for the Display.
private void
setInputFocusUnsafe(long window)

public void
setNativeCursor(Object handle)

Implements org.lwjgl.opengl.InputImplementation.setNativeCursor.

Method to set the native cursor
public void
public void
setResizable(boolean
set to true to make the Display window resizable; false to disable resizing on the Display window.
resizable
)

Implements org.lwjgl.opengl.DisplayImplementation.setResizable.

Enable or disable the Display window to be resized.
public void
setTitle(String title)

Implements org.lwjgl.opengl.DisplayImplementation.setTitle.

Implementation of setTitle().
private boolean
private boolean
public void
private void
private static native void
synchronize(long display, boolean synchronize)

private void
private void
pack-priv static void
public void
update()

Implements org.lwjgl.opengl.DisplayImplementation.update.

Updates the windows internal state.
private void
private void
private void
private void
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait