|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.newt.impl.WindowImpl
com.jogamp.newt.impl.OffscreenWindow
public class OffscreenWindow
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jogamp.newt.impl.WindowImpl |
---|
WindowImpl.LifecycleHook |
Nested classes/interfaces inherited from interface com.jogamp.newt.Window |
---|
Window.FocusRunnable, Window.ReparentAction |
Field Summary |
---|
Fields inherited from class com.jogamp.newt.impl.WindowImpl |
---|
capabilitiesChooser, capsRequested, config, DEBUG_TEST_REPARENT_INCOMPATIBLE, fullscreen, hasFocus, height, nfs_height, nfs_width, nfs_x, nfs_y, title, undecorated, visible, width, x, y |
Fields inherited from interface com.jogamp.newt.Window |
---|
DEBUG_IMPLEMENTATION, DEBUG_KEY_EVENT, DEBUG_MOUSE_EVENT, DEBUG_WINDOW_EVENT, TIMEOUT_NATIVEWINDOW |
Fields inherited from interface javax.media.nativewindow.NativeSurface |
---|
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED |
Constructor Summary | |
---|---|
OffscreenWindow()
|
Method Summary | |
---|---|
protected void |
closeNativeImpl()
|
protected void |
createNativeImpl()
The native implementation must set the native windowHandle. The implementation should invoke the referenced java state callbacks to notify this Java object of state changes. |
void |
destroy()
Destroy the Window and it's children, incl. |
Point |
getLocationOnScreen(Point storage)
Returns the current absolute location of this window. |
protected Point |
getLocationOnScreenImpl(int x,
int y)
Return screen coordinates of the given coordinates or null, in which case a NativeWindow traversal shall being used as demonstrated in WindowImpl.getLocationOnScreen(javax.media.nativewindow.util.Point) . |
long |
getSurfaceHandle()
Returns the handle to the surface for this NativeSurface. |
protected void |
invalidate(boolean unrecoverable)
|
protected boolean |
reconfigureWindowImpl(int x,
int y,
int width,
int height,
boolean parentChange,
int fullScreenChange,
int decorationChange)
The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes. |
protected void |
requestFocusImpl(boolean reparented)
The native implementation must invoke WindowImpl.focusChanged(boolean)
to change the focus state, if force == false . |
boolean |
setFullscreen(boolean fullscreen)
|
void |
setPosition(int x,
int y)
Sets the location of the top left corner of the window, including decorations (so the client area will be placed at x+insets.left,y+insets.top .This call is ignored if in fullscreen mode. |
void |
setSize(int width,
int height)
Sets the size of the client area of the window, excluding decorations Total size of the window will be width+insets.left+insets.right, height+insets.top+insets.bottom |
void |
setSurfaceHandle(long handle)
|
protected void |
setVisibleImpl(boolean visible,
int x,
int y,
int width,
int height)
The native implementation must invoke WindowImpl.visibleChanged(boolean)
to change the visibility state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OffscreenWindow()
Method Detail |
---|
protected void createNativeImpl()
WindowImpl
createNativeImpl
in class WindowImpl
WindowImpl.windowDestroyNotify()
,
WindowImpl.focusChanged(boolean)
,
WindowImpl.visibleChanged(boolean)
,
#sizeChanged(int,int)
,
WindowImpl.positionChanged(int,int)
,
WindowImpl.windowDestroyNotify()
protected void closeNativeImpl()
closeNativeImpl
in class WindowImpl
protected void invalidate(boolean unrecoverable)
invalidate
in class WindowImpl
unrecoverable
- If true, all states, size, position, parent handles,
reference to it's Screen are reset.
Otherwise you can recreate the window, via setVisible(true)
.WindowImpl.invalidate()
,
WindowImpl.destroy()
,
#destroy(boolean)
public void destroy()
Window
setVisible(true)
.
This method invokes Screen.removeReference()
after it's own destruction,
which will issue Screen.destroy()
if the reference count becomes 0.
This destruction sequence shall end up in Display.destroy()
, if all reference counts become 0.
destroy
in interface Window
destroy
in interface NativeWindow
destroy
in class WindowImpl
Window.invalidate()
,
Window.setVisible(boolean)
public void setSurfaceHandle(long handle)
setSurfaceHandle
in interface SurfaceChangeable
public long getSurfaceHandle()
NativeSurface
The surface handle should be set/update by NativeSurface.lockSurface()
,
where NativeSurface.unlockSurface()
is not allowed to modify it.
After NativeSurface.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.
getSurfaceHandle
in interface NativeSurface
getSurfaceHandle
in class WindowImpl
protected void setVisibleImpl(boolean visible, int x, int y, int width, int height)
WindowImpl
WindowImpl.visibleChanged(boolean)
to change the visibility state. This may happen asynchronous within
Window.TIMEOUT_NATIVEWINDOW
.
setVisibleImpl
in class WindowImpl
protected void requestFocusImpl(boolean reparented)
WindowImpl
WindowImpl.focusChanged(boolean)
to change the focus state, if force == false
.
This may happen asynchronous within Window.TIMEOUT_NATIVEWINDOW
.
requestFocusImpl
in class WindowImpl
reparented
- if true, bypass WindowImpl.focusChanged(boolean)
and force focus requestpublic void setSize(int width, int height)
Window
width+insets.left+insets.right, height+insets.top+insets.bottom
Zero size semantics are respected, see Window.setVisible(boolean)
:
if ( 0 != windowHandle && 0>=width*height && visible ) { setVisible(false); } else if ( 0 == windowHandle && 0This call is ignored if in fullscreen mode.
- Specified by:
setSize
in interfaceWindow
- Specified by:
setSize
in interfaceSurfaceChangeable
- Overrides:
setSize
in classWindowImpl
- Parameters:
width
- of the client area of the windowheight
- of the client area of the window
public void setPosition(int x, int y)
Window
x+insets.left,y+insets.top
.
setPosition
in interface Window
setPosition
in class WindowImpl
x
- coord of the top left cornery
- coord of the top left cornerpublic boolean setFullscreen(boolean fullscreen)
setFullscreen
in interface Window
setFullscreen
in class WindowImpl
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange)
WindowImpl
reconfigureWindowImpl
in class WindowImpl
x
- -1 if no position change requested, otherwise greater than zeroy
- -1 if no position change requested, otherwise greater than zerowidth
- -1 if no size change requested, otherwise greater than zeroheight
- -1 if no size change requested, otherwise greater than zeroparentChange
- true if reparenting requested, otherwise falsefullScreenChange
- 0 if unchanged, -1 fullscreen off, 1 fullscreen ondecorationChange
- 0 if unchanged, -1 undecorated, 1 decorated#sizeChanged(int,int)
,
WindowImpl.positionChanged(int,int)
public Point getLocationOnScreen(Point storage)
NativeWindow
getLocationOnScreen
in interface NativeWindow
getLocationOnScreen
in class WindowImpl
storage
- if not null,
Point.translate(javax.media.nativewindow.util.Point)
the passed Point
by this location on the screen and return it.
protected Point getLocationOnScreenImpl(int x, int y)
WindowImpl
WindowImpl.getLocationOnScreen(javax.media.nativewindow.util.Point)
.
getLocationOnScreenImpl
in class WindowImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |