com.jogamp.newt.impl.macosx
Class MacWindow

java.lang.Object
  extended by com.jogamp.newt.Window
      extended by com.jogamp.newt.impl.macosx.MacWindow
All Implemented Interfaces:
NativeWindow, SurfaceUpdatedListener

public class MacWindow
extends Window


Field Summary
 
Fields inherited from class com.jogamp.newt.Window
caps, ClickTimeout, config, DEBUG_IMPLEMENTATION, DEBUG_KEY_EVENT, DEBUG_MOUSE_EVENT, DEBUG_WINDOW_EVENT, fullscreen, height, parentNativeWindow, parentWindowHandle, screen, title, undecorated, visible, width, windowHandle, windowLock, x, y
 
Fields inherited from interface javax.media.nativewindow.NativeWindow
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED
 
Constructor Summary
MacWindow()
           
 
Method Summary
protected  void closeNative()
           
protected  void createNativeImpl()
          Create native windowHandle, ie creates a new native invisible window.
protected  void enqueueKeyEvent(int eventType, int modifiers, int keyCode, char keyChar)
           
 Insets getInsets()
          Returns the insets for this native window (the difference between the size of the toplevel window with the decorations and the client area).
 long getSurfaceHandle()
          Returns the handle to the surface for this NativeWindow.
 long getWindowHandle()
          Returns the window handle for this NativeWindow.
protected static boolean initIDs0()
           
 int lockSurface()
          Recursive and blocking lockSurface() implementation
protected  void requestFocusImpl()
           
protected  boolean setFullscreenImpl(boolean fullscreen, int x, int y, int w, int h)
           
protected  void setPositionImpl(int x, int y)
           
protected  void setSizeImpl(int width, int height)
           
protected  void setTitleImpl(String title)
           
protected  void setVisibleImpl(boolean visible)
           
 void unlockSurface()
          Recursive and unblocking unlockSurface() implementation
 
Methods inherited from class com.jogamp.newt.Window
addChild, addKeyListener, addKeyListener, addMouseListener, addMouseListener, addPaintListener, addPaintListener, addSurfaceUpdatedListener, addSurfaceUpdatedListener, addWindowListener, addWindowListener, create, create, destroy, destroy, enqueueMouseEvent, enqueueWindowEvent, getDisplayHandle, getGraphicsConfiguration, getHeight, getInnerWindow, getKeyListener, getKeyListeners, getLockedStack, getMouseListener, getMouseListeners, getPaintListener, getParentNativeWindow, getRequestedCapabilities, getScreen, getScreenIndex, getSurfaceLockOwner, getSurfaceUpdatedListener, getSurfaceUpdatedListeners, getThreadName, getTitle, getWidth, getWindowListener, getWindowListeners, getWindowLock, getWrappedWindow, getX, getY, hasDeviceChanged, invalidate, invalidate, isDestroyed, isFullscreen, isNativeWindowValid, isSurfaceLocked, isUndecorated, isUndecorated, isVisible, removeAllSurfaceUpdatedListener, removeChild, removeKeyListener, removeMouseListener, removePaintListener, removeSurfaceUpdatedListener, removeWindowListener, reparentWindow, reparentWindowImpl, requestFocus, runOnEDTIfAvail, sendEvent, sendKeyEvent, sendMouseEvent, sendPaintEvent, sendPaintEvent, sendWindowEvent, setFullscreen, setHandleDestroyNotify, setPosition, setSize, setTitle, setUndecorated, setVisible, shouldNotCallThis, surfaceSwap, surfaceUpdated, toHexString, toHexString, toString, windowDestroyed, windowDestroyNotify, windowIsLocked, windowLock, windowUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacWindow

public MacWindow()
Method Detail

createNativeImpl

protected void createNativeImpl()
Description copied from class: Window
Create native windowHandle, ie creates a new native invisible window.

Specified by:
createNativeImpl in class Window

closeNative

protected void closeNative()
Specified by:
closeNative in class Window

getWindowHandle

public long getWindowHandle()
Description copied from interface: NativeWindow
Returns the window handle for this NativeWindow.

The window handle shall reflect the platform one for all window related operations, e.g. open, close, resize.

On X11 this returns an entity of type Window.
On Microsoft Windows this returns an entity of type HWND.

Specified by:
getWindowHandle in interface NativeWindow
Overrides:
getWindowHandle in class Window

getSurfaceHandle

public long getSurfaceHandle()
Description copied from interface: NativeWindow
Returns the handle to the surface for this NativeWindow.

The surface handle should be set/update by NativeWindow.lockSurface(), where NativeWindow.unlockSurface() is not allowed to modify it. After NativeWindow.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.

Specified by:
getSurfaceHandle in interface NativeWindow
Overrides:
getSurfaceHandle in class Window

getInsets

public Insets getInsets()
Description copied from class: Window
Returns the insets for this native window (the difference between the size of the toplevel window with the decorations and the client area).

Overrides:
getInsets in class Window
Returns:
insets for this platform window

lockSurface

public int lockSurface()
                throws NativeWindowException
Description copied from class: Window
Recursive and blocking lockSurface() implementation

Specified by:
lockSurface in interface NativeWindow
Overrides:
lockSurface in class Window
Returns:
NativeWindow.LOCK_SUCCESS, NativeWindow.LOCK_SURFACE_CHANGED or NativeWindow.LOCK_SURFACE_NOT_READY.
Throws:
NativeWindowException - if surface is already locked
See Also:
ToolkitLock

unlockSurface

public void unlockSurface()
Description copied from class: Window
Recursive and unblocking unlockSurface() implementation

Specified by:
unlockSurface in interface NativeWindow
Overrides:
unlockSurface in class Window
See Also:
NativeWindow.lockSurface(), ToolkitLock

setVisibleImpl

protected void setVisibleImpl(boolean visible)
Specified by:
setVisibleImpl in class Window

setTitleImpl

protected void setTitleImpl(String title)
Overrides:
setTitleImpl in class Window

requestFocusImpl

protected void requestFocusImpl()
Overrides:
requestFocusImpl in class Window

setSizeImpl

protected void setSizeImpl(int width,
                           int height)
Specified by:
setSizeImpl in class Window

setPositionImpl

protected void setPositionImpl(int x,
                               int y)
Specified by:
setPositionImpl in class Window

setFullscreenImpl

protected boolean setFullscreenImpl(boolean fullscreen,
                                    int x,
                                    int y,
                                    int w,
                                    int h)
Specified by:
setFullscreenImpl in class Window

enqueueKeyEvent

protected void enqueueKeyEvent(int eventType,
                               int modifiers,
                               int keyCode,
                               char keyChar)
Overrides:
enqueueKeyEvent in class Window

initIDs0

protected static boolean initIDs0()


Copyright 2010 JogAmp Community.