29package com.jogamp.newt;
33import com.jogamp.newt.Display.PointerIcon;
34import com.jogamp.newt.event.GestureHandler;
35import com.jogamp.newt.event.WindowEvent;
36import com.jogamp.newt.event.WindowListener;
37import com.jogamp.newt.event.KeyListener;
38import com.jogamp.newt.event.KeyEvent;
39import com.jogamp.newt.event.InputEvent;
40import com.jogamp.newt.event.MouseListener;
42import jogamp.newt.Debug;
43import jogamp.newt.WindowImpl;
45import com.jogamp.nativewindow.CapabilitiesChooser;
46import com.jogamp.nativewindow.CapabilitiesImmutable;
47import com.jogamp.nativewindow.NativeWindow;
48import com.jogamp.nativewindow.ScalableSurface;
49import com.jogamp.nativewindow.WindowClosingProtocol;
50import com.jogamp.nativewindow.util.RectangleImmutable;
51import com.jogamp.nativewindow.util.SurfaceSize;
Visual output device, i.e.
A screen may span multiple MonitorDevices representing their combined virtual size.
Reparenting operation types.
ACTION_NATIVE_CREATION
Native window creation after tree change - instead of reparenting.
ACTION_NATIVE_CREATION_PENDING
Change Window tree only, native creation is pending.
ACTION_NOP
No native reparenting action required, no change.
ACTION_INVALID
No native reparenting valid.
ACTION_NATIVE_REPARENTING
Native reparenting incl.
Provides a mechanism by which applications can customize the window type selection for a given Capabi...
Specifies an immutable set of capabilities that a window's rendering context must support,...
Extend the NativeSurface interface with windowing information such as window-handle,...
Adding mutable surface pixel scale property to implementing class, usually to a NativeSurface impleme...
Protocol for handling window closing events.
Native PointerIcon handle.
Specifying NEWT's Window functionality:
void confinePointer(boolean confine)
Confine the pointer to this window, ie.
Window getDelegatedWindow()
If the implementation uses delegation, return the delegated Window instance, otherwise return this in...
static final boolean DEBUG_MOUSE_EVENT
boolean removeChild(NativeWindow win)
static final int STATE_BIT_UNDECORATED
Set if window has window decorations, otherwise cleared.
static final int STATE_BIT_FULLSCREEN
Set if window is in fullscreen mode, otherwise cleared.
int getStatePublicBitmask()
Bitmask covering all public state bits.
boolean areDefaultGesturesEnabled()
Return true if default GestureHandler are enabled.
void addGestureListener(GestureHandler.GestureListener gl)
Appends the given GestureHandler.GestureListener to the end of the list.
void requestFocus(boolean wait)
Request focus for this native window.
void sendWindowEvent(int eventType)
Send a WindowEvent to all WindowListener.
void setKeyboardFocusHandler(KeyListener l)
Sets a KeyListener allowing focus traversal with a covered window toolkit like AWT.
void setPointerVisible(boolean pointerVisible)
Makes the pointer visible or invisible.
void addKeyListener(KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
static final int STATE_BIT_ALWAYSONTOP
Set if window is always on top, otherwise cleared.
static final int STATE_MASK_ALWAYSONTOP
Bitmask for STATE_BIT_ALWAYSONTOP, {@value}.
String getSupportedStateMaskString()
Returns a string representation of the supported state mask.
boolean isAlwaysOnBottom()
void addGestureHandler(int index, GestureHandler gh)
Inserts the given GestureHandler at the specified position in the list.
static final boolean DEBUG_KEY_EVENT
static final int STATE_BIT_POINTERCONFINED
Set if the pointer is confined to the window, otherwise cleared.
void setTitle(String title)
boolean addChild(NativeWindow win)
static final int STATE_MASK_FOCUSED
Bitmask for STATE_BIT_FOCUSED, {@value}.
PointerIcon getPointerIcon()
Returns the current PointerIcon, which maybe null for the default.
static final int STATE_MASK_RESIZABLE
Bitmask for STATE_BIT_RESIZABLE, {@value}.
KeyListener[] getKeyListeners()
static final int STATE_MASK_REPOSITIONABLE
Bitmask for STATE_BIT_REPOSITIONABLE, {@value}.
static final int STATE_MASK_POINTERCONFINED
Bitmask for STATE_BIT_POINTERCONFINED, {@value}.
MouseListener[] getMouseListeners()
Returns all MouseListener.
KeyListener getKeyListener(int index)
static final long TIMEOUT_NATIVEWINDOW
A 1s timeout while waiting for a native action response, ie setVisible(boolean).
ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints)
Change this window's parent window.
void setTopLevelPosition(int x, int y)
Sets the location of the top-level window inclusive insets (window decorations) in window units.
static final int STATE_BIT_ALWAYSONBOTTOM
Set if window is always on bottom, otherwise cleared.
void setAlwaysOnBottom(boolean value)
StringBuilder toSimpleString(StringBuilder sb)
Appends this class simple string one-line representation to the given StringBuilder instance.
int getSupportedStateMask()
Returns the supported state mask of the implementation.
static final int REPARENT_HINT_BECOMES_VISIBLE
Reparenting hint (bitfield value): Claim window becomes visible after reparenting,...
static final int STATE_MASK_CHILDWIN
Bitmask for STATE_BIT_CHILDWIN, {@value}.
WindowListener[] getWindowListeners()
static final int STATE_MASK_POINTERVISIBLE
Bitmask for STATE_BIT_POINTERVISIBLE, {@value}.
static final int REPARENT_HINT_FORCE_RECREATION
Reparenting hint (bitfield value): Force destroy and hence re-creating the window.
int getStateMask()
Returns the current status mask of this instance.
CapabilitiesImmutable getChosenCapabilities()
Gets an immutable set of chosen capabilities.
void addWindowListener(WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser)
Set the CapabilitiesChooser to help determine the native visual type.
boolean windowRepaint(int x, int y, int width, int height)
Trigger window repaint while passing the dirty region in pixel units.
void setSticky(final boolean value)
void setDefaultGesturesEnabled(boolean enable)
Enable or disable default GestureHandler.
void addMouseListener(int index, MouseListener l)
Inserts the given MouseListener at the specified position in the list.
static final boolean DEBUG_IMPLEMENTATION
void setAlwaysOnTop(boolean value)
static final int STATE_BIT_AUTOPOSITION
Hinting that no custom position has been set before first visibility of this instance.
static final int STATE_BIT_FOCUSED
Set if window has the input focus, otherwise cleared.
void requestFocus()
Request focus for this native window.
boolean setFullscreen(List< MonitorDevice > monitors)
Enable fullscreen mode for this window spanning across the given MonitorDevices or across all Monitor...
boolean isPointerConfined()
void removeGestureHandler(GestureHandler gh)
Removes the given GestureHandler from the list.
static final int STATE_MASK_UNDECORATED
Bitmask for STATE_BIT_UNDECORATED, {@value}.
void setMaximized(final boolean horz, final boolean vert)
static final int STATE_BIT_MAXIMIZED_VERT
Set if window is maximized vertically, otherwise cleared.
void setTopLevelSize(int width, int height)
Sets the size of the top-level window including insets (window decorations) in window units.
void addWindowListener(int index, WindowListener l)
Inserts the given com.jogamp.newt.event.WindowListener at the specified position in the list.
void setResizable(final boolean value)
String toSimpleString()
Returns a simple string one-line representation of this instance using toSimpleString(StringBuilder).
void setFocusAction(FocusRunnable focusAction)
Sets a FocusRunnable, which FocusRunnable#run() method is executed before the native focus is request...
void removeKeyListener(KeyListener l)
void setWindowDestroyNotifyAction(Runnable r)
Set a custom action handling destruction issued by a toolkit triggered window destroy replacing the d...
void setSize(int width, int height)
Sets the size of the window's client area in window units, excluding decorations.
static final int STATE_BIT_POINTERVISIBLE
Set if the pointer is visible when inside the window, otherwise cleared.
MouseListener getMouseListener(int index)
Returns the MouseListener from the list at the given index.
static final int STATE_MASK_MAXIMIZED_VERT
Bitmask for STATE_BIT_MAXIMIZED_VERT, {@value}.
WindowListener getWindowListener(int index)
boolean isMaximizedHorz()
void setVisible(boolean visible)
Calls setVisible(true, visible), i.e.
boolean setFullscreen(boolean fullscreen)
Enable or disable fullscreen mode for this window.
float[] getPixelsPerMM(final float[] ppmmStore)
Returns the pixels per millimeter of this window's NativeSurface according to the main monitor's curr...
static final int STATE_MASK_STICKY
Bitmask for STATE_BIT_STICKY, {@value}.
void addMouseListener(MouseListener l)
Appends the given MouseListener to the end of the list.
MonitorDevice getMainMonitor()
Returns the MonitorDevice with the highest viewport coverage of this window.
boolean isPointerVisible()
void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event)
Enqueues a NEWT event.
boolean isKeyboardVisible()
Return true if the virtual on-screen keyboard is visible, otherwise false.
static final int STATE_BIT_CHILDWIN
Set if window is a child window, i.e.
void setPosition(int x, int y)
Sets the location of the window's client area excluding insets (window decorations) in window units.
static final int STATE_MASK_VISIBLE
Bitmask for STATE_BIT_VISIBLE, {@value}.
void warpPointer(int x, int y)
Moves the pointer to x/y relative to this window's origin in pixel units.
static final int STATE_BIT_MAXIMIZED_HORZ
Set if window is maximized horizontally, otherwise cleared.
static final int STATE_BIT_STICKY
Set if window is sticky, i.e.
void setKeyboardVisible(boolean visible)
In case the platform supports or even requires a virtual on-screen keyboard, this method shows or hid...
CapabilitiesImmutable getRequestedCapabilities()
Gets an immutable set of requested capabilities.
boolean isMaximizedVert()
void removeWindowListener(WindowListener l)
int getStatePublicBitCount()
Number of all public state bits.
void setPointerIcon(final PointerIcon pi)
void setSurfaceSize(int pixelWidth, int pixelHeight)
Sets the size of the window's surface in pixel units which claims the window's client area excluding ...
static final int STATE_BIT_RESIZABLE
Set if window is resizable after creation, otherwise cleared.
void addGestureListener(int index, GestureHandler.GestureListener gl)
Inserts the given GestureHandler.GestureListener at the specified position in the list.
void removeGestureListener(GestureHandler.GestureListener gl)
Removes the given GestureHandler.GestureListener from the list.
String getStateMaskString()
Returns a string representation of the current state mask.
static final int STATE_MASK_ALWAYSONBOTTOM
Bitmask for STATE_BIT_ALWAYSONBOTTOM, {@value}.
void setUndecorated(boolean value)
static final int STATE_BIT_REPOSITIONABLE
Set if window is repositionable after creation, otherwise cleared.
String toString()
Returns a full string multi-line representation of this instance using toString(StringBuilder).
void destroy()
Destroys this window incl.releasing all related resources.
void addGestureHandler(GestureHandler gh)
Appends the given GestureHandler to the end of the list.
void setVisible(boolean wait, boolean visible)
setVisible(..) makes the window and children visible if visible is true, otherwise the window and chi...
static final int STATE_MASK_FULLSCREEN
Bitmask for STATE_BIT_FULLSCREEN, {@value}.
static final int STATE_MASK_AUTOPOSITION
Bitmask for STATE_BIT_AUTOPOSITION, {@value}.
void removeMouseListener(MouseListener l)
Removes the given MouseListener from the list.
StringBuilder toString(StringBuilder sb)
Appends this class full string multi-line representation to the given StringBuilder instance.
void addKeyListener(int index, KeyListener l)
Inserts the given com.jogamp.newt.event.KeyListener at the specified position in the list.
boolean isChildWindow()
Returns true if this window is a child window, i.e.
static final int STATE_BIT_VISIBLE
Visibility of this instance.
void runOnEDTIfAvail(boolean wait, final Runnable task)
static final int STATE_MASK_MAXIMIZED_HORZ
Bitmask for STATE_BIT_MAXIMIZED_HORZ, {@value}.
Listener for GestureEvents.
Generic gesture handler interface designed to allow pass-through filtering of InputEvents.
Listener for MouseEvents.
NEWT WindowEvent listener.