Top Fields Constructors Methods
com.jogamp.nativewindow.swt

public Class SWTAccessor

extends Object
Class Inheritance
Imports
com.jogamp.common.os.Platform, java.lang.reflect.Field, .Method, java.security.AccessController, .PrivilegedAction, org.eclipse.swt.graphics.GCData, .Rectangle, org.eclipse.swt.widgets.Control, com.jogamp.nativewindow.AbstractGraphicsScreen, .NativeWindowException, .AbstractGraphicsDevice, .NativeWindowFactory, .VisualIDHolder, com.jogamp.common.util.ReflectionUtil, .VersionNumber, com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice, com.jogamp.nativewindow.windows.WindowsGraphicsDevice, com.jogamp.nativewindow.x11.X11GraphicsDevice, jogamp.nativewindow.macosx.OSXUtil, jogamp.nativewindow.x11.X11Lib

Field Summary

Modifier and TypeField and Description
private static final boolean
private static final VersionNumber
private static final VersionNumber
private static final VersionNumber
public static final boolean
public static final boolean
public static final boolean
public static final boolean
private static final String
private static final Method
private static final Method
private static final Method
private static final Method
private static final Method
private static final Method
public static final Class<?>
public static final VersionNumber
private static final Method
private static final Method
private static final Method
private static final Method
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final Field
private static final Method
private static final Method
private static Field
private static Object
private static Field
private static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static long
callStaticMethodL2L(final Method m, final long arg)

private static void
callStaticMethodL2V(final Method m, final long arg)

private static void
callStaticMethodLLZ2V(final Method m, final long arg0, final long arg1, final boolean arg3)

public static long
createCompatibleGDKChildWindow(final Control swtControl, final int visualID, final int width, final int height)

public static long
createCompatibleX11ChildWindow(final AbstractGraphicsScreen screen, final Control swtControl, final int visualID, final int width, final int height)

public static void
destroyGDKWindow(final long gdkWindow)

public static void
destroyX11Window(final AbstractGraphicsDevice device, final long x11Window)

public static void
disposeGC(final Control swtControl, final long gc, final GCData gcData)

public static void
focusGDKWindow(final long gdkWindow)

public static long
gdk_widget_get_window(final long handle)

public static long
gdk_window_get_xdisplay(final long window)

public static long
gdk_window_get_xwindow(final long window)

public static void
gdk_window_set_back_pixmap(final long window, final long pixmap, final boolean parent_relative)

public static AbstractGraphicsDevice

Returns:

the AbstractGraphicsDevice w/ the native device handle
getDevice
(final Control
the SWT Control to retrieve the native device handle from
swtControl
)

public static long

Returns:

the native widget-handle
getHandle
(final Control
the SWT Control to retrieve the native widget-handle from
swtControl
)

private static Number
getIntOrLong(final long arg)

public static int
getNativeVisualID(final AbstractGraphicsDevice device, final long windowHandle)

public static AbstractGraphicsScreen
getScreen(final AbstractGraphicsDevice device, final int
-1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
screen
)

public static long

Returns:

the native window handle
getWindowHandle
(final Control
the SWT Control to retrieve the native window handle from
swtControl
)

private static VersionNumber
GTK_VERSION(final int version)

public static VersionNumber
public static void
invoke(final boolean wait, final Runnable runnable)

Runs the specified action in an SWT compatible thread, which is:

  • Mac OSX
    • Main Thread: Run on OSX UI main thread. 'wait' is implemented on Java site via lock/wait on RunnableTask to not freeze OSX main thread.
public static void
invoke(final Display display, final boolean wait, final Runnable runnable)

Runs the specified action on the SWT UI thread.

public static boolean
public static long
newGC(final Control swtControl, final GCData gcData)

public static void
resizeGDKWindow(final Rectangle clientArea, final long gdkWindow)

public static void
resizeX11Window(final AbstractGraphicsDevice device, final Rectangle clientArea, final long x11Window)

public static void
setRealized(final Control swtControl, final boolean realize)

public static void
showGDKWindow(final long gdkWindow)

public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUGback to summary
private static final boolean DEBUG
GTK_VERSION_2_14_0back to summary
private static final VersionNumber GTK_VERSION_2_14_0
GTK_VERSION_2_24_0back to summary
private static final VersionNumber GTK_VERSION_2_24_0
GTK_VERSION_3_0_0back to summary
private static final VersionNumber GTK_VERSION_3_0_0
isOSXback to summary
public static final boolean isOSX
isWindowsback to summary
public static final boolean isWindows
isX11back to summary
public static final boolean isX11
isX11GTKback to summary
public static final boolean isX11GTK
nwtback to summary
private static final String nwt
OS_gdk_window_get_displayback to summary
private static final Method OS_gdk_window_get_display
OS_gdk_window_set_back_pixmapback to summary
private static final Method OS_gdk_window_set_back_pixmap
OS_gdk_x11_display_get_xdisplayback to summary
private static final Method OS_gdk_x11_display_get_xdisplay
OS_gdk_x11_drawable_get_xdisplayback to summary
private static final Method OS_gdk_x11_drawable_get_xdisplay
OS_gdk_x11_drawable_get_xidback to summary
private static final Method OS_gdk_x11_drawable_get_xid
OS_gdk_x11_window_get_xidback to summary
private static final Method OS_gdk_x11_window_get_xid
OS_gtk_classback to summary
public static final Class<?> OS_gtk_class
OS_gtk_versionback to summary
public static final VersionNumber OS_gtk_version
OS_gtk_widget_get_windowback to summary
private static final Method OS_gtk_widget_get_window
OS_gtk_widget_realizeback to summary
private static final Method OS_gtk_widget_realize
OS_gtk_widget_unrealizeback to summary
private static final Method OS_gtk_widget_unrealize
OS_GTK_WIDGET_WINDOWback to summary
private static final Method OS_GTK_WIDGET_WINDOW
str_gdk_window_get_displayback to summary
private static final String str_gdk_window_get_display
str_gdk_window_set_back_pixmapback to summary
private static final String str_gdk_window_set_back_pixmap
str_gdk_x11_display_get_xdisplayback to summary
private static final String str_gdk_x11_display_get_xdisplay
str_gdk_x11_drawable_get_xdisplayback to summary
private static final String str_gdk_x11_drawable_get_xdisplay
str_gdk_x11_drawable_get_xidback to summary
private static final String str_gdk_x11_drawable_get_xid
str_gdk_x11_window_get_xidback to summary
private static final String str_gdk_x11_window_get_xid
str_gtk_widget_get_windowback to summary
private static final String str_gtk_widget_get_window
str_gtk_widget_realizeback to summary
private static final String str_gtk_widget_realize
str_gtk_widget_unrealizeback to summary
private static final String str_gtk_widget_unrealize
str_GTK_WIDGET_WINDOWback to summary
private static final String str_GTK_WIDGET_WINDOW
str_handleback to summary
private static final String str_handle
str_internal_dispose_GCback to summary
private static final String str_internal_dispose_GC
str_internal_new_GCback to summary
private static final String str_internal_new_GC
str_OS_gtk_classback to summary
private static final String str_OS_gtk_class
str_OS_gtk_versionback to summary
private static final String str_OS_gtk_version
str_osx_idback to summary
private static final String str_osx_id
str_osx_viewback to summary
private static final String str_osx_view
swt_control_handleback to summary
private static final Field swt_control_handle
swt_control_internal_dispose_GCback to summary
private static final Method swt_control_internal_dispose_GC
swt_control_internal_new_GCback to summary
private static final Method swt_control_internal_new_GC
swt_osx_control_viewback to summary
private static Field swt_osx_control_view
swt_osx_initback to summary
private static Object swt_osx_init
swt_osx_view_idback to summary
private static Field swt_osx_view_id
swt_uses_long_handlesback to summary
private static final boolean swt_uses_long_handles

Constructor Detail

SWTAccessorback to summary
public SWTAccessor()

Method Detail

callStaticMethodL2Lback to summary
private static long callStaticMethodL2L(final Method m, final long arg)
callStaticMethodL2Vback to summary
private static void callStaticMethodL2V(final Method m, final long arg)
callStaticMethodLLZ2Vback to summary
private static void callStaticMethodLLZ2V(final Method m, final long arg0, final long arg1, final boolean arg3)
createCompatibleGDKChildWindowback to summary
public static long createCompatibleGDKChildWindow(final Control swtControl, final int visualID, final int width, final int height)
createCompatibleX11ChildWindowback to summary
public static long createCompatibleX11ChildWindow(final AbstractGraphicsScreen screen, final Control swtControl, final int visualID, final int width, final int height)
destroyGDKWindowback to summary
public static void destroyGDKWindow(final long gdkWindow)
destroyX11Windowback to summary
public static void destroyX11Window(final AbstractGraphicsDevice device, final long x11Window)
disposeGCback to summary
public static void disposeGC(final Control swtControl, final long gc, final GCData gcData)
focusGDKWindowback to summary
public static void focusGDKWindow(final long gdkWindow)
gdk_widget_get_windowback to summary
public static long gdk_widget_get_window(final long handle)
gdk_window_get_xdisplayback to summary
public static long gdk_window_get_xdisplay(final long window)
gdk_window_get_xwindowback to summary
public static long gdk_window_get_xwindow(final long window)
gdk_window_set_back_pixmapback to summary
public static void gdk_window_set_back_pixmap(final long window, final long pixmap, final boolean parent_relative)
getDeviceback to summary
public static AbstractGraphicsDevice getDevice(final Control swtControl) throws NativeWindowException, UnsupportedOperationException
Parameters
swtControl:Control

the SWT Control to retrieve the native device handle from

Returns:AbstractGraphicsDevice

the AbstractGraphicsDevice w/ the native device handle

Exceptions
NativeWindowException:
if the widget handle is null
UnsupportedOperationException:
if the windowing system is not supported
getHandleback to summary
public static long getHandle(final Control swtControl) throws NativeWindowException
Parameters
swtControl:Control

the SWT Control to retrieve the native widget-handle from

Returns:long

the native widget-handle

Exceptions
NativeWindowException:
if the widget handle is null
getIntOrLongback to summary
private static Number getIntOrLong(final long arg)
getNativeVisualIDback to summary
public static int getNativeVisualID(final AbstractGraphicsDevice device, final long windowHandle)
getScreenback to summary
public static AbstractGraphicsScreen getScreen(final AbstractGraphicsDevice device, final int screen)
Parameters
screen:int

-1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen

getWindowHandleback to summary
public static long getWindowHandle(final Control swtControl) throws NativeWindowException, UnsupportedOperationException
Parameters
swtControl:Control

the SWT Control to retrieve the native window handle from

Returns:long

the native window handle

Exceptions
NativeWindowException:
if the widget handle is null
UnsupportedOperationException:
if the windowing system is not supported
GTK_VERSIONback to summary
private static VersionNumber GTK_VERSION(final int version)
GTK_VERSIONback to summary
public static VersionNumber GTK_VERSION()
invokeback to summary
public static void invoke(final boolean wait, final Runnable runnable)

Runs the specified action in an SWT compatible thread, which is:

  • Mac OSX
    • Main Thread: Run on OSX UI main thread. 'wait' is implemented on Java site via lock/wait on RunnableTask to not freeze OSX main thread.
  • Linux, Windows, ..
    • Current thread.
See Also
Platform#AWT_AVAILABLE, Platform#getOSType()
invokeback to summary
public static void invoke(final Display display, final boolean wait, final Runnable runnable)

Runs the specified action on the SWT UI thread.

If display is disposed or the current thread is the SWT UI thread invoke(boolean, Runnable) is being used.

See Also
invoke(boolean, Runnable)
isUsingLongHandlesback to summary
public static boolean isUsingLongHandles()
newGCback to summary
public static long newGC(final Control swtControl, final GCData gcData)
resizeGDKWindowback to summary
public static void resizeGDKWindow(final Rectangle clientArea, final long gdkWindow)
resizeX11Windowback to summary
public static void resizeX11Window(final AbstractGraphicsDevice device, final Rectangle clientArea, final long x11Window)
setRealizedback to summary
public static void setRealized(final Control swtControl, final boolean realize) throws NativeWindowException
showGDKWindowback to summary
public static void showGDKWindow(final long gdkWindow)
useX11GTKback to summary
public static boolean useX11GTK()