com.jogamp.nativewindow.impl.x11
Class X11Util

java.lang.Object
  extended by com.jogamp.nativewindow.impl.x11.X11Util

public class X11Util
extends Object

Contains a thread safe X11 utility to retrieve thread local display connection,
as well as the static global display connection.
The TLS variant is thread safe per se, but be aware of the memory leak risk where an application heavily utilizing this class on temporary new threads.


Nested Class Summary
static class X11Util.NamedDisplay
           
 
Field Summary
static String nullDisplayName
           
 
Method Summary
static long closeThreadLocalDisplay(long handle)
           
static long closeThreadLocalDisplay(String name)
          Decrease the reference count of this thread named display.
static long createThreadLocalDisplay(String name)
          Returns this thread named display.
static Map getCurrentDisplayMap()
          Returns a clone of the thread local display map, you may Object.wait() on it
static String getNameOfDisplay(long handle)
           
static void initSingleton()
           
static boolean markThreadLocalDisplayUncloseable(long handle)
           
static boolean setSynchronizeDisplay(long handle, boolean onoff)
           
static int shutdown(boolean realXClosePendingDisplays, boolean verbose)
          Returns the number of unclosed X11 Displays.
static String validateDisplayName(String name)
           
static String validateDisplayName(String name, long handle)
           
static void XLockDisplay(long handle)
           
static void XUnlockDisplay(long handle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullDisplayName

public static final String nullDisplayName
Method Detail

initSingleton

public static void initSingleton()

shutdown

public static int shutdown(boolean realXClosePendingDisplays,
                           boolean verbose)
Returns the number of unclosed X11 Displays.

Parameters:
realXClosePendingDisplays - if true, call XCloseDisplay on the remaining ones

getCurrentDisplayMap

public static Map getCurrentDisplayMap()
Returns a clone of the thread local display map, you may Object.wait() on it


createThreadLocalDisplay

public static long createThreadLocalDisplay(String name)
Returns this thread named display. If it doesn not exist, it is being created, otherwise the reference count is increased


closeThreadLocalDisplay

public static long closeThreadLocalDisplay(String name)
Decrease the reference count of this thread named display. If it reaches 0, close it. It returns the handle of the to be closed display. It throws a RuntimeException in case the named display does not exist, or the reference count goes below 0.


closeThreadLocalDisplay

public static long closeThreadLocalDisplay(long handle)

markThreadLocalDisplayUncloseable

public static boolean markThreadLocalDisplayUncloseable(long handle)

validateDisplayName

public static String validateDisplayName(String name)
Returns:
If name is null, it returns the previous queried NULL display name, otherwise the name.

validateDisplayName

public static String validateDisplayName(String name,
                                         long handle)

setSynchronizeDisplay

public static boolean setSynchronizeDisplay(long handle,
                                            boolean onoff)

getNameOfDisplay

public static String getNameOfDisplay(long handle)

XLockDisplay

public static void XLockDisplay(long handle)

XUnlockDisplay

public static void XUnlockDisplay(long handle)


Copyright 2010 JogAmp Community.