diff options
Diffstat (limited to 'make/stub_includes/macosx')
-rw-r--r-- | make/stub_includes/macosx/AppKit/NSView.h | 1 | ||||
-rw-r--r-- | make/stub_includes/macosx/OpenGL/OpenGL.h | 127 | ||||
-rw-r--r-- | make/stub_includes/macosx/cglext.c | 1 | ||||
-rw-r--r-- | make/stub_includes/macosx/jni.h | 78 | ||||
-rw-r--r-- | make/stub_includes/macosx/jni_md.h | 15 | ||||
-rw-r--r-- | make/stub_includes/macosx/window-system1.c | 47 |
6 files changed, 269 insertions, 0 deletions
diff --git a/make/stub_includes/macosx/AppKit/NSView.h b/make/stub_includes/macosx/AppKit/NSView.h new file mode 100644 index 000000000..5d3acf658 --- /dev/null +++ b/make/stub_includes/macosx/AppKit/NSView.h @@ -0,0 +1 @@ +typedef struct _NSView NSView; diff --git a/make/stub_includes/macosx/OpenGL/OpenGL.h b/make/stub_includes/macosx/OpenGL/OpenGL.h new file mode 100644 index 000000000..afb11efea --- /dev/null +++ b/make/stub_includes/macosx/OpenGL/OpenGL.h @@ -0,0 +1,127 @@ +/* Typedefs, enums and function prototypes extracted from Apple's + 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* CGLPBufferObj; +typedef struct _cglObj* CGLPixelFormatObj; + +/* +** Attribute names for CGLChoosePixelFormat and CGLDescribePixelFormat. +*/ +typedef enum _CGLPixelFormatAttribute { + kCGLPFAAllRenderers = 1, /* choose from all available renderers */ + kCGLPFADoubleBuffer = 5, /* choose a double buffered pixel format */ + kCGLPFAStereo = 6, /* stereo buffering supported */ + kCGLPFAAuxBuffers = 7, /* number of aux buffers */ + kCGLPFAColorSize = 8, /* number of color buffer bits */ + kCGLPFAAlphaSize = 11, /* number of alpha component bits */ + kCGLPFADepthSize = 12, /* number of depth buffer bits */ + kCGLPFAStencilSize = 13, /* number of stencil buffer bits */ + kCGLPFAAccumSize = 14, /* number of accum buffer bits */ + kCGLPFAMinimumPolicy = 51, /* never choose smaller buffers than requested */ + kCGLPFAMaximumPolicy = 52, /* choose largest buffers of type requested */ + kCGLPFAOffScreen = 53, /* choose an off-screen capable renderer */ + kCGLPFAFullScreen = 54, /* choose a full-screen capable renderer */ + kCGLPFASampleBuffers = 55, /* number of multi sample buffers */ + kCGLPFASamples = 56, /* number of samples per multi sample buffer */ + kCGLPFAAuxDepthStencil = 57, /* each aux buffer has its own depth stencil */ + kCGLPFAColorFloat = 58, /* color buffers store floating point pixels */ + kCGLPFAMultisample = 59, /* choose multisampling */ + kCGLPFASupersample = 60, /* choose supersampling */ + kCGLPFASampleAlpha = 61, /* request alpha filtering */ + + kCGLPFARendererID = 70, /* request renderer by ID */ + kCGLPFASingleRenderer = 71, /* choose a single renderer for all screens */ + kCGLPFANoRecovery = 72, /* disable all failure recovery systems */ + kCGLPFAAccelerated = 73, /* choose a hardware accelerated renderer */ + kCGLPFAClosestPolicy = 74, /* choose the closest color buffer to request */ + kCGLPFARobust = 75, /* renderer does not need failure recovery */ + kCGLPFABackingStore = 76, /* back buffer contents are valid after swap */ + kCGLPFAMPSafe = 78, /* renderer is multi-processor safe */ + kCGLPFAWindow = 80, /* can be used to render to an onscreen window */ + kCGLPFAMultiScreen = 81, /* single window can span multiple screens */ + kCGLPFACompliant = 83, /* renderer is opengl compliant */ + kCGLPFADisplayMask = 84, /* mask limiting supported displays */ + kCGLPFAPBuffer = 90, /* can be used to render to a pbuffer */ + kCGLPFARemotePBuffer = 91, /* can be used to render offline to a pbuffer */ + kCGLPFAVirtualScreenCount = 128 /* number of virtual screens in this format */ +} CGLPixelFormatAttribute; + +/* +** Error return values from CGLGetError. +*/ +typedef enum _CGLError { + kCGLNoError = 0, /* no error */ + kCGLBadAttribute = 10000, /* invalid pixel format attribute */ + kCGLBadProperty = 10001, /* invalid renderer property */ + kCGLBadPixelFormat = 10002, /* invalid pixel format */ + kCGLBadRendererInfo = 10003, /* invalid renderer info */ + kCGLBadContext = 10004, /* invalid context */ + kCGLBadDrawable = 10005, /* invalid drawable */ + kCGLBadDisplay = 10006, /* invalid graphics device */ + kCGLBadState = 10007, /* invalid context state */ + kCGLBadValue = 10008, /* invalid numerical value */ + kCGLBadMatch = 10009, /* invalid share context */ + kCGLBadEnumeration = 10010, /* invalid enumerant */ + kCGLBadOffScreen = 10011, /* invalid offscreen drawable */ + kCGLBadFullScreen = 10012, /* invalid offscreen drawable */ + kCGLBadWindow = 10013, /* invalid window */ + kCGLBadAddress = 10014, /* invalid pointer */ + kCGLBadCodeModule = 10015, /* invalid code module */ + kCGLBadAlloc = 10016, /* invalid memory allocation */ + kCGLBadConnection = 10017 /* invalid CoreGraphics connection */ +} CGLError; + +typedef enum _CGLContextParameter { + kCGLCPSwapRectangle = 200, + kCGLCPSwapInterval = 222, + kCGLCPDispatchTableSize = 224, + kCGLCPClientStorage = 226, + kCGLCPSurfaceTexture = 228, + kCGLCPSurfaceOrder = 235, + kCGLCPSurfaceOpacity = 236, + kCGLCPSurfaceBackingSize = 304, + kCGLCPSurfaceSurfaceVolatile = 306, + kCGLCPReclaimResources = 308, + kCGLCPCurrentRendererID = 309, + kCGLCPGPUVertexProcessing = 310, + kCGLCPGPUFragmentProcessing = 311, + kCGLCPHasDrawable = 314, + kCGLCPMPSwapsInFlight = 315, +} CGLContextParameter; + +/* Pixel format manipulation */ +CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs, + CGLPixelFormatObj *pix, + long *npix); +CGLError CGLDestroyPixelFormat(CGLPixelFormatObj pix); +CGLPixelFormatObj CGLGetPixelFormat ( CGLContextObj ctx ); + +/* Context manipulation */ +CGLError CGLCreateContext(CGLPixelFormatObj pix, + CGLContextObj share, + CGLContextObj* ctx); +void CGLReleaseContext(CGLContextObj ctx); +CGLError CGLDestroyContext(CGLContextObj ctx); +CGLError CGLSetCurrentContext(CGLContextObj ctx); +CGLContextObj CGLGetCurrentContext (void); +CGLError CGLFlushDrawable ( CGLContextObj ctx); +CGLError CGLSetParameter ( CGLContextObj ctx, CGLContextParameter pname, const int *params ); +CGLError CGLCopyContext ( CGLContextObj src, CGLContextObj dst, int mask ); + + + +/* PBuffer manipulation */ +CGLError CGLCreatePBuffer(long width, + long height, + unsigned long target, + unsigned long internalFormat, + long max_level, + CGLPBufferObj* pbuffer); +CGLError CGLDestroyPBuffer(CGLPBufferObj pbuffer); +CGLError CGLSetPBuffer(CGLContextObj ctx, + CGLPBufferObj pbuffer, + unsigned long face, + long level, + long screen); diff --git a/make/stub_includes/macosx/cglext.c b/make/stub_includes/macosx/cglext.c new file mode 100644 index 000000000..14010fcc4 --- /dev/null +++ b/make/stub_includes/macosx/cglext.c @@ -0,0 +1 @@ +#include <cglext.h> diff --git a/make/stub_includes/macosx/jni.h b/make/stub_includes/macosx/jni.h new file mode 100644 index 000000000..be01d0187 --- /dev/null +++ b/make/stub_includes/macosx/jni.h @@ -0,0 +1,78 @@ +/* Stub header for JNI which provides needed declarations without more + complicated and unnecessary constructs */ + +/* + * JNI Types + */ + +#include "jni_md.h" + +typedef unsigned char jboolean; +typedef unsigned short jchar; +typedef short jshort; +typedef float jfloat; +typedef double jdouble; + +typedef jint jsize; + +struct _jobject; + +typedef struct _jobject *jobject; +typedef jobject jclass; +typedef jobject jthrowable; +typedef jobject jstring; +typedef jobject jarray; +typedef jarray jbooleanArray; +typedef jarray jbyteArray; +typedef jarray jcharArray; +typedef jarray jshortArray; +typedef jarray jintArray; +typedef jarray jlongArray; +typedef jarray jfloatArray; +typedef jarray jdoubleArray; +typedef jarray jobjectArray; +typedef jobject jweak; + +typedef union jvalue { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; +} jvalue; + +struct _jfieldID; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID; +typedef struct _jmethodID *jmethodID; + +/* + * jboolean constants + */ + +#define JNI_FALSE 0 +#define JNI_TRUE 1 + +/* + * possible return values for JNI functions. + */ + +#define JNI_OK 0 /* success */ +#define JNI_ERR (-1) /* unknown error */ +#define JNI_EDETACHED (-2) /* thread detached from the VM */ +#define JNI_EVERSION (-3) /* JNI version error */ +#define JNI_ENOMEM (-4) /* not enough memory */ +#define JNI_EEXIST (-5) /* VM already created */ +#define JNI_EINVAL (-6) /* invalid arguments */ + +/* + * used in ReleaseScalarArrayElements + */ + +#define JNI_COMMIT 1 +#define JNI_ABORT 2 diff --git a/make/stub_includes/macosx/jni_md.h b/make/stub_includes/macosx/jni_md.h new file mode 100644 index 000000000..449786272 --- /dev/null +++ b/make/stub_includes/macosx/jni_md.h @@ -0,0 +1,15 @@ +#define _JNI_IMPORT_OR_EXPORT_ +#define JNIEXPORT +#define JNIIMPORT +#define JNICALL + +typedef int jint; +#ifdef _LP64 /* 64-bit Solaris */ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +typedef long JNIEnv; diff --git a/make/stub_includes/macosx/window-system1.c b/make/stub_includes/macosx/window-system1.c new file mode 100644 index 000000000..787d265ed --- /dev/null +++ b/make/stub_includes/macosx/window-system1.c @@ -0,0 +1,47 @@ +#include "macosx-window-system.h" + +/* These can not show up in the header file above because they must not be visible during the real build */ + +/* +** Attribute names for [NSOpenGLPixelFormat initWithAttributes] +** and [NSOpenGLPixelFormat getValues:forAttribute:forVirtualScreen]. +*/ +typedef enum { + NSOpenGLPFAAllRenderers = 1, /* choose from all available renderers */ + NSOpenGLPFADoubleBuffer = 5, /* choose a double buffered pixel format */ + NSOpenGLPFAStereo = 6, /* stereo buffering supported */ + NSOpenGLPFAAuxBuffers = 7, /* number of aux buffers */ + NSOpenGLPFAColorSize = 8, /* number of color buffer bits */ + NSOpenGLPFAAlphaSize = 11, /* number of alpha component bits */ + NSOpenGLPFADepthSize = 12, /* number of depth buffer bits */ + NSOpenGLPFAStencilSize = 13, /* number of stencil buffer bits */ + NSOpenGLPFAAccumSize = 14, /* number of accum buffer bits */ + NSOpenGLPFAMinimumPolicy = 51, /* never choose smaller buffers than requested */ + NSOpenGLPFAMaximumPolicy = 52, /* choose largest buffers of type requested */ + NSOpenGLPFAOffScreen = 53, /* choose an off-screen capable renderer */ + NSOpenGLPFAFullScreen = 54, /* choose a full-screen capable renderer */ + NSOpenGLPFASampleBuffers = 55, /* number of multi sample buffers */ + NSOpenGLPFASamples = 56, /* number of samples per multi sample buffer */ + NSOpenGLPFAAuxDepthStencil = 57, /* each aux buffer has its own depth stencil */ + NSOpenGLPFAColorFloat = 58, /* color buffers store floating point pixels */ + + NSOpenGLPFAMultisample = 59, /* choose multisampling */ + NSOpenGLPFASupersample = 60, /* choose supersampling */ + NSOpenGLPFASampleAlpha = 61, /* request alpha filtering */ + + NSOpenGLPFARendererID = 70, /* request renderer by ID */ + NSOpenGLPFASingleRenderer = 71, /* choose a single renderer for all screens */ + NSOpenGLPFANoRecovery = 72, /* disable all failure recovery systems */ + NSOpenGLPFAAccelerated = 73, /* choose a hardware accelerated renderer */ + NSOpenGLPFAClosestPolicy = 74, /* choose the closest color buffer to request */ + NSOpenGLPFARobust = 75, /* renderer does not need failure recovery */ + NSOpenGLPFABackingStore = 76, /* back buffer contents are valid after swap */ + NSOpenGLPFAMPSafe = 78, /* renderer is multi-processor safe */ + NSOpenGLPFAWindow = 80, /* can be used to render to an onscreen window */ + NSOpenGLPFAMultiScreen = 81, /* single window can span multiple screens */ + NSOpenGLPFACompliant = 83, /* renderer is opengl compliant */ + NSOpenGLPFAScreenMask = 84, /* bit mask of supported physical screens */ + NSOpenGLPFAPixelBuffer = 90, /* can be used to render to a pbuffer */ + NSOpenGLPFAVirtualScreenCount = 128 /* number of virtual screens in this format */ +} NSOpenGLPixelFormatAttribute; + |