MacOsX/JAWT_SurfaceLayers/CALayers: Kick off / JAWT_getAWT() CALAYER version support.
Merge branch 'master' into osx_jawt_calayers
New test case that demonstates bug 523, hang on application exit if
GLContext objects are shared across GLWindow instances. This bug does
not manifest in the latest source.
OSX: CGL type cleanup ; layeredSurface impl.

- Use proper OSX types for NS/CGL prototypes (gluegen) and impl.

- Impl layeredSurface (native):
  - OSXUtil: NSView backing creation
  - OSXUtil: AttachJAWTSurfaceLayer
  - CGL: NSOpenGLLayer type impl. and hook
Cleanup ; JAWT* version flag setting based whether

Cleanup
  - use Platform OS_TYPE
  - ..

JAWT* version flag
  - if JAWTWindow is Applet, attempt offscreenLayer if avail
  - ..
Impl layeredSurface (java/native):
  - OSXUtil: NSView backing creation
  - OSXUtil: AttachJAWTSurfaceLayer
  - MacOSXCGLContext.create(): Attach NSOpenGLLayer if layered
  - MacOSXCGLDrawable.updateHandle(): if direct: add NSView backing layer
  - MacOSXCGLDrawable: Add getNSViewHandle() to distinguish between NSView and none (CGL/pbuffer)
NativeWindow/JOGL: NativeSurface adds add/remove SurfaceUpdateListener

- SurfaceUpdateHelper contains impl. used by NativeSurface implementations.
JOGL/Offscreen-Drawable: Use setRealized(boolean) protocol for offscreen/pbuffer

This allows allowing updateHandle()/destroyHandle() to be called.
JOGL *Drawable swapBufferImpl() cleanup: Don't force swap-buffer off for offscreen/pbuffer, but respect GLDrawableImpl's decision (double-buffer)
OS X Layered View: Use pbuffer method (pbuffer w/ dbl buffer)

- attributes +NSOpenGLPFANoRecovery +NSOpenGLPFAAccelerated
- use SurfaceUpdateListener() to notify layer
- swapBufferImpl() adapt to 0038e2d41825c22bdd18a7b86a8229a3fab674a3
- pbuffer: don't enforce POT tex-size to surface size, but pbuffer only
- FIXME: Check POT pbuffer/tex-size for X11/Win32/.. !
-
JOGL: Add 'struct timespec' (POSIX) utils for native time handling
JOGL: GLBase Add 'isNPOTTextureAvailable()' for convenience
OSX: SharedResource add knowledge of NPOT-, RECT- and Float-Texture features, used by pbuffer drawable before a current context.

- Also  extract getNextPowerOf2() -> GLBuffers (remove redundancy)
GLContext: Intendation + Use generics (remove warnings)
FPSCounter: Use Java 1.5 TimeUnit
Minor edits: Remove unused code and warnings
OS X Layered View: Part2 Java/Native MacOSXCGLContext / MacOSXPbufferCGLContext

Undo 368cbf4462d7f3635c1ef4497424c360b5ccc203:
    - "use SurfaceUpdateListener() to notify layer", simply use MacOSXCGLContext's swap impl.

MacOSXCGLContext:
  - NSOpenGLImpl.create():
    - issues createNSOpenGLLayer() using tex-size (maybe POT) as args
    - attaches the NSOpenGLLayer to the JAWT layered surface host

  - NSOpenGLImpl.setSwapInterval() propagates interval to our NSOpenGLLayer impl.

  - NSOpenGLImpl.swapBuffer() (layer case):
    - waits for v-sync if enabled (v-sync), or until native 'draw' is finished (tearing)
      using our pthread/ NSOpenGLLayer synchronization.
      The latter uses CADisplayLink or CVDisplayLinkRef for v-sync synchronization.

    - flushes our local ctx

    - triggers our NSOpenGLLayer to 'draw'

- MacOSXPbufferCGLContext create() sets the texture size independently of pbuffer size (POT/NPOT)
NativeWindow: Add accessor interfaces NativeSurfaceHolder and NativeWindowHolder

- NativeSurfaceHolder interface allows access to it's implementation's NativeSurface reference.
- NativeWindowHolder interface allows access to it's implementation's NativeWindow reference.

Implement or extend interface w/ these accessors whereever it seems fit:
  - NEWT Window
  - GLDrawable

These accessors allow lower layers to retrieve the NativeSurface/Window instance
w/o knowledge of the 'upper' frameworks, ie. NativeWindow/JOGL or JOGL/NEWT.

Commited in followups (due to mixed semantical changes in those files):
  - JAWTWindow
  - NewtCanvasAWT
  - Some NEWT impl.
Minor edits: remove redundancies
OS X Layered View: Part3 JAWTWindow/MacOSXJAWTWindow (Java/Native)

JAWTWindow:
  - Add comment about caller of cstr, since it uses reflection
  - Field 'config' is of type AWTGraphicsConfiguration, validate and type it
  - Impl. NativeSurfaceHolder/NativeWindowHolder 'hooks'

MacOSXJAWTWindow:
  - Use agnostic JAWTUtil.isJAWTVersionUsingOffscreenLayer()
    to determine 'isOffscreenLayeredSurface'.
    We may promote this notion to JAWTWindow, which already holds 'isApplet'

  - lockSurface() case 'isOffscreenLayeredSurface':
    - Create dummy NSWindow (OSXUtil) for getWindowHandle()
    - Fix chosen caps: offscreen