From fe4f9f3f83cda05052549cc34fb3f7acb4eabb9c Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 5 Nov 2011 05:45:19 +0100
Subject: 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
---
 make/stub_includes/macosx/AppKit/NSOpenGL.h      |  3 +++
 make/stub_includes/macosx/AppKit/NSOpenGLLayer.h |  1 +
 make/stub_includes/macosx/AppKit/NSOpenGLView.h  |  1 +
 make/stub_includes/macosx/OpenGL/CGLDevice.h     |  2 ++
 make/stub_includes/macosx/OpenGL/OpenGL.h        | 31 +++++++++++++-----------
 make/stub_includes/macosx/QuartzCore/CALayer.h   |  1 +
 6 files changed, 25 insertions(+), 14 deletions(-)
 create mode 100644 make/stub_includes/macosx/AppKit/NSOpenGL.h
 create mode 100644 make/stub_includes/macosx/AppKit/NSOpenGLLayer.h
 create mode 100644 make/stub_includes/macosx/AppKit/NSOpenGLView.h
 create mode 100644 make/stub_includes/macosx/OpenGL/CGLDevice.h
 create mode 100644 make/stub_includes/macosx/QuartzCore/CALayer.h

(limited to 'make/stub_includes/macosx')

diff --git a/make/stub_includes/macosx/AppKit/NSOpenGL.h b/make/stub_includes/macosx/AppKit/NSOpenGL.h
new file mode 100644
index 000000000..1b7656dc1
--- /dev/null
+++ b/make/stub_includes/macosx/AppKit/NSOpenGL.h
@@ -0,0 +1,3 @@
+typedef struct _NSOpenGLPixelFormat NSOpenGLPixelFormat;
+typedef struct _NSOpenGLContext NSOpenGLContext;
+typedef struct _NSOpenGLPixelBuffer NSOpenGLPixelBuffer;
diff --git a/make/stub_includes/macosx/AppKit/NSOpenGLLayer.h b/make/stub_includes/macosx/AppKit/NSOpenGLLayer.h
new file mode 100644
index 000000000..2e5e81a68
--- /dev/null
+++ b/make/stub_includes/macosx/AppKit/NSOpenGLLayer.h
@@ -0,0 +1 @@
+typedef struct _NSOpenGLLayer NSOpenGLLayer;
diff --git a/make/stub_includes/macosx/AppKit/NSOpenGLView.h b/make/stub_includes/macosx/AppKit/NSOpenGLView.h
new file mode 100644
index 000000000..6492287df
--- /dev/null
+++ b/make/stub_includes/macosx/AppKit/NSOpenGLView.h
@@ -0,0 +1 @@
+typedef struct _NSOpenGLView NSOpenGLView;
diff --git a/make/stub_includes/macosx/OpenGL/CGLDevice.h b/make/stub_includes/macosx/OpenGL/CGLDevice.h
new file mode 100644
index 000000000..1d4170975
--- /dev/null
+++ b/make/stub_includes/macosx/OpenGL/CGLDevice.h
@@ -0,0 +1,2 @@
+typedef struct _cglShareGroupObj*  CGLShareGroupObj;
+
diff --git a/make/stub_includes/macosx/OpenGL/OpenGL.h b/make/stub_includes/macosx/OpenGL/OpenGL.h
index 1a3ddf203..33cfa46b6 100644
--- a/make/stub_includes/macosx/OpenGL/OpenGL.h
+++ b/make/stub_includes/macosx/OpenGL/OpenGL.h
@@ -2,10 +2,13 @@
    OpenGL.h to expose portions of the low-level CGL API to Java */
 
 /* Typedefs to get things working */
-typedef struct _cglObj* CGLContextObj;
-typedef struct _cglObj* CGLShareGroupObj;
-typedef struct _cglObj* CGLPBufferObj;
-typedef struct _cglObj* CGLPixelFormatObj;
+typedef struct _cglContextObj*     CGLContextObj;
+typedef struct _cglPBufferObj*     CGLPBufferObj;
+typedef struct _cglPixelFormatObj* CGLPixelFormatObj;
+
+typedef int             GLint;          /* 4-byte signed */
+typedef unsigned int    GLenum;
+typedef int             GLsizei;        /* 4-byte signed */
 
 /*
 ** Attribute names for CGLChoosePixelFormat and CGLDescribePixelFormat.
@@ -105,7 +108,7 @@ typedef enum _CGLContextParameter {
 /* Pixel format manipulation */
 CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs,
                               CGLPixelFormatObj *pix,
-                              long *npix);
+                              GLint *npix);
 CGLError CGLDestroyPixelFormat(CGLPixelFormatObj pix);
 CGLPixelFormatObj CGLGetPixelFormat ( CGLContextObj ctx );
 
@@ -123,16 +126,16 @@ CGLError CGLCopyContext ( CGLContextObj src, CGLContextObj dst, int mask );
 
 CGLShareGroupObj CGLGetShareGroup(CGLContextObj ctx);
 
-/* PBuffer manipulation */
-CGLError CGLCreatePBuffer(long width,
-                          long height,
-                          unsigned long target,
-                          unsigned long internalFormat,
-                          long max_level,
+/* PBuffer manipulation (deprecated in 10.7) */
+CGLError CGLCreatePBuffer(GLsizei width,
+                          GLsizei height,
+                          GLenum target,
+                          GLenum internalFormat,
+                          GLint max_level,
                           CGLPBufferObj* pbuffer);
 CGLError CGLDestroyPBuffer(CGLPBufferObj pbuffer);
 CGLError CGLSetPBuffer(CGLContextObj ctx,
                        CGLPBufferObj pbuffer,
-                       unsigned long face,
-                       long level,
-                       long screen);
+                       GLenum face,
+                       GLint level,
+                       GLint screen);
diff --git a/make/stub_includes/macosx/QuartzCore/CALayer.h b/make/stub_includes/macosx/QuartzCore/CALayer.h
new file mode 100644
index 000000000..a5a6579a6
--- /dev/null
+++ b/make/stub_includes/macosx/QuartzCore/CALayer.h
@@ -0,0 +1 @@
+typedef struct _CALayer CALayer;
-- 
cgit v1.2.3