Top Fields Constructors Methods
jogamp.newt.driver.windows

public Class WindowDriver

extends WindowImpl
Class Inheritance
Imports
java.nio.ByteBuffer, jogamp.nativewindow.windows.GDI, .GDIUtil, jogamp.newt.PointerIconImpl, .WindowImpl, com.jogamp.nativewindow.AbstractGraphicsConfiguration, .GraphicsConfigurationFactory, .NativeWindowException, .VisualIDHolder, com.jogamp.nativewindow.util.InsetsImmutable, .Point, com.jogamp.common.os.Platform, com.jogamp.common.util.VersionNumber, com.jogamp.newt.event.InputEvent, .KeyEvent, .MouseEvent, .MouseEvent.PointerType

Field Summary

Modifier and TypeField and Description
private long
private long
private long
private short
private long
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 static native boolean
confinePointer0(long windowHandle, boolean grab, int l, int t, int r, int b)

protected boolean
protected void
createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.
private native long
CreateWindow0(long hInstance, String wndClassName, String wndName, int winMajor, int winMinor, long parentWindowHandle, int x, int y, int width, int height, int flags)

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 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.
protected static native long
protected final int
getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.
public final long
getSurfaceHandle()

Overrides jogamp.newt.WindowImpl.getSurfaceHandle.

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.
private final boolean
handlePressTypedAutoRepeat(final boolean isModifierKey, int modifiers, final short keyCode, final short keySym, final char keyChar)

public boolean
hasDeviceChanged()

Overrides jogamp.newt.WindowImpl.hasDeviceChanged.

If the implementation is capable of detecting a device change return true and clear the status/reason of the change.
protected static native boolean
initIDs0(long hInstance)

private native void
InitWindow0(long windowHandle, int flags)

protected int
private native long
MonitorFromWindow0(long windowHandle)

private static native ByteBuffer
newDirectByteBuffer(long addr, long capacity)

private native void
reconfigureWindow0(long parentWindowHandle, long windowHandle, int x, int y, int width, int height, int flags)

protected boolean
reconfigureWindowImpl(int
client-area position in window units, or <0 if unchanged
x
,
int
client-area position in window units, or <0 if unchanged
y
,
int
client-area size in window units, or <=0 if unchanged
width
,
int
client-area size in window units, or <=0 if unchanged
height
,
final 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.
private native void
requestFocus0(long windowHandle, 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.
public final void
sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

Overrides jogamp.newt.WindowImpl.sendKeyEvent.

public final void
sendTouchScreenEvent(final short eventType, final int modifiers, final int pActionIdx, final int[] pNames, final int[] pX, final int[] pY, final float[] pPressure, final float maxPressure)

Send multiple-pointer MouseEvent.PointerType#TouchScreen event to be directly consumed

Assumes non normal pointer names and rotation/scroll will be determined by a gesture handler.

private static native void
setPointerIcon0(long windowHandle, long iconHandle)

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

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

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

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

Overrides jogamp.newt.WindowImpl.warpPointerImpl.

Inherited from jogamp.newt.WindowImpl:
addChildaddGestureHandleraddGestureHandleraddGestureListeneraddGestureListeneraddKeyListeneraddKeyListeneraddMouseListeneraddMouseListeneraddSurfaceUpdatedListeneraddSurfaceUpdatedListeneraddWindowListeneraddWindowListenerappendStateBitsareDefaultGesturesEnabledautoPositioncanCreateNativeImplconfinePointerconsumeEventconsumeKeyEventconsumePointerEventconsumeWindowEventconvertToPixelUnitsconvertToPixelUnitsconvertToWindowUnitsconvertToWindowUnitscreatecreatedefinePositiondefineSizedestroydestroydoMouseEventdoMouseEventdoPointerEventdoPointerEventenqueueEventenqueueMouseEventenqueueWindowEventfocusChangedfocusVisibleChangedgetBoundsgetChosenCapabilitiesgetCurrentSurfaceScalegetDefaultCloseOperationgetDelegatedWindowgetDisplayHandlegetGraphicsConfigurationgetHeightgetInsetsgetKeyListenergetKeyListenersgetLifecycleHookgetLocationOnScreengetLockgetMainMonitorgetMaximumSurfaceScalegetMinimumSurfaceScalegetMouseListenergetMouseListenersgetNativeSurfacegetParentgetParentWindowHandlegetPixelScaleXgetPixelScaleYgetPixelsPerMMgetPointerIcongetReconfigStateMaskStringgetReconfigureMaskgetRequestedCapabilitiesgetRequestedSurfaceScalegetScreengetScreenIndexgetStateMaskgetStateMaskStringgetStatePublicBitCountgetStatePublicBitmaskgetSupportedStateMaskgetSupportedStateMaskStringgetSurfaceHeightgetSurfaceLockOwnergetSurfaceWidthgetThreadNamegetTitlegetWidthgetWindowHandlegetWindowListenergetWindowListenersgetWrappedSurfacegetXgetYhasFocusinsetsChangedinsetsVisibleChangedinstantiationFinishedImplisAlwaysOnBottomisAlwaysOnTopisChildWindowisFullscreenisKeyboardVisibleisKeyCodeTrackedisKeyPressedisMaximizedHorzisMaximizedVertisNativeValidisOffscreenInstanceisPointerConfinedisPointerVisibleisReconfigureMaskSupportedisResizableisStickyisSurfaceLockedByOtherThreadisUndecoratedisVisiblekeyboardVisibilityChangedlockSurfacemaximizedChangedmonitorModeChangedpixelScaleChangeNotifypositionChangedreconfigMaximizedManualremoveChildremoveGestureHandlerremoveGestureListenerremoveKeyListenerremoveMouseListenerremoveSurfaceUpdatedListenerremoveWindowListenerreparentWindowrequestFocusrequestFocusresetMaximizedManualrunOnEDTIfAvailsendMouseEventsendMouseEventRequestFocussendWindowEventsetAlwaysOnBottomsetAlwaysOnTopsetBrokenFocusChangesetCapabilitiesChoosersetDefaultCloseOperationsetDefaultGesturesEnabledsetFocusActionsetFullscreensetFullscreensetGraphicsConfigurationsetKeyboardFocusHandlersetKeyboardVisiblesetKeyboardVisibleImplsetKeyPressedsetLifecycleHooksetMaximizedsetPointerIconsetPointerVisiblesetPositionsetResizablesetScreensetSizesetStickysetSurfaceScalesetSurfaceSizesetTitlesetTopLevelPositionsetTopLevelSizesetUndecoratedsetVisiblesetVisiblesetVisibleImplsetWindowDestroyNotifyActionsetWindowHandleshutdownAllsizeChangedsizePosInsetsFocusVisibleChangedsizePosMaxInsetsVisibleChangedsurfaceSwapsurfaceUpdatedtoHexStringtoHexStringtoStringunlockSurfacevisibleChangedvisibleChangedSendMouseEventvisibleChangedWindowRepaintwarpPointerwindowDestroyNotifywindowRepaintwindowRepaint

Field Detail

hdcback to summary
private long hdc
hdc_oldback to summary
private long hdc_old
hmonback to summary
private long hmon
repeatedKeyback to summary
private short repeatedKey
windowHandleCloseback to summary
private long windowHandleClose

Constructor Detail

WindowDriverback to summary
public WindowDriver()

Method Detail

closeNativeImplback to summary
protected void closeNativeImpl()

Implements abstract jogamp.newt.WindowImpl.closeNativeImpl.

Annotations
@Override
confinePointer0back to summary
private static native boolean confinePointer0(long windowHandle, boolean grab, int l, int t, int r, int b)
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
CreateWindow0back to summary
private native long CreateWindow0(long hInstance, String wndClassName, String wndName, int winMajor, int winMinor, long parentWindowHandle, int x, int y, int width, int height, int flags)
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
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
getNewtWndProc0back to summary
protected static native long getNewtWndProc0()
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
getSurfaceHandleback to summary
public final long getSurfaceHandle()

Overrides jogamp.newt.WindowImpl.getSurfaceHandle.

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Doc from com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.

The surface handle should be set/update by lockSurface(), where unlockSurface() is not allowed to modify it. After unlockSurface() it is no more guaranteed that the surface handle is still valid. The surface handle shall reflect the platform one for all drawable surface operations, e.g. opengl, swap-buffer.

On X11 this returns an entity of type Window, since there is no differentiation of surface and window there.
On Microsoft Windows this returns an entity of type HDC.

Annotations
@Override
handlePressTypedAutoRepeatback to summary
private final boolean handlePressTypedAutoRepeat(final boolean isModifierKey, int modifiers, final short keyCode, final short keySym, final char keyChar)
hasDeviceChangedback to summary
public boolean hasDeviceChanged()

Overrides jogamp.newt.WindowImpl.hasDeviceChanged.

Doc from jogamp.newt.WindowImpl.hasDeviceChanged.

If the implementation is capable of detecting a device change return true and clear the status/reason of the change.

Annotations
@Override
initIDs0back to summary
protected static native boolean initIDs0(long hInstance)
InitWindow0back to summary
private native void InitWindow0(long windowHandle, int flags)
lockSurfaceImplback to summary
protected int lockSurfaceImpl()

Overrides jogamp.newt.WindowImpl.lockSurfaceImpl.

Annotations
@Override
MonitorFromWindow0back to summary
private native long MonitorFromWindow0(long windowHandle)
newDirectByteBufferback to summary
private static native ByteBuffer newDirectByteBuffer(long addr, long capacity)
reconfigureWindow0back to summary
private native void reconfigureWindow0(long parentWindowHandle, long windowHandle, int x, int y, int width, int height, int flags)
reconfigureWindowImplback to summary
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, final 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
requestFocus0back to summary
private native void requestFocus0(long windowHandle, 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
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
sendTouchScreenEventback to summary
public final void sendTouchScreenEvent(final short eventType, final int modifiers, final int pActionIdx, final int[] pNames, final int[] pX, final int[] pY, final float[] pPressure, final float maxPressure)

Send multiple-pointer MouseEvent.PointerType#TouchScreen event to be directly consumed

Assumes non normal pointer names and rotation/scroll will be determined by a gesture handler.

See doPointerEvent(boolean, boolean, PointerType[], short, int, int, boolean, int[], int[], int[], float[], float, float[], float) for details.

setPointerIcon0back to summary
private static native void setPointerIcon0(long windowHandle, long iconHandle)
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 windowHandle, 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 windowHandle, String title)
setTitleImplback to summary
protected void setTitleImpl(final String title)

Overrides jogamp.newt.WindowImpl.setTitleImpl.

Annotations
@Override
unlockSurfaceImplback to summary
protected void unlockSurfaceImpl()

Overrides jogamp.newt.WindowImpl.unlockSurfaceImpl.

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

Overrides jogamp.newt.WindowImpl.warpPointerImpl.

Annotations
@Override