Top Fields Constructors Methods
jogamp.newt.driver.x11

public Class WindowDriver

extends WindowImpl
Class Inheritance
Imports
java.nio.Buffer, jogamp.nativewindow.x11.X11Lib, .X11Util, jogamp.newt.DisplayImpl, .DisplayImpl.DisplayRunnable, .PointerIconImpl, .WindowImpl, jogamp.newt.driver.PNGIcon, com.jogamp.nativewindow.*, .VisualIDHolder.VIDType, com.jogamp.nativewindow.util.InsetsImmutable, .Point, com.jogamp.common.ExceptionUtils, com.jogamp.common.nio.Buffers, com.jogamp.nativewindow.x11.X11GraphicsDevice, .X11GraphicsScreen, com.jogamp.newt.NewtFactory, com.jogamp.newt.event.InputEvent, .KeyEvent, .MouseEvent

Field Summary

Modifier and TypeField and Description
private static final Buffer
private static final int
private volatile long
javaWindowHandle

Of native type JavaWindow, containing 'jobject window', X11 Window, beside other states.

private X11GraphicsDevice
pack-priv volatile boolean
private static final String
private static final int
private static final int
private static final int
private static final int
Inherited from jogamp.newt.WindowImpl:
capabilitiesChoosercapsRequestedCHANGE_MASK_ALWAYSONBOTTOMCHANGE_MASK_ALWAYSONTOPCHANGE_MASK_DECORATIONCHANGE_MASK_FULLSCREENCHANGE_MASK_MAXIMIZED_HORZCHANGE_MASK_MAXIMIZED_VERTCHANGE_MASK_PARENTINGCHANGE_MASK_RESIZABLECHANGE_MASK_STICKYCHANGE_MASK_VISIBILITYCHANGE_MASK_VISIBILITY_FASTDEBUG_TEST_REPARENT_INCOMPATIBLEhasPixelScalekeyboardVisiblemaxPixelScaleminimumReconfigStateMaskminPixelScaleQUIRK_BIT_VISIBILITYquirksreqPixelScaleSTATE_BIT_COUNT_ALL_PUBLICSTATE_BIT_COUNT_ALL_RECONFIGSTATE_BIT_FULLSCREEN_SPANSTATE_MASK_ALL_PUBLICSTATE_MASK_ALL_PUBLIC_SUPPORTEDSTATE_MASK_ALL_RECONFIGSTATE_MASK_CREATENATIVEsupportedReconfigStateMaskwindowList

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
private native void
CloseWindow0(long display, long javaWindowHandle, final int randr_event_base, final int randr_error_base)

private static native boolean
confinePointer0(long display, long javaWindowHandle, boolean grab)

protected boolean
protected void
createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.
private long[]
CreateWindow(final long parentWindowHandle, final long display, final int screen_index, final int visualID, final long javaObjectAtom, final long windowDeleteAtom, final int x, final int y, final int width, final int height, final int flags, final int pixelDataSize, final Buffer pixels, final boolean verbose)

private native long[]
CreateWindow0(long parentWindowHandle, long display, int screen_index, int visualID, long javaObjectAtom, long windowDeleteAtom, int x, int y, int width, int height, int flags, int pixelDataSize, Object pixels, int pixels_byte_offset, boolean pixels_is_direct, boolean verbose)

returns long[2] { X11-window-handle, JavaWindow-handle }

protected final void
doMouseEvent(final boolean
if true, event will be enqueued, otherwise consumed directly.
enqueue
,
final boolean
if true wait until consumed.
wait
,
short eventType, int modifiers, final int x, final int y, short button, final float[] rotationXYZ, final float rotationScale)

Overrides jogamp.newt.WindowImpl.doMouseEvent.

Send mouse event (one-pointer) either to be directly consumed or to be enqueued
private static final void
public final void
enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

Overrides jogamp.newt.WindowImpl.enqueueKeyEvent.

protected void
focusChanged(final boolean defer, final boolean focusGained)

Overrides jogamp.newt.WindowImpl.focusChanged.

Deal w/ tempAlwaysOnTop.

private static final String
protected Point
getLocationOnScreenImpl(final int x, final int y)

Implements abstract jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.
private static native int
GetSupportedReconfigMask0(long javaWindowHandle)

protected final int
getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.
protected static native boolean
private static native void
reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long javaWindowHandle, int x, int y, int width, int height, int flags)

protected boolean
reconfigureWindowImpl(final int
client-area position in window units, or <0 if unchanged
x
,
final int
client-area position in window units, or <0 if unchanged
y
,
final int
client-area size in window units, or <=0 if unchanged
width
,
final int
client-area size in window units, or <=0 if unchanged
height
,
int
bitfield of change and status flags
flags
)

Implements abstract jogamp.newt.WindowImpl.reconfigureWindowImpl.

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.
protected void
reparentNotify(final long newParentWindowHandle)

private static native void
requestFocus0(long display, long javaWindowHandle, boolean force)

protected void
requestFocusImpl(final boolean
if true, bypass focusChanged(boolean, boolean) and force focus request
force
)

Implements abstract jogamp.newt.WindowImpl.requestFocusImpl.

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.
private final <T> T
protected final void
sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar0, final String keyString)

Called by native TK

public final void
sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

Overrides jogamp.newt.WindowImpl.sendKeyEvent.

private static native void
setPointerIcon0(long display, long javaWindowHandle, long handle)

protected void
private static native boolean
setPointerVisible0(long display, long javaWindowHandle, boolean visible)

protected boolean
private static native void
setTitle0(long display, long javaWindowHandle, String title)

protected void
private static native void
warpPointer0(long display, long javaWindowHandle, int x, int y)

protected void
warpPointerImpl(final int x, final int y)

Overrides jogamp.newt.WindowImpl.warpPointerImpl.

Inherited from jogamp.newt.WindowImpl:
addChildaddGestureHandleraddGestureHandleraddGestureListeneraddGestureListeneraddKeyListeneraddKeyListeneraddMouseListeneraddMouseListeneraddSurfaceUpdatedListeneraddSurfaceUpdatedListeneraddWindowListeneraddWindowListenerappendStateBitsareDefaultGesturesEnabledautoPositioncanCreateNativeImplconfinePointerconsumeEventconsumeKeyEventconsumePointerEventconsumeWindowEventconvertToPixelUnitsconvertToPixelUnitsconvertToWindowUnitsconvertToWindowUnitscreatecreatedefinePositiondefineSizedestroydestroydoMouseEventdoPointerEventdoPointerEventenqueueEventenqueueMouseEventenqueueWindowEventfocusVisibleChangedgetBoundsgetChosenCapabilitiesgetCurrentSurfaceScalegetDefaultCloseOperationgetDelegatedWindowgetDisplayHandlegetGraphicsConfigurationgetHeightgetInsetsgetKeyListenergetKeyListenersgetLifecycleHookgetLocationOnScreengetLockgetMainMonitorgetMaximumSurfaceScalegetMinimumSurfaceScalegetMouseListenergetMouseListenersgetNativeSurfacegetParentgetParentWindowHandlegetPixelScaleXgetPixelScaleYgetPixelsPerMMgetPointerIcongetReconfigStateMaskStringgetReconfigureMaskgetRequestedCapabilitiesgetRequestedSurfaceScalegetScreengetScreenIndexgetStateMaskgetStateMaskStringgetStatePublicBitCountgetStatePublicBitmaskgetSupportedStateMaskgetSupportedStateMaskStringgetSurfaceHandlegetSurfaceHeightgetSurfaceLockOwnergetSurfaceWidthgetThreadNamegetTitlegetWidthgetWindowHandlegetWindowListenergetWindowListenersgetWrappedSurfacegetXgetYhasDeviceChangedhasFocusinsetsChangedinsetsVisibleChangedinstantiationFinishedImplisAlwaysOnBottomisAlwaysOnTopisChildWindowisFullscreenisKeyboardVisibleisKeyCodeTrackedisKeyPressedisMaximizedHorzisMaximizedVertisNativeValidisOffscreenInstanceisPointerConfinedisPointerVisibleisReconfigureMaskSupportedisResizableisStickyisSurfaceLockedByOtherThreadisUndecoratedisVisiblekeyboardVisibilityChangedlockSurfacelockSurfaceImplmaximizedChangedmonitorModeChangedpixelScaleChangeNotifypositionChangedreconfigMaximizedManualremoveChildremoveGestureHandlerremoveGestureListenerremoveKeyListenerremoveMouseListenerremoveSurfaceUpdatedListenerremoveWindowListenerreparentWindowrequestFocusrequestFocusresetMaximizedManualrunOnEDTIfAvailsendMouseEventsendMouseEventRequestFocussendWindowEventsetAlwaysOnBottomsetAlwaysOnTopsetBrokenFocusChangesetCapabilitiesChoosersetDefaultCloseOperationsetDefaultGesturesEnabledsetFocusActionsetFullscreensetFullscreensetGraphicsConfigurationsetKeyboardFocusHandlersetKeyboardVisiblesetKeyboardVisibleImplsetKeyPressedsetLifecycleHooksetMaximizedsetPointerIconsetPointerVisiblesetPositionsetResizablesetScreensetSizesetStickysetSurfaceScalesetSurfaceSizesetTitlesetTopLevelPositionsetTopLevelSizesetUndecoratedsetVisiblesetVisiblesetVisibleImplsetWindowDestroyNotifyActionsetWindowHandleshutdownAllsizeChangedsizePosInsetsFocusVisibleChangedsizePosMaxInsetsVisibleChangedsurfaceSwapsurfaceUpdatedtoHexStringtoHexStringtoStringunlockSurfaceunlockSurfaceImplvisibleChangedvisibleChangedSendMouseEventvisibleChangedWindowRepaintwarpPointerwindowDestroyNotifywindowRepaintwindowRepaint

Field Detail

defaultIconDataback to summary
private static final Buffer defaultIconData
defaultIconDataSizeback to summary
private static final int defaultIconDataSize
javaWindowHandleback to summary
private volatile long javaWindowHandle

Of native type JavaWindow, containing 'jobject window', X11 Window, beside other states.

renderDeviceback to summary
private X11GraphicsDevice renderDevice
tempFSAlwaysOnTopback to summary
pack-priv volatile boolean tempFSAlwaysOnTop
WINDOW_CLASS_NAMEback to summary
private static final String WINDOW_CLASS_NAME
X11_WHEEL_ONE_DOWN_BUTTONback to summary
private static final int X11_WHEEL_ONE_DOWN_BUTTON
X11_WHEEL_ONE_UP_BUTTONback to summary
private static final int X11_WHEEL_ONE_UP_BUTTON
X11_WHEEL_TWO_DOWN_BUTTONback to summary
private static final int X11_WHEEL_TWO_DOWN_BUTTON
X11_WHEEL_TWO_UP_BUTTONback to summary
private static final int X11_WHEEL_TWO_UP_BUTTON

Constructor Detail

WindowDriverback to summary
public WindowDriver()

Method Detail

closeNativeImplback to summary
protected void closeNativeImpl()

Implements abstract jogamp.newt.WindowImpl.closeNativeImpl.

Annotations
@Override
CloseWindow0back to summary
private native void CloseWindow0(long display, long javaWindowHandle, final int randr_event_base, final int randr_error_base)
confinePointer0back to summary
private static native boolean confinePointer0(long display, long javaWindowHandle, boolean grab)
confinePointerImplback to summary
protected boolean confinePointerImpl(final boolean confine)

Overrides jogamp.newt.WindowImpl.confinePointerImpl.

Annotations
@Override
createNativeImplback to summary
protected void createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

Doc from jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.

The implementation shall respect the states isAlwaysOnTop()/FLAG_IS_ALWAYSONTOP and isUndecorated()/FLAG_IS_UNDECORATED, ie. the created window shall reflect those settings.

The implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

Annotations
@Override
CreateWindowback to summary
private long[] CreateWindow(final long parentWindowHandle, final long display, final int screen_index, final int visualID, final long javaObjectAtom, final long windowDeleteAtom, final int x, final int y, final int width, final int height, final int flags, final int pixelDataSize, final Buffer pixels, final boolean verbose)
CreateWindow0back to summary
private native long[] CreateWindow0(long parentWindowHandle, long display, int screen_index, int visualID, long javaObjectAtom, long windowDeleteAtom, int x, int y, int width, int height, int flags, int pixelDataSize, Object pixels, int pixels_byte_offset, boolean pixels_is_direct, boolean verbose)

returns long[2] { X11-window-handle, JavaWindow-handle }

doMouseEventback to summary
protected final void doMouseEvent(final boolean enqueue, final boolean wait, short eventType, int modifiers, final int x, final int y, short button, final float[] rotationXYZ, final float rotationScale)

Overrides jogamp.newt.WindowImpl.doMouseEvent.

Doc from jogamp.newt.WindowImpl.doMouseEvent.

Send mouse event (one-pointer) either to be directly consumed or to be enqueued

Parameters
enqueue:boolean

if true, event will be enqueued, otherwise consumed directly.

wait:boolean

if true wait until consumed.

Annotations
@Override
dumpStackback to summary
private static final void dumpStack()
enqueueKeyEventback to summary
public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

Overrides jogamp.newt.WindowImpl.enqueueKeyEvent.

Annotations
@Override
focusChangedback to summary
protected void focusChanged(final boolean defer, final boolean focusGained)

Overrides jogamp.newt.WindowImpl.focusChanged.

Doc from jogamp.newt.WindowImpl.focusChanged.

Deal w/ tempAlwaysOnTop.

Triggered by implementation's WM events to update the focus state.
Annotations
@Override
getCurrentThreadNameback to summary
private static final String getCurrentThreadName()
getLocationOnScreenImplback to summary
protected Point getLocationOnScreenImpl(final int x, final int y)

Implements abstract jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Doc from jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.

Since the position reflects the client area, it does not include the insets.

May return null, in which case the caller shall traverse through the NativeWindow tree as demonstrated in getLocationOnScreen(com.jogamp.nativewindow.util.Point).

Returns:Point

if not null, the screen location of the given coordinates

Annotations
@Override
GetSupportedReconfigMask0back to summary
private static native int GetSupportedReconfigMask0(long javaWindowHandle)
getSupportedReconfigMaskImplback to summary
protected final int getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Doc from jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.

Default value is STATE_MASK_VISIBLE | STATE_MASK_FOCUSED, i.e. the minimum requirement for all implementations.

Annotations
@Override
initIDs0back to summary
protected static native boolean initIDs0()
reconfigureWindow0back to summary
private static native void reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long javaWindowHandle, int x, int y, int width, int height, int flags)
reconfigureWindowImplback to summary
protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, int flags)

Implements abstract jogamp.newt.WindowImpl.reconfigureWindowImpl.

Doc from jogamp.newt.WindowImpl.reconfigureWindowImpl.

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

Implementations shall set x/y to 0, in case it's negative. This could happen due to insets and positioning a decorated window to 0/0, which would place the frame outside of the screen.

Parameters
x:int

client-area position in window units, or <0 if unchanged

y:int

client-area position in window units, or <0 if unchanged

width:int

client-area size in window units, or <=0 if unchanged

height:int

client-area size in window units, or <=0 if unchanged

flags:int

bitfield of change and status flags

Annotations
@Override
reparentNotifyback to summary
protected void reparentNotify(final long newParentWindowHandle)
requestFocus0back to summary
private static native void requestFocus0(long display, long javaWindowHandle, boolean force)
requestFocusImplback to summary
protected void requestFocusImpl(final boolean force)

Implements abstract jogamp.newt.WindowImpl.requestFocusImpl.

Doc from jogamp.newt.WindowImpl.requestFocusImpl.

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.

If if force == false the native implementation may only request focus if not yet owner.

focusChanged(boolean, boolean) should be called to notify about the focus traversal.

Parameters
force:boolean

if true, bypass focusChanged(boolean, boolean) and force focus request

Annotations
@Override
runWithLockedDisplayDeviceback to summary
private final <T> T runWithLockedDisplayDevice(final DisplayImpl.DisplayRunnable<T> action)
sendKeyEventback to summary
protected final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar0, final String keyString)

Called by native TK

sendKeyEventback to summary
public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

Overrides jogamp.newt.WindowImpl.sendKeyEvent.

Annotations
@Override
setPointerIcon0back to summary
private static native void setPointerIcon0(long display, long javaWindowHandle, long handle)
setPointerIconImplback to summary
protected void setPointerIconImpl(final PointerIconImpl pi)

Overrides jogamp.newt.WindowImpl.setPointerIconImpl.

Annotations
@Override
setPointerVisible0back to summary
private static native boolean setPointerVisible0(long display, long javaWindowHandle, boolean visible)
setPointerVisibleImplback to summary
protected boolean setPointerVisibleImpl(final boolean pointerVisible)

Overrides jogamp.newt.WindowImpl.setPointerVisibleImpl.

Annotations
@Override
setTitle0back to summary
private static native void setTitle0(long display, long javaWindowHandle, String title)
setTitleImplback to summary
protected void setTitleImpl(final String title)

Overrides jogamp.newt.WindowImpl.setTitleImpl.

Annotations
@Override
warpPointer0back to summary
private static native void warpPointer0(long display, long javaWindowHandle, int x, int y)
warpPointerImplback to summary
protected void warpPointerImpl(final int x, final int y)

Overrides jogamp.newt.WindowImpl.warpPointerImpl.

Annotations
@Override