diff options
Diffstat (limited to 'make/stub_includes/egl')
-rwxr-xr-x | make/stub_includes/egl/EGL/egl.h | 307 | ||||
-rwxr-xr-x | make/stub_includes/egl/EGL/eglext.h | 338 | ||||
-rwxr-xr-x | make/stub_includes/egl/EGL/eglplatform.h | 72 | ||||
-rwxr-xr-x | make/stub_includes/egl/KD/NV_extwindowprops.h | 32 | ||||
-rwxr-xr-x | make/stub_includes/egl/KD/NV_multitouch.h | 70 | ||||
-rwxr-xr-x | make/stub_includes/egl/KD/kd.h | 1014 | ||||
-rwxr-xr-x | make/stub_includes/egl/KD/kdplatform.h | 83 | ||||
-rwxr-xr-x | make/stub_includes/egl/window-system-ext.c | 7 | ||||
-rwxr-xr-x | make/stub_includes/egl/window-system.c | 2 |
9 files changed, 1925 insertions, 0 deletions
diff --git a/make/stub_includes/egl/EGL/egl.h b/make/stub_includes/egl/EGL/egl.h new file mode 100755 index 000000000..86ca4818f --- /dev/null +++ b/make/stub_includes/egl/EGL/egl.h @@ -0,0 +1,307 @@ +/* -*- mode: c; tab-width: 8; -*- */ +/* vi: set sw=4 ts=8: */ +/* Reference version of egl.h for EGL 1.4. + * Last modified 2008/05/02 + */ + +#ifndef __egl_h_ +#define __egl_h_ + +/* All platform-dependent types and macro boilerplate (such as EGLAPI + * and EGLAPIENTRY) should go in eglplatform.h. + */ +#include <EGL/eglplatform.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* EGL Types */ +typedef int32_t EGLint; +typedef unsigned int EGLBoolean; +typedef unsigned int EGLenum; +#ifdef USE_GLUEGEN + /* GlueGen currently needs this form of typedef to produce distinct + types for each of these pointer types */ + typedef struct {} _EGLConfig, *EGLConfig; +#else + typedef void *EGLConfig; +#endif +typedef void *EGLContext; +typedef void *EGLDisplay; +typedef void *EGLSurface; +typedef void *EGLClientBuffer; + +/* EGL Versioning */ +#define EGL_VERSION_1_0 1 +#define EGL_VERSION_1_1 1 +#define EGL_VERSION_1_2 1 +#define EGL_VERSION_1_3 1 +#define EGL_VERSION_1_4 1 + +/* EGL Enumerants. Bitmasks and other exceptional cases aside, most + * enums are assigned unique values starting at 0x3000. + */ + +/* EGL aliases */ +#define EGL_FALSE 0 +#define EGL_TRUE 1 + +/* Out-of-band handle values */ +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) + +/* Out-of-band attribute value */ +#define EGL_DONT_CARE ((EGLint)-1) + +/* Errors / GetError return values */ +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ + +/* Reserved 0x300F-0x301F for additional errors */ + +/* Config attributes */ +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_PRESERVED_RESOURCES 0x3030 +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 /* Attrib list terminator */ +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ +#define EGL_CONFORMANT 0x3042 + +/* Reserved 0x3041-0x304F for additional config attributes */ + +/* Config attribute values */ +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ +#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ +#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ + +/* More config attribute values, for EGL_TEXTURE_FORMAT */ +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F + +/* Config attribute mask bits */ +#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ + +#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ + +/* QueryString targets */ +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_CLIENT_APIS 0x308D + +/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 + +/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ +#define EGL_BACK_BUFFER 0x3084 +#define EGL_SINGLE_BUFFER 0x3085 + +/* OpenVG color spaces */ +#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ +#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ + +/* OpenVG alpha formats */ +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ + +/* Constant scale factor by which fractional display resolutions & + * aspect ratio are scaled when queried as integer values. + */ +#define EGL_DISPLAY_SCALING 10000 + +/* Unknown display resolution/aspect ratio */ +#define EGL_UNKNOWN ((EGLint)-1) + +/* Back buffer swap behaviors */ +#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ +#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ + +/* CreatePbufferFromClientBuffer buffer types */ +#define EGL_OPENVG_IMAGE 0x3096 + +/* QueryContext targets */ +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 + +/* CreateContext attributes */ +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +/* Multisample resolution behaviors */ +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ + +/* BindAPI/QueryAPI targets */ +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENGL_API 0x30A2 + +/* GetCurrentSurface targets */ +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A + +/* WaitNative engines */ +#define EGL_CORE_NATIVE_ENGINE 0x305B + +/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ +#define EGL_COLORSPACE EGL_VG_COLORSPACE +#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT +#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB +#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR +#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE +#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE + +/* EGL extensions must request enum blocks from the Khronos + * API Registrar, who maintains the enumerant registry. Submit + * a bug in Khronos Bugzilla against task "Registry". + */ + + + +/* EGL Functions */ + +EGLAPI EGLint EGLAPIENTRY eglGetError(void); + +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); + +EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); + +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, + EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, + EGLConfig *configs, EGLint config_size, + EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, + EGLint attribute, EGLint *value); + +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, + EGLNativeWindowType win, + const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, + EGLNativePixmapType pixmap, + const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint *value); + +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); + +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); + +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); + +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( + EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, + EGLConfig config, const EGLint *attrib_list); + +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); + + +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); + + +EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, + EGLContext share_context, + const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, + EGLSurface read, EGLContext ctx); + +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, + EGLint attribute, EGLint *value); + +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, + EGLNativePixmapType target); + +typedef void (* EGLAPIENTRY __EGLFuncPtr)(void); +EGLAPI __EGLFuncPtr eglGetProcAddress(const char *procname); + +#ifdef __cplusplus +} +#endif + +#endif /* __egl_h_ */ diff --git a/make/stub_includes/egl/EGL/eglext.h b/make/stub_includes/egl/EGL/eglext.h new file mode 100755 index 000000000..5b41bfae6 --- /dev/null +++ b/make/stub_includes/egl/EGL/eglext.h @@ -0,0 +1,338 @@ +#ifndef __eglext_h_ +#define __eglext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* + * Copyright (c) 2008 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +#include <EGL/egl.h> +#include <EGL/eglplatform.h> + +/*************************************************************/ + +/* Header file version number */ +/* eglext.h last updated 2007/11/20 */ +/* Current version at http://www.khronos.org/registry/egl/ */ +#define EGL_EGLEXT_VERSION 1 + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 +#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */ +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */ +#endif + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */ +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */ +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */ +#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */ +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */ +#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */ +#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */ +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface); +#endif + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */ +typedef void *EGLImageKHR; +#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, EGLint *attr_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, EGLint *attr_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); +#endif + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ +#endif + +// Supported NV Extensions + +// NOTE: EGL_KHR_bind_client_buffer == EGL_create_pbuffer_from_client_buffer +/* EGL_KHR_bind_client_buffer */ +#ifndef EGL_KHR_bind_client_buffer +#define EGL_create_pbuffer_from_client_buffer 1 +#define EGL_KHR_bind_client_buffer 1 +#define EGL_OPENVG_IMAGE_KHR EGL_OPENVG_IMAGE +#endif + +/* eglCreateImageKHR targets */ +/* eglCreateImageKHR target and eglCreatePbufferFromClientBuffer buftype */ + +/* EGL_NV_perfmon */ +#if 0 +#ifndef EGL_NV_perfmon +#define EGL_NV_perfmon 1 +#define EGL_PERFMONITOR_HARDWARE_COUNTERS_BIT_NV 0x00000001 +#define EGL_PERFMONITOR_OPENGL_ES_API_BIT_NV 0x00000010 +#define EGL_PERFMONITOR_OPENVG_API_BIT_NV 0x00000020 +#define EGL_PERFMONITOR_OPENGL_ES2_API_BIT_NV 0x00000040 +#define EGL_COUNTER_NAME_NV 0x1234 +#define EGL_COUNTER_DESCRIPTION_NV 0x1235 +#define EGL_IS_HARDWARE_COUNTER_NV 0x1236 +#define EGL_COUNTER_MAX_NV 0x1237 +#define EGL_COUNTER_VALUE_TYPE_NV 0x1238 +#define EGL_RAW_VALUE_NV 0x1239 +#define EGL_PERCENTAGE_VALUE_NV 0x1240 +#define EGL_BAD_CURRENT_PERFMONITOR_NV 0x1241 +#define EGL_NO_PERFMONITOR_NV ((EGLPerfMonitorNV)0) +#define EGL_DEFAULT_PERFMARKER_NV ((EGLPerfMarkerNV)0) +typedef void *EGLPerfMonitorNV; +typedef void *EGLPerfMarkerNV; +#ifdef USE_GLUEGEN + /* GlueGen currently needs this form of typedef to produce distinct + types for each of these pointer types */ + typedef struct {} _EGLPerfCounterNV, *EGLPerfCounterNV; +#else + typedef void *EGLPerfCounterNV; +#endif +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLPerfMonitorNV EGLAPIENTRY eglCreatePerfMonitorNV(EGLDisplay dpy, EGLint mask); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyPerfMonitorNV(EGLDisplay dpy, EGLPerfMonitorNV monitor); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrentPerfMonitorNV(EGLPerfMonitorNV monitor); +EGLAPI EGLPerfMonitorNV EGLAPIENTRY eglGetCurrentPerfMonitorNV(void); +EGLAPI EGLBoolean EGLAPIENTRY eglGetPerfCountersNV(EGLPerfMonitorNV monitor, EGLPerfCounterNV *counters, EGLint counter_size, EGLint *num_counter); +EGLAPI EGLBoolean EGLAPIENTRY eglGetPerfCounterAttribNV(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname, EGLint *value); +EGLAPI const char * EGLAPIENTRY eglQueryPerfCounterStringNV(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorAddCountersNV(EGLint n, const EGLPerfCounterNV *counters); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorRemoveCountersNV(EGLint n, const EGLPerfCounterNV *counters); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorRemoveAllCountersNV(void); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorBeginExperimentNV(void); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorEndExperimentNV(void); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorBeginPassNV(EGLint n); +EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorEndPassNV(void); +EGLAPI EGLPerfMarkerNV EGLAPIENTRY eglCreatePerfMarkerNV(void); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyPerfMarkerNV(EGLPerfMarkerNV marker); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrentPerfMarkerNV(EGLPerfMarkerNV marker); +EGLAPI EGLPerfMarkerNV EGLAPIENTRY eglGetCurrentPerfMarkerNV(void); +EGLAPI EGLBoolean EGLAPIENTRY eglGetPerfMarkerCounterNV(EGLPerfMarkerNV marker, EGLPerfCounterNV counter, EGLuint64NV *value, EGLuint64NV *cycles); +EGLAPI EGLBoolean EGLAPIENTRY eglValidatePerfMonitorNV(EGLint *num_passes); +#endif +typedef EGLPerfMonitorNV (EGLAPIENTRYP PFNEGLCREATEPERFMONITORNVPROC)(EGLDisplay dpy, EGLint mask); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYPERFMONITORNVPROC)(EGLDisplay dpy, EGLPerfMonitorNV monitor); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPERFMONITORNVPROC)(EGLPerfMonitorNV monitor); +typedef EGLPerfMonitorNV (EGLAPIENTRYP PFNEGLGETCURRENTPERFMONITORNVPROC)(void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETPERFCOUNTERSNVPROC)(EGLPerfMonitorNV monitor, EGLPerfCounterNV *counters, EGLint counter_size, EGLint *num_counter); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETPERFCOUNTERATTRIBNVPROC)(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname, EGLint *value); +typedef const char * (EGLAPIENTRYP PFNEGLQUERYPERFCOUNTERSTRINGNVPROC)(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORADDCOUNTERSNVPROC)(EGLint n, const EGLPerfCounterNV *counters); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORREMOVECOUNTERSNVPROC)(EGLint n, const EGLPerfCounterNV *counters); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORREMOVEALLCOUNTERSNVPROC)(void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORBEGINEXPERIMENTNVPROC)(void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORENDEXPERIMENTNVPROC)(void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORBEGINPASSNVPROC)(EGLint n); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORENDPASSNVPROC)(void); +typedef EGLPerfMarkerNV (EGLAPIENTRYP PFNEGLCREATEPERFMARKERNVPROC)(void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYPERFMARKERNVPROC)(EGLPerfMarkerNV marker); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPERFMARKERNVPROC)(EGLPerfMarkerNV marker); +typedef EGLPerfMarkerNV (EGLAPIENTRYP PFNEGLGETCURRENTPERFMARKERNVPROC)(void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETPERFMARKERCOUNTERNVPROC)(EGLPerfMarkerNV marker, EGLPerfCounterNV counter, EGLuint64NV *value, EGLuint64NV *cycles); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLVALIDATEPERFMONITORNVPROC)(EGLint *num_passes); +#endif +#endif // exclude EGL_NV_perfmon + +/* EGL_NV_texture_rectangle (reuse analagous WGL enum) */ +#ifndef EGL_NV_texture_rectangle +#define EGL_NV_texture_rectangle 1 +#define EGL_GL_TEXTURE_RECTANGLE_NV_KHR 0x30BB +#define EGL_TEXTURE_RECTANGLE_NV 0x20A2 +#endif + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); +#endif +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void); +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void); +#endif + +/* EGL_NV_coverage_sample (reuse GLX_VIDEO_OUT_DEPTH_NV and + * GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV) + */ +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif + +/* EGL_NV_depth_nonlinear + */ +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif + +#ifndef EGL_NV_nvva_image +#define EGL_NV_nvva_image 1 +#define EGL_NVVA_OUTPUT_SURFACE_NV 0x30BE +EGLAPI EGLBoolean EGLAPIENTRY eglVideoImageLockNV(EGLDisplay dpy, EGLImageKHR image, EGLenum api); +EGLAPI EGLBoolean EGLAPIENTRY eglVideoImageUnlockNV(EGLDisplay dpy, EGLImageKHR image); +#endif + +#ifndef EGL_NV_nvma_image +#define EGL_NV_nvma_image 1 +#define EGL_NVMA_OUTPUT_SURFACE_NV 0x30BE /* eglCreateImageKHR target and eglCreatePbufferFromClientBuffer buftype */ +#endif + +#ifndef EGL_NV_client_api_nvma +#define EGL_NV_client_api_nvma 1 +EGLAPI EGLBoolean EGLAPIENTRY eglNvmaOutputSurfacePbufferLock(EGLDisplay display, + EGLSurface pbuffer); +EGLAPI EGLBoolean EGLAPIENTRY eglNvmaOutputSurfacePbufferUnlock(EGLDisplay display, + EGLSurface pbuffer); +#endif + + +/* EGL_KHR_sync + */ +#ifndef EGL_KHR_sync +#define EGL_KHR_sync 1 +typedef void* EGLSyncKHR; +typedef void* NativeSyncKHR; +typedef unsigned long long EGLTimeKHR; +#ifdef EGL_EGLEXT_PROTOTYPES +EGLSyncKHR eglCreateFenceSyncKHR( EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list ); +NativeSyncKHR eglCreateNativeSyncKHR( EGLSyncKHR sync ); +EGLBoolean eglDestroySyncKHR( EGLSyncKHR sync ); +EGLBoolean eglFenceKHR( EGLSyncKHR sync ); +EGLint eglClientWaitSyncKHR( EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout ); +EGLBoolean eglSignalSyncKHR( EGLSyncKHR sync, EGLenum mode ); +EGLBoolean eglGetSyncAttribKHR( EGLSyncKHR sync, EGLint attribute, EGLint *value ); +#else +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATEFENCESYNCKHRPROC)( EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list ); +typedef NativeSyncKHR (EGLAPIENTRYP PFNEGLCREATENATIVESYNCKHRPROC)( EGLSyncKHR sync ); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC)( EGLSyncKHR sync ); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCEKHRPROC)( EGLSyncKHR sync ); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC)( EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout ); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC)( EGLSyncKHR sync, EGLenum mode ); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC)( EGLSyncKHR sync, EGLint attribute, EGLint *value ); +#endif + +/* !!!!! TODO: Get correct values for these defines !!!! + Do not rely on these values...THEY WILL CHANGE! + And it WILL BREAK binary compatibility when they do! */ +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x3100 +#define EGL_SYNC_NATIVE_SYNC_KHR 0x3101 +#define EGL_SYNC_STATUS_KHR 0x3102 +#define EGL_SIGNALED_KHR 0x3103 +#define EGL_UNSIGNALED_KHR 0x3104 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_KHR 0x3105 +#define EGL_TIMEOUT_EXPIRED_KHR 0x3106 +#define EGL_CONDITION_SATISFIED_KHR 0x3107 +#define EGL_SYNC_TYPE_KHR 0x3108 +#define EGL_SYNC_CONDITION_KHR 0x3109 +#define EGL_SYNC_FENCE_KHR 0x310A +#define EGL_NO_SYNC_KHR 0x0000 +#endif + + + +/* EGL_NV_omx_il_sink + */ +#ifndef EGL_NV_omx_il_sink +#define EGL_NV_omx_il_sink +#define EGL_OPENMAX_IL_BIT_NV 0x0010 /* EGL_RENDERABLE_TYPE bit */ +#define EGL_SURFACE_OMX_IL_EVENT_CALLBACK_NV 0x309A /* eglCreate*Surface attribute */ +#define EGL_SURFACE_OMX_IL_EMPTY_BUFFER_DONE_CALLBACK_NV 0x309B /* eglCreate*Surface attribute */ +#define EGL_SURFACE_OMX_IL_CALLBACK_DATA_NV 0x309C /* eglCreate*Surface attribute */ +#define EGL_SURFACE_COMPONENT_HANDLE_NV 0x309D /* eglQuerySurface attribute */ +#endif + +#define EGL_RMSURFACE_NV 0x30EF /* eglCreateImageKHR target */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/make/stub_includes/egl/EGL/eglplatform.h b/make/stub_includes/egl/EGL/eglplatform.h new file mode 100755 index 000000000..f763d98e3 --- /dev/null +++ b/make/stub_includes/egl/EGL/eglplatform.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +#ifndef EGLPLATFORM_H +#define EGLPLATFORM_H + +/* +** eglplatform.h is platform dependent. It defines: +** +** - Native types +** - EGL and native handle values +** +** EGLNativeDisplayType, EGLNativeWindowType and EGLNativePixmapType are to be +** replaced with corresponding types of the native window system in egl.h. +** +** EGL and native handle values must match their types. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) && !defined(__GNUC__) + typedef signed __int32 int32_t; + typedef unsigned __int32 uint32_t; + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; +#else + #include <stdint.h> +#endif + +// Define storage class specifiers +#ifndef APIENTRY +#define APIENTRY +#endif + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY +#endif +#ifndef EGLAPIENTRYP +#define EGLAPIENTRYP EGLAPIENTRY * +#endif + +#define EGLAPI + +// Define native window system types +typedef int EGLNativeDisplayType; +typedef void* EGLNativePointerType; +typedef void* EGLNativeWindowType; +typedef void* EGLNativePixmapType; + +// Define 64-bit integer extensions +typedef int64_t EGLint64NV; +typedef uint64_t EGLuint64NV; + +// Define the pre-EGL 1.3 Native handle types for backwards compatibility +typedef EGLNativeDisplayType NativeDisplayType; +typedef EGLNativePixmapType NativePixmapType; +typedef EGLNativeWindowType NativeWindowType; + +#ifdef __cplusplus +} +#endif + +#endif /* EGLPLATFORM_H */ diff --git a/make/stub_includes/egl/KD/NV_extwindowprops.h b/make/stub_includes/egl/KD/NV_extwindowprops.h new file mode 100755 index 000000000..e7a16c727 --- /dev/null +++ b/make/stub_includes/egl/KD/NV_extwindowprops.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + + +#ifndef __kd_NV_extwindowprops_h_ +#define __kd_NV_extwindowprops_h_ +#include <KD/kd.h> +#include <EGL/eglext.h> + +#ifdef __cplusplus +extern "C" { +#endif + + + +/* KD_WINDOWPROPERTY_FULLSCREEN: Control over resizing a window to fill the complete screen */ + +#define KD_WINDOWPROPERTY_FULLSCREEN_NV 9999 + + +#ifdef __cplusplus +} +#endif + +#endif /* __kd_NV_extwindowprops_h_ */ diff --git a/make/stub_includes/egl/KD/NV_multitouch.h b/make/stub_includes/egl/KD/NV_multitouch.h new file mode 100755 index 000000000..5a9b9243b --- /dev/null +++ b/make/stub_includes/egl/KD/NV_multitouch.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + + +#ifndef __kd_NV_multitouch_h_ +#define __kd_NV_multitouch_h_ +#include <KD/kd.h> + +#ifdef __cplusplus +extern "C" { +#endif + + + +/* KD_IOGROUP_MULTITOUCH: I/O group for Multitouch input devices. */ +#define KD_IOGROUP_MULTITOUCH_NV 0x40004000 +#define KD_STATE_MULTITOUCH_AVAILABILITY_NV (KD_IOGROUP_MULTITOUCH_NV + 0) +#define KD_INPUT_MULTITOUCH_FINGERS_NV (KD_IOGROUP_MULTITOUCH_NV + 1) +#define KD_INPUT_MULTITOUCH_WIDTH_NV (KD_IOGROUP_MULTITOUCH_NV + 2) +#define KD_INPUT_MULTITOUCH_X_NV (KD_IOGROUP_MULTITOUCH_NV + 3) +#define KD_INPUT_MULTITOUCH_Y_NV (KD_IOGROUP_MULTITOUCH_NV + 4) +#define KD_INPUT_MULTITOUCH_X2_NV (KD_IOGROUP_MULTITOUCH_NV + 5) +#define KD_INPUT_MULTITOUCH_Y2_NV (KD_IOGROUP_MULTITOUCH_NV + 6) +#define KD_INPUT_MULTITOUCH_PRESSURE_NV (KD_IOGROUP_MULTITOUCH_NV + 7) +#define KD_INPUT_MULTITOUCH_GESTURES_NV (KD_IOGROUP_MULTITOUCH_NV + 8) +#define KD_INPUT_MULTITOUCH_RELX_NV (KD_IOGROUP_MULTITOUCH_NV + 9) +#define KD_INPUT_MULTITOUCH_RELY_NV (KD_IOGROUP_MULTITOUCH_NV + 10) + + + +/* KD_EVENT_INPUT_MULTITOUCH_NV: Multitouch event. */ +#define KD_EVENT_INPUT_MULTITOUCH_NV 1001 +typedef struct KDEventInputMultitouchDataNV { + KDint32 index; + KDint8 fingers; + KDint8 width; + KDint16 x; + KDint16 y; + KDint16 x2; + KDint16 y2; + KDint16 pressure; +} KDEventInputMultitouchDataNV; + + +/* KD_EVENT_INPUT_MULTITOUCH_GESTURE_NV: Multitouch gesture event. */ +#define KD_EVENT_INPUT_MULTITOUCH_GESTURE_NV 1002 + + +/* kdGetEventInputMultitouchDataNV: Get auxiliary event data for multitouch input. */ +KD_API KDint KD_APIENTRY kdGetEventInputMultitouchDataNV(const KDEvent * event, KDEventInputMultitouchDataNV * data); + +/* kdSetEventInputMultitouchActiveNV: Activate Multitouch input events */ +KD_API KDint KD_APIENTRY kdSetEventInputMultitouchActiveNV(KDboolean activate); + +/* kdEnableEventInputMultitouchMergeNV: Activate merging of Multitouch input events */ +KD_API void KD_APIENTRY kdEnableEventInputMultitouchMergeNV(KDboolean enable); + +#ifdef __cplusplus +} +#endif + +#endif /* __kd_NV_multitouch_h_ */ + diff --git a/make/stub_includes/egl/KD/kd.h b/make/stub_includes/egl/KD/kd.h new file mode 100755 index 000000000..c82385b86 --- /dev/null +++ b/make/stub_includes/egl/KD/kd.h @@ -0,0 +1,1014 @@ +/* +* Copyright (c) 2007 The Khronos Group Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject +* to the following conditions: +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __kd_h_ +#define __kd_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "kdplatform.h" + + + +/******************************************************* + * Introduction + *******************************************************/ + +/******************************************************* + * OpenKODE conformance + *******************************************************/ + +/******************************************************* + * Overview + *******************************************************/ + +/******************************************************* + * Programming environment + *******************************************************/ +#define KD_VERSION_1_0 1 +typedef char KDchar; +typedef signed char KDint8; +typedef unsigned char KDuint8; +typedef int KDint; +typedef unsigned int KDuint; +typedef float KDfloat32; +typedef KDint KDboolean; +typedef KDint64 KDtime; +typedef KDint64 KDust; +typedef KDint64 KDoff; +typedef KDuint32 KDmode; +#define KDINT32_MIN (-0x7fffffff-1) +#define KDINT32_MAX 0x7fffffff +#define KDUINT32_MAX 0xffffffffU +#define KD_TRUE 1 +#define KD_FALSE 0 +#ifdef __cplusplus + const int KD_NULL = 0; /* Yes, int. See Stroustrup 3rd edition. */ +#else + #define KD_NULL ((void *)0) +#endif + +/******************************************************* + * Errors + *******************************************************/ +#define KD_EACCES 1 +#define KD_EADDRINUSE 2 +#define KD_EADDRNOTAVAIL 3 +#define KD_EAFNOSUPPORT 4 +#define KD_EAGAIN (5) +#define KD_EALREADY 6 +#define KD_EBADF 7 +#define KD_EBUSY 8 +#define KD_ECONNREFUSED 9 +#define KD_ECONNRESET 10 +#define KD_EDEADLK 11 +#define KD_EDESTADDRREQ 12 +#define KD_EEXIST 13 +#define KD_EFBIG 14 +#define KD_EHOSTUNREACH 15 +#define KD_EHOST_NOT_FOUND 16 +#define KD_EINVAL 17 +#define KD_EIO 18 +#define KD_EILSEQ 19 +#define KD_EISCONN 20 +#define KD_EISDIR 21 +#define KD_EMFILE 22 +#define KD_ENAMETOOLONG 23 +#define KD_ENOENT 24 +#define KD_ENOMEM 25 +#define KD_ENOSPC 26 +#define KD_ENOSYS 27 +#define KD_ENOTCONN 28 +#define KD_ENO_DATA 29 +#define KD_ENO_RECOVERY 30 +#define KD_EOPNOTSUPP 31 +#define KD_EOVERFLOW 32 +#define KD_EPERM 33 +#define KD_EPIPE 34 +#define KD_ERANGE 35 +#define KD_ETIMEDOUT (36) +#define KD_ETRY_AGAIN 37 + +/* kdGetError: Get last error indication. */ +KD_API KDint KD_APIENTRY kdGetError(void); + +/* kdSetError: Set last error indication. */ +KD_API void KD_APIENTRY kdSetError(KDint error); + +/******************************************************* + * Versioning and attribute queries + *******************************************************/ + +/* kdQueryAttribi: Obtain the value of a numeric OpenKODE Core attribute. */ +KD_API KDint KD_APIENTRY kdQueryAttribi(KDint attribute, KDint *value); + +/* kdQueryAttribcv: Obtain the value of a string OpenKODE Core attribute. */ +KD_API const KDchar *KD_APIENTRY kdQueryAttribcv(KDint attribute); +#define KD_ATTRIB_VENDOR 39 +#define KD_ATTRIB_VERSION 40 +#define KD_ATTRIB_PLATFORM 41 + +/* kdQueryIndexedAttribcv: Obtain the value of an indexed string OpenKODE Core attribute. */ +KD_API const KDchar *KD_APIENTRY kdQueryIndexedAttribcv(KDint attribute, KDint index); + +/******************************************************* + * Threads and synchronization + *******************************************************/ + +/* kdThreadAttrCreate: Create a thread attribute object. */ +typedef struct KDThreadAttr KDThreadAttr; +KD_API KDThreadAttr *KD_APIENTRY kdThreadAttrCreate(void); + +/* kdThreadAttrFree: Free a thread attribute object. */ +KD_API KDint KD_APIENTRY kdThreadAttrFree(KDThreadAttr *attr); + +/* kdThreadAttrSetDetachState: Set detachstate attribute. */ +#define KD_THREAD_CREATE_JOINABLE 0 +#define KD_THREAD_CREATE_DETACHED 1 +KD_API KDint KD_APIENTRY kdThreadAttrSetDetachState(KDThreadAttr *attr, KDint detachstate); + +/* kdThreadAttrSetStackSize: Set stacksize attribute. */ +KD_API KDint KD_APIENTRY kdThreadAttrSetStackSize(KDThreadAttr *attr, KDsize stacksize); + +/* kdThreadCreate: Create a new thread. */ +typedef struct KDThread KDThread; +KD_API KDThread *KD_APIENTRY kdThreadCreate(const KDThreadAttr *attr, void *(*start_routine)(void *), void *arg); + +/* kdThreadExit: Terminate this thread. */ +KD_API KD_NORETURN void KD_APIENTRY kdThreadExit(void *retval); + +/* kdThreadJoin: Wait for termination of another thread. */ +KD_API KDint KD_APIENTRY kdThreadJoin(KDThread *thread, void **retval); + +/* kdThreadDetach: Allow resources to be freed as soon as a thread terminates. */ +KD_API KDint KD_APIENTRY kdThreadDetach(KDThread *thread); + +/* kdThreadSelf: Return calling thread’s ID. */ +KD_API KDThread *KD_APIENTRY kdThreadSelf(void); + +/* kdThreadOnce: Wrap initialization code so it is executed only once. */ +#ifndef KD_NO_STATIC_DATA +typedef struct KDThreadOnce { + void *impl; +} KDThreadOnce; +#define KD_THREAD_ONCE_INIT { 0 } +KD_API KDint KD_APIENTRY kdThreadOnce(KDThreadOnce *once_control, void (*init_routine)(void)); +#endif /* ndef KD_NO_STATIC_DATA */ + +/* kdThreadMutexCreate: Create a mutex. */ +typedef struct KDThreadMutex KDThreadMutex; +KD_API KDThreadMutex *KD_APIENTRY kdThreadMutexCreate(const void *mutexattr); + +/* kdThreadMutexFree: Free a mutex. */ +KD_API KDint KD_APIENTRY kdThreadMutexFree(KDThreadMutex *mutex); + +/* kdThreadMutexLock: Lock a mutex. */ +KD_API KDint KD_APIENTRY kdThreadMutexLock(KDThreadMutex *mutex); + +/* kdThreadMutexUnlock: Unlock a mutex. */ +KD_API KDint KD_APIENTRY kdThreadMutexUnlock(KDThreadMutex *mutex); + +/* kdThreadCondCreate: Create a condition variable. */ +typedef struct KDThreadCond KDThreadCond; +KD_API KDThreadCond *KD_APIENTRY kdThreadCondCreate(const void *attr); + +/* kdThreadCondFree: Free a condition variable. */ +KD_API KDint KD_APIENTRY kdThreadCondFree(KDThreadCond *cond); + +/* kdThreadCondSignal, kdThreadCondBroadcast: Signal a condition variable. */ +KD_API KDint KD_APIENTRY kdThreadCondSignal(KDThreadCond *cond); +KD_API KDint KD_APIENTRY kdThreadCondBroadcast(KDThreadCond *cond); + +/* kdThreadCondWait: Wait for a condition variable to be signalled. */ +KD_API KDint KD_APIENTRY kdThreadCondWait(KDThreadCond *cond, KDThreadMutex *mutex); + +/* kdThreadSemCreate: Create a semaphore. */ +typedef struct KDThreadSem KDThreadSem; +KD_API KDThreadSem *KD_APIENTRY kdThreadSemCreate(KDuint value); + +/* kdThreadSemFree: Free a semaphore. */ +KD_API KDint KD_APIENTRY kdThreadSemFree(KDThreadSem *sem); + +/* kdThreadSemWait: Lock a semaphore. */ +KD_API KDint KD_APIENTRY kdThreadSemWait(KDThreadSem *sem); + +/* kdThreadSemPost: Unlock a semaphore. */ +KD_API KDint KD_APIENTRY kdThreadSemPost(KDThreadSem *sem); + +/******************************************************* + * Events + *******************************************************/ + +/* KDEvent: Struct type containing an event. */ +typedef struct KDEvent KDEvent; +#define KD_EVENT_USER 0x40000000 + +/* kdWaitEvent: Get next event from thread’s event queue. */ +KD_API const KDEvent *KD_APIENTRY kdWaitEvent(KDust timeout); + +/* kdSetEventUserptr: Set the userptr for global events. */ +KD_API void KD_APIENTRY kdSetEventUserptr(void *userptr); + +/* kdDefaultEvent: Perform default processing on an unrecognized event. */ +KD_API void KD_APIENTRY kdDefaultEvent(const KDEvent *event); + +/* kdPumpEvents: Pump the thread’s event queue, performing callbacks. */ +KD_API KDint KD_APIENTRY kdPumpEvents(void); + +/* kdInstallCallback: Install or remove a callback function for event processing. */ +typedef void (KD_APIENTRY KDCallbackFunc)(const KDEvent *event); +KD_API KDint KD_APIENTRY kdInstallCallback(KDCallbackFunc *func, KDint eventtype, void *eventuserptr); + +/* kdCreateEvent: Create an event for posting. */ +KD_API KDEvent *KD_APIENTRY kdCreateEvent(void); + +/* kdPostEvent, kdPostThreadEvent: Post an event into a queue. */ +KD_API KDint KD_APIENTRY kdPostEvent(KDEvent *event); +KD_API KDint KD_APIENTRY kdPostThreadEvent(KDEvent *event, KDThread *thread); +typedef struct KDEventUser { + union { + KDint64 i64; + void *p; + struct { + KDint32 a; + KDint32 b; + } i32pair; + } value1; + union { + KDint64 i64; + struct { + union { + KDint32 i32; + void *p; + } value2; + union { + KDint32 i32; + void *p; + } value3; + } i32orp; + } value23; +} KDEventUser; + +/* kdFreeEvent: Abandon an event instead of posting it. */ +KD_API void KD_APIENTRY kdFreeEvent(KDEvent *event); + +/******************************************************* + * System events + *******************************************************/ + +/* KD_EVENT_QUIT: Event to request to quit application. */ +#define KD_EVENT_QUIT 43 + +/* KD_EVENT_PAUSE: Application pause event. */ +#define KD_EVENT_PAUSE 45 + +/* KD_EVENT_RESUME: Application resume event. */ +#define KD_EVENT_RESUME 46 + +/* KD_EVENT_ORIENTATION: Orientation change event. */ +#define KD_EVENT_ORIENTATION 48 + +/* KD_IOGROUP_EVENT: I/O group for OpenKODE Core system events implemented as state values. */ +#define KD_IOGROUP_EVENT 0x100 +#define KD_STATE_EVENT_USING_BATTERY (KD_IOGROUP_EVENT + 0) +#define KD_STATE_EVENT_LOW_BATTERY (KD_IOGROUP_EVENT + 1) + + +/* KD_IOGROUP_ORIENTATION: I/O group for OpenKODE Core orientation state. */ +#define KD_IOGROUP_ORIENTATION 0x200 +#define KD_STATE_ORIENTATION_OVERALL (KD_IOGROUP_ORIENTATION + 0) +#define KD_STATE_ORIENTATION_SCREEN (KD_IOGROUP_ORIENTATION + 1) +#define KD_STATE_ORIENTATION_RENDERING (KD_IOGROUP_ORIENTATION + 2) +#define KD_STATE_ORIENTATION_LOCKSURFACE (KD_IOGROUP_ORIENTATION + 3) + + +/******************************************************* + * Application startup and exit. + *******************************************************/ + +/* kdMain: The application-defined main function. */ +KD_API KDint KD_APIENTRY kdMain(KDint argc, const KDchar *const *argv); + +/* kdExit: Exit the application. */ +KD_API KD_NORETURN void KD_APIENTRY kdExit(KDint status); + +/******************************************************* + * Utility library functions + *******************************************************/ + +/* kdAbs: Compute the absolute value of an integer. */ +KD_API KDint KD_APIENTRY kdAbs(KDint i); + +/* kdStrtof: Convert a string to a floating point number. */ +KD_API KDfloat32 KD_APIENTRY kdStrtof(const KDchar *s, KDchar **endptr); + +/* kdStrtol, kdStrtoul: Convert a string to an integer. */ +KD_API KDint KD_APIENTRY kdStrtol(const KDchar *s, KDchar **endptr, KDint base); +KD_API KDuint KD_APIENTRY kdStrtoul(const KDchar *s, KDchar **endptr, KDint base); + +/* kdLtostr, kdUltostr: Convert an integer to a string. */ +#define KD_LTOSTR_MAXLEN ((sizeof(KDint)*8*3+6)/10+2) +#define KD_ULTOSTR_MAXLEN ((sizeof(KDint)*8+2)/3+1) +KD_API KDssize KD_APIENTRY kdLtostr(KDchar *buffer, KDsize buflen, KDint number); +KD_API KDssize KD_APIENTRY kdUltostr(KDchar *buffer, KDsize buflen, KDuint number, KDint base); + +/* kdFtostr: Convert a float to a string. */ +#define KD_FTOSTR_MAXLEN 16 +KD_API KDssize KD_APIENTRY kdFtostr(KDchar *buffer, KDsize buflen, KDfloat32 number); + +/* kdCryptoRandom: Return random data. */ +KD_API KDint KD_APIENTRY kdCryptoRandom(KDuint8 *buf, KDsize buflen); + +/******************************************************* + * Locale specific functions + *******************************************************/ + +/* kdGetLocale: Determine the current language and locale. */ +KD_API const KDchar *KD_APIENTRY kdGetLocale(void); + +/******************************************************* + * Memory allocation + *******************************************************/ + +/* kdMalloc: Allocate memory. */ +KD_API void *KD_APIENTRY kdMalloc(KDsize size); + +/* kdFree: Free allocated memory block. */ +KD_API void KD_APIENTRY kdFree(void *ptr); + +/* kdRealloc: Resize memory block. */ +KD_API void *KD_APIENTRY kdRealloc(void *ptr, KDsize size); + +/******************************************************* + * Thread-local storage. + *******************************************************/ + +/* kdGetTLS: Get the thread-local storage pointer. */ +KD_API void *KD_APIENTRY kdGetTLS(void); + +/* kdSetTLS: Set the thread-local storage pointer. */ +KD_API void KD_APIENTRY kdSetTLS(void *ptr); + +/******************************************************* + * Mathematical functions + *******************************************************/ +#define KD_E_F 2.71828175F +#define KD_PI_F 3.14159274F +#define KD_PI_2_F 1.57079637F +#define KD_2PI_F 6.28318548F +#define KD_LOG2E_F 1.44269502F +#define KD_LOG10E_F 0.434294492F +#define KD_LN2_F 0.693147182F +#define KD_LN10_F 2.30258512F +#define KD_PI_4_F 0.785398185F +#define KD_1_PI_F 0.318309873F +#define KD_2_PI_F 0.636619747F +#define KD_2_SQRTPI_F 1.12837923F +#define KD_SQRT2_F 1.41421354F +#define KD_SQRT1_2_F 0.707106769F +#define KD_FLT_EPSILON 1.19209290E-07F +#define KD_FLT_MAX 3.40282346638528860e+38F +#define KD_FLT_MIN 1.17549435e-38F +/* KD_INFINITY is defined in kdplatform.h since no portable definition + * is possible. */ +#define kdIsNan(x) (((x) != (x)) ? 1 : 0) +#define KD_HUGE_VALF KD_INFINITY +#define KD_DEG_TO_RAD_F 0.0174532924F +#define KD_RAD_TO_DEG_F 57.2957802F + +/* kdAcosf: Arc cosine function. */ +KD_API KDfloat32 KD_APIENTRY kdAcosf(KDfloat32 x); + +/* kdAsinf: Arc sine function. */ +KD_API KDfloat32 KD_APIENTRY kdAsinf(KDfloat32 x); + +/* kdAtanf: Arc tangent function. */ +KD_API KDfloat32 KD_APIENTRY kdAtanf(KDfloat32 x); + +/* kdAtan2f: Arc tangent function. */ +KD_API KDfloat32 KD_APIENTRY kdAtan2f(KDfloat32 y, KDfloat32 x); + +/* kdCosf: Cosine function. */ +KD_API KDfloat32 KD_APIENTRY kdCosf(KDfloat32 x); + +/* kdSinf: Sine function. */ +KD_API KDfloat32 KD_APIENTRY kdSinf(KDfloat32 x); + +/* kdTanf: Tangent function. */ +KD_API KDfloat32 KD_APIENTRY kdTanf(KDfloat32 x); + +/* kdExpf: Exponential function. */ +KD_API KDfloat32 KD_APIENTRY kdExpf(KDfloat32 x); + +/* kdLogf: Natural logarithm function. */ +KD_API KDfloat32 KD_APIENTRY kdLogf(KDfloat32 x); + +/* kdFabsf: Absolute value. */ +KD_API KDfloat32 KD_APIENTRY kdFabsf(KDfloat32 x); + +/* kdPowf: Power function. */ +KD_API KDfloat32 KD_APIENTRY kdPowf(KDfloat32 x, KDfloat32 y); + +/* kdSqrtf: Square root function. */ +KD_API KDfloat32 KD_APIENTRY kdSqrtf(KDfloat32 x); + +/* kdCeilf: Return ceiling value. */ +KD_API KDfloat32 KD_APIENTRY kdCeilf(KDfloat32 x); + +/* kdFloorf: Return floor value. */ +KD_API KDfloat32 KD_APIENTRY kdFloorf(KDfloat32 x); + +/* kdRoundf: Round value to nearest integer. */ +KD_API KDfloat32 KD_APIENTRY kdRoundf(KDfloat32 x); + +/* kdInvsqrtf: Inverse square root function. */ +KD_API KDfloat32 KD_APIENTRY kdInvsqrtf(KDfloat32 x); + +/* kdFmodf: Calculate floating point remainder. */ +KD_API KDfloat32 KD_APIENTRY kdFmodf(KDfloat32 x, KDfloat32 y); + +/******************************************************* + * String and memory functions + *******************************************************/ + +/* kdMemchr: Scan memory for a byte value. */ +KD_API void *KD_APIENTRY kdMemchr(const void *src, KDint byte, KDsize len); + +/* kdMemcmp: Compare two memory regions. */ +KD_API KDint KD_APIENTRY kdMemcmp(const void *src1, const void *src2, KDsize len); + +/* kdMemcpy: Copy a memory region, no overlapping. */ +KD_API void *KD_APIENTRY kdMemcpy(void *buf, const void *src, KDsize len); + +/* kdMemmove: Copy a memory region, overlapping allowed. */ +KD_API void *KD_APIENTRY kdMemmove(void *buf, const void *src, KDsize len); + +/* kdMemset: Set bytes in memory to a value. */ +KD_API void *KD_APIENTRY kdMemset(void *buf, KDint byte, KDsize len); + +/* kdStrchr: Scan string for a byte value. */ +KD_API KDchar *KD_APIENTRY kdStrchr(const KDchar *str, KDint ch); + +/* kdStrcmp: Compares two strings. */ +KD_API KDint KD_APIENTRY kdStrcmp(const KDchar *str1, const KDchar *str2); + +/* kdStrlen: Determine the length of a string. */ +KD_API KDsize KD_APIENTRY kdStrlen(const KDchar *str); + +/* kdStrnlen: Determine the length of a string. */ +KD_API KDsize KD_APIENTRY kdStrnlen(const KDchar *str, KDsize maxlen); + +/* kdStrncat_s: Concatenate two strings. */ +KD_API KDint KD_APIENTRY kdStrncat_s(KDchar *buf, KDsize buflen, const KDchar *src, KDsize srcmaxlen); + +/* kdStrncmp: Compares two strings with length limit. */ +KD_API KDint KD_APIENTRY kdStrncmp(const KDchar *str1, const KDchar *str2, KDsize maxlen); + +/* kdStrcpy_s: Copy a string with an overrun check. */ +KD_API KDint KD_APIENTRY kdStrcpy_s(KDchar *buf, KDsize buflen, const KDchar *src); + +/* kdStrncpy_s: Copy a string with an overrun check. */ +KD_API KDint KD_APIENTRY kdStrncpy_s(KDchar *buf, KDsize buflen, const KDchar *src, KDsize srclen); + +/******************************************************* + * Time functions + *******************************************************/ + +/* kdGetTimeUST: Get the current unadjusted system time. */ +KD_API KDust KD_APIENTRY kdGetTimeUST(void); + +/* kdTime: Get the current wall clock time. */ +KD_API KDtime KD_APIENTRY kdTime(KDtime *timep); + +/* kdGmtime_r, kdLocaltime_r: Convert a seconds-since-epoch time into broken-down time. */ +typedef struct KDTm { + KDint32 tm_sec; + KDint32 tm_min; + KDint32 tm_hour; + KDint32 tm_mday; + KDint32 tm_mon; + KDint32 tm_year; + KDint32 tm_wday; + KDint32 tm_yday; +} KDTm; +KD_API KDTm *KD_APIENTRY kdGmtime_r(const KDtime *timep, KDTm *result); +KD_API KDTm *KD_APIENTRY kdLocaltime_r(const KDtime *timep, KDTm *result); + +/* kdUSTAtEpoch: Get the UST corresponding to KDtime 0. */ +KD_API KDust KD_APIENTRY kdUSTAtEpoch(void); + +/******************************************************* + * Timer functions + *******************************************************/ + +/* kdSetTimer: Set timer. */ +#define KD_TIMER_ONESHOT 61 +#define KD_TIMER_PERIODIC_AVERAGE 62 +#define KD_TIMER_PERIODIC_MINIMUM 63 +typedef struct KDTimer KDTimer; +KD_API KDTimer *KD_APIENTRY kdSetTimer(KDint64 interval, KDint periodic, void *eventuserptr); + +/* kdCancelTimer: Cancel and free a timer. */ +KD_API KDint KD_APIENTRY kdCancelTimer(KDTimer *timer); + +/* KD_EVENT_TIMER: Timer fire event. */ +#define KD_EVENT_TIMER 42 + +/******************************************************* + * File system + *******************************************************/ +#define KD_EOF (-1) + +/* kdFopen: Open a file from the file system. */ +typedef struct KDFile KDFile; +KD_API KDFile *KD_APIENTRY kdFopen(const KDchar *pathname, const KDchar *mode); + +/* kdFclose: Close an open file. */ +KD_API KDint KD_APIENTRY kdFclose(KDFile *file); + +/* kdFflush: Flush an open file. */ +KD_API KDint KD_APIENTRY kdFflush(KDFile *file); + +/* kdFread: Read from a file. */ +KD_API KDsize KD_APIENTRY kdFread(void *buffer, KDsize size, KDsize count, KDFile *file); + +/* kdFwrite: Write to a file. */ +KD_API KDsize KD_APIENTRY kdFwrite(const void *buffer, KDsize size, KDsize count, KDFile *file); + +/* kdGetc: Read next byte from an open file. */ +KD_API KDint KD_APIENTRY kdGetc(KDFile *file); + +/* kdPutc: Write a byte to an open file. */ +KD_API KDint KD_APIENTRY kdPutc(KDint c, KDFile *file); + +/* kdFgets: Read a line of text from an open file. */ +KD_API KDchar *KD_APIENTRY kdFgets(KDchar *buffer, KDsize buflen, KDFile *file); + +/* kdFEOF: Check for end of file. */ +KD_API KDint KD_APIENTRY kdFEOF(KDFile *file); + +/* kdFerror: Check for an error condition on an open file. */ +KD_API KDint KD_APIENTRY kdFerror(KDFile *file); + +/* kdClearerr: Clear a file’s error and end-of-file indicators. */ +KD_API void KD_APIENTRY kdClearerr(KDFile *file); + +/* kdFseek: Reposition the file position indicator in a file. */ +typedef enum { + KD_SEEK_SET = 0, + KD_SEEK_CUR = 1, + KD_SEEK_END = 2 +} KDfileSeekOrigin; +KD_API KDint KD_APIENTRY kdFseek(KDFile *file, KDoff offset, KDfileSeekOrigin origin); + +/* kdFtell: Get the file position of an open file. */ +KD_API KDoff KD_APIENTRY kdFtell(KDFile *file); + +/* kdMkdir: Create new directory. */ +KD_API KDint KD_APIENTRY kdMkdir(const KDchar *pathname); + +/* kdRmdir: Delete a directory. */ +KD_API KDint KD_APIENTRY kdRmdir(const KDchar *pathname); + +/* kdRename: Rename a file. */ +KD_API KDint KD_APIENTRY kdRename(const KDchar *src, const KDchar *dest); + +/* kdRemove: Delete a file. */ +KD_API KDint KD_APIENTRY kdRemove(const KDchar *pathname); + +/* kdTruncate: Truncate or extend a file. */ +KD_API KDint KD_APIENTRY kdTruncate(const KDchar *pathname, KDoff length); + +/* kdStat, kdFstat: Return information about a file. */ +typedef struct KDStat { + KDmode st_mode; + KDoff st_size; + KDtime st_mtime; +} KDStat; +KD_API KDint KD_APIENTRY kdStat(const KDchar *pathname, struct KDStat *buf); +KD_API KDint KD_APIENTRY kdFstat(KDFile *file, struct KDStat *buf); +#define KD_ISREG(m) ((m) & 0x8000) +#define KD_ISDIR(m) ((m) & 0x4000) + +/* kdAccess: Determine whether the application can access a file or directory. */ +KD_API KDint KD_APIENTRY kdAccess(const KDchar *pathname, KDint amode); +#define KD_R_OK 4 +#define KD_W_OK 2 +#define KD_X_OK 1 + +/* kdOpenDir: Open a directory ready for listing. */ +typedef struct KDDir KDDir; +KD_API KDDir *KD_APIENTRY kdOpenDir(const KDchar *pathname); + +/* kdReadDir: Return the next file in a directory. */ +typedef struct KDDirent { + const KDchar *d_name; +} KDDirent; +KD_API KDDirent *KD_APIENTRY kdReadDir(KDDir *dir); + +/* kdCloseDir: Close a directory. */ +KD_API KDint KD_APIENTRY kdCloseDir(KDDir *dir); + +/* kdGetFree: Get free space on a drive. */ +KD_API KDoff KD_APIENTRY kdGetFree(const KDchar *pathname); + +/******************************************************* + * Network sockets + *******************************************************/ + +/* KDSockaddr: Struct type for socket address. */ +typedef struct KDSockaddr { + KDuint16 family; + union { +#define KD_AF_INET 70 + struct { + KDuint16 port; + KDuint32 address; + } sin; + } data; +} KDSockaddr; + +/* kdNameLookup: Look up a hostname. */ +KD_API KDint KD_APIENTRY kdNameLookup(KDint af, const KDchar *hostname, void *eventuserptr); + +/* kdNameLookupCancel: Selectively cancels ongoing kdNameLookup operations. */ +KD_API void KD_APIENTRY kdNameLookupCancel(void *eventuserptr); + +/* kdSocketCreate: Creates a socket. */ +typedef struct KDSocket KDSocket; +KD_API KDSocket *KD_APIENTRY kdSocketCreate(KDint type, void *eventuserptr); +#define KD_SOCK_TCP 64 +#define KD_SOCK_UDP 65 + +/* kdSocketClose: Closes a socket. */ +KD_API KDint KD_APIENTRY kdSocketClose(KDSocket *socket); + +/* kdSocketBind: Bind a socket. */ +KD_API KDint KD_APIENTRY kdSocketBind(KDSocket *socket, const struct KDSockaddr *addr, KDboolean reuse); +#define KD_INADDR_ANY 0 + +/* kdSocketGetName: Get the local address of a socket. */ +KD_API KDint KD_APIENTRY kdSocketGetName(KDSocket *socket, struct KDSockaddr *addr); + +/* kdSocketConnect: Connects a socket. */ +KD_API KDint KD_APIENTRY kdSocketConnect(KDSocket *socket, const KDSockaddr *addr); + +/* kdSocketListen: Listen on a socket. */ +KD_API KDint KD_APIENTRY kdSocketListen(KDSocket *socket, KDint backlog); + +/* kdSocketAccept: Accept an incoming connection. */ +KD_API KDSocket *KD_APIENTRY kdSocketAccept(KDSocket *socket, KDSockaddr *addr, void *eventuserptr); + +/* kdSocketSend, kdSocketSendTo: Send data to a socket. */ +KD_API KDint KD_APIENTRY kdSocketSend(KDSocket *socket, const void *buf, KDint len); +KD_API KDint KD_APIENTRY kdSocketSendTo(KDSocket *socket, const void *buf, KDint len, const KDSockaddr *addr); + +/* kdSocketRecv, kdSocketRecvFrom: Receive data from a socket. */ +KD_API KDint KD_APIENTRY kdSocketRecv(KDSocket *socket, void *buf, KDint len); +KD_API KDint KD_APIENTRY kdSocketRecvFrom(KDSocket *socket, void *buf, KDint len, KDSockaddr *addr); + +/* kdHtonl: Convert a 32-bit integer from host to network byte order. */ +KD_API KDuint32 KD_APIENTRY kdHtonl(KDuint32 hostlong); + +/* kdHtons: Convert a 16-bit integer from host to network byte order. */ +KD_API KDuint16 KD_APIENTRY kdHtons(KDuint16 hostshort); + +/* kdNtohl: Convert a 32-bit integer from network to host byte order. */ +KD_API KDuint32 KD_APIENTRY kdNtohl(KDuint32 netlong); + +/* kdNtohs: Convert a 16-bit integer from network to host byte order. */ +KD_API KDuint16 KD_APIENTRY kdNtohs(KDuint16 netshort); + +/* kdInetAton: Convert a “dotted quad” format address to an integer. */ +KD_API KDint KD_APIENTRY kdInetAton(const KDchar *cp, KDuint32 *inp); + +/* kdInetNtop: Convert a network address to textual form. */ +#define KD_INET_ADDRSTRLEN 16 +typedef struct KDInAddr { + KDuint32 _s_addr; /* MSVC VC9 again .. couldn't handle s_addr here */ +} KDInAddr; +KD_API const KDchar *KD_APIENTRY kdInetNtop(KDuint af, const void *src, KDchar *dst, KDsize cnt); + +/* KD_EVENT_SOCKET_READABLE: Event to indicate that a socket is readable. */ +#define KD_EVENT_SOCKET_READABLE 49 +typedef struct KDEventSocketReadable { + KDSocket *socket; +} KDEventSocketReadable; + +/* KD_EVENT_SOCKET_WRITABLE: Event to indicate that a socket is writable. */ +#define KD_EVENT_SOCKET_WRITABLE 50 +typedef struct KDEventSocketWritable { + KDSocket *socket; +} KDEventSocketWritable; + +/* KD_EVENT_SOCKET_CONNECT_COMPLETE: Event generated when a socket connect is complete */ +#define KD_EVENT_SOCKET_CONNECT_COMPLETE 51 +typedef struct KDEventSocketConnect { + KDSocket *socket; + KDint32 error; +} KDEventSocketConnect; + +/* KD_EVENT_SOCKET_INCOMING: Event generated when a listening socket detects an incoming connection or an error. */ +#define KD_EVENT_SOCKET_INCOMING 52 +typedef struct KDEventSocketIncoming { + KDSocket *socket; +} KDEventSocketIncoming; + +/* KD_EVENT_NAME_LOOKUP_COMPLETE: kdNameLookup complete event. */ +#define KD_EVENT_NAME_LOOKUP_COMPLETE 53 +typedef struct KDEventNameLookup { + KDint32 error; + KDint32 resultlen; + const KDSockaddr *result; + KDboolean more; +} KDEventNameLookup; + +/******************************************************* + * Input/output + *******************************************************/ + +/* KD_EVENT_STATE: State changed event. */ +#define KD_EVENT_STATE 55 + +typedef struct KDEventState { + KDint32 index; + union { + KDint32 i; + KDint64 l; + KDfloat32 f; + } value; +} KDEventState; + +/* KD_EVENT_INPUT: Input changed event. */ +#define KD_EVENT_INPUT 56 + +typedef struct KDEventInput { + KDint32 index; + union { + KDint32 i; + KDint64 l; + KDfloat32 f; + } value; +} KDEventInput; + +/* KD_EVENT_INPUT_JOG: Jogdial jog event. */ +#define KD_EVENT_INPUT_JOG 71 +typedef struct KDEventInputJog { + KDint32 index; + KDint32 count; +} KDEventInputJog; + +/* KD_EVENT_INPUT_POINTER: Pointer input changed event. */ +#define KD_EVENT_INPUT_POINTER 57 +typedef struct KDEventInputPointer { + KDint32 index; + KDint32 select; + KDint32 x; + KDint32 y; +} KDEventInputPointer; + +/* KD_EVENT_INPUT_STICK: Joystick stick changed event. */ +#define KD_EVENT_INPUT_STICK 58 +typedef struct KDEventInputStick { + KDint32 index; + KDint32 x; + KDint32 y; + KDint32 z; +} KDEventInputStick; + +/* kdStateGeti, kdStateGetl, kdStateGetf: get state value(s) */ +KD_API KDint KD_APIENTRY kdStateGeti(KDint startidx, KDuint numidxs, KDint32 *buffer); +KD_API KDint KD_APIENTRY kdStateGetl(KDint startidx, KDuint numidxs, KDint64 *buffer); +KD_API KDint KD_APIENTRY kdStateGetf(KDint startidx, KDuint numidxs, KDfloat32 *buffer); + +/* kdOutputSeti, kdOutputSetf: set outputs */ +KD_API KDint KD_APIENTRY kdOutputSeti(KDint startidx, KDuint numidxs, const KDint32 *buffer); +KD_API KDint KD_APIENTRY kdOutputSetf(KDint startidx, KDuint numidxs, const KDfloat32 *buffer); +#define KD_IO_CONTROLLER_STRIDE 64 + +/* KD_IOGROUP_GAMEKEYS: I/O group for game keys. */ +#define KD_IOGROUP_GAMEKEYS 0x1000 +#define KD_STATE_GAMEKEYS_AVAILABILITY (KD_IOGROUP_GAMEKEYS + 0) +#define KD_INPUT_GAMEKEYS_UP (KD_IOGROUP_GAMEKEYS + 1) +#define KD_INPUT_GAMEKEYS_LEFT (KD_IOGROUP_GAMEKEYS + 2) +#define KD_INPUT_GAMEKEYS_RIGHT (KD_IOGROUP_GAMEKEYS + 3) +#define KD_INPUT_GAMEKEYS_DOWN (KD_IOGROUP_GAMEKEYS + 4) +#define KD_INPUT_GAMEKEYS_FIRE (KD_IOGROUP_GAMEKEYS + 5) +#define KD_INPUT_GAMEKEYS_A (KD_IOGROUP_GAMEKEYS + 6) +#define KD_INPUT_GAMEKEYS_B (KD_IOGROUP_GAMEKEYS + 7) +#define KD_INPUT_GAMEKEYS_C (KD_IOGROUP_GAMEKEYS + 8) +#define KD_INPUT_GAMEKEYS_D (KD_IOGROUP_GAMEKEYS + 9) + +/* KD_IOGROUP_GAMEKEYSNC: I/O group for game keys, no chording. */ +#define KD_IOGROUP_GAMEKEYSNC 0x1100 +#define KD_STATE_GAMEKEYSNC_AVAILABILITY (KD_IOGROUP_GAMEKEYSNC + 0) +#define KD_INPUT_GAMEKEYSNC_UP (KD_IOGROUP_GAMEKEYSNC + 1) +#define KD_INPUT_GAMEKEYSNC_LEFT (KD_IOGROUP_GAMEKEYSNC + 2) +#define KD_INPUT_GAMEKEYSNC_RIGHT (KD_IOGROUP_GAMEKEYSNC + 3) +#define KD_INPUT_GAMEKEYSNC_DOWN (KD_IOGROUP_GAMEKEYSNC + 4) +#define KD_INPUT_GAMEKEYSNC_FIRE (KD_IOGROUP_GAMEKEYSNC + 5) +#define KD_INPUT_GAMEKEYSNC_A (KD_IOGROUP_GAMEKEYSNC + 6) +#define KD_INPUT_GAMEKEYSNC_B (KD_IOGROUP_GAMEKEYSNC + 7) +#define KD_INPUT_GAMEKEYSNC_C (KD_IOGROUP_GAMEKEYSNC + 8) +#define KD_INPUT_GAMEKEYSNC_D (KD_IOGROUP_GAMEKEYSNC + 9) + +/* KD_IOGROUP_PHONEKEYPAD: I/O group for phone keypad. */ +#define KD_IOGROUP_PHONEKEYPAD 0x2000 +#define KD_STATE_PHONEKEYPAD_AVAILABILITY (KD_IOGROUP_PHONEKEYPAD + 0) +#define KD_INPUT_PHONEKEYPAD_0 (KD_IOGROUP_PHONEKEYPAD + 1) +#define KD_INPUT_PHONEKEYPAD_1 (KD_IOGROUP_PHONEKEYPAD + 2) +#define KD_INPUT_PHONEKEYPAD_2 (KD_IOGROUP_PHONEKEYPAD + 3) +#define KD_INPUT_PHONEKEYPAD_3 (KD_IOGROUP_PHONEKEYPAD + 4) +#define KD_INPUT_PHONEKEYPAD_4 (KD_IOGROUP_PHONEKEYPAD + 5) +#define KD_INPUT_PHONEKEYPAD_5 (KD_IOGROUP_PHONEKEYPAD + 6) +#define KD_INPUT_PHONEKEYPAD_6 (KD_IOGROUP_PHONEKEYPAD + 7) +#define KD_INPUT_PHONEKEYPAD_7 (KD_IOGROUP_PHONEKEYPAD + 8) +#define KD_INPUT_PHONEKEYPAD_8 (KD_IOGROUP_PHONEKEYPAD + 9) +#define KD_INPUT_PHONEKEYPAD_9 (KD_IOGROUP_PHONEKEYPAD + 10) +#define KD_INPUT_PHONEKEYPAD_STAR (KD_IOGROUP_PHONEKEYPAD + 11) +#define KD_INPUT_PHONEKEYPAD_HASH (KD_IOGROUP_PHONEKEYPAD + 12) +#define KD_INPUT_PHONEKEYPAD_LEFTSOFT (KD_IOGROUP_PHONEKEYPAD + 13) +#define KD_INPUT_PHONEKEYPAD_RIGHTSOFT (KD_IOGROUP_PHONEKEYPAD + 14) +#define KD_STATE_PHONEKEYPAD_ORIENTATION (KD_IOGROUP_PHONEKEYPAD + 15) + +/* KD_IOGROUP_VIBRATE: I/O group for vibrate. */ +#define KD_IOGROUP_VIBRATE 0x3000 +#define KD_STATE_VIBRATE_AVAILABILITY (KD_IOGROUP_VIBRATE + 0) +#define KD_STATE_VIBRATE_MINFREQUENCY (KD_IOGROUP_VIBRATE + 1) +#define KD_STATE_VIBRATE_MAXFREQUENCY (KD_IOGROUP_VIBRATE + 2) +#define KD_OUTPUT_VIBRATE_VOLUME (KD_IOGROUP_VIBRATE + 3) +#define KD_OUTPUT_VIBRATE_FREQUENCY (KD_IOGROUP_VIBRATE + 4) + +/* KD_IOGROUP_POINTER: I/O group for pointer. */ +#define KD_IOGROUP_POINTER 0x4000 +#define KD_STATE_POINTER_AVAILABILITY (KD_IOGROUP_POINTER + 0) +#define KD_INPUT_POINTER_X (KD_IOGROUP_POINTER + 1) +#define KD_INPUT_POINTER_Y (KD_IOGROUP_POINTER + 2) +#define KD_INPUT_POINTER_SELECT (KD_IOGROUP_POINTER + 3) + +/* KD_IOGROUP_BACKLIGHT: I/O group for backlight. */ +#define KD_IOGROUP_BACKLIGHT 0x5000 +#define KD_STATE_BACKLIGHT_AVAILABILITY (KD_IOGROUP_BACKLIGHT + 0) +#define KD_OUTPUT_BACKLIGHT_FORCE (KD_IOGROUP_BACKLIGHT + 1) + +/* KD_IOGROUP_JOGDIAL: I/O group for a jog dial. */ +#define KD_IOGROUP_JOGDIAL 0x6000 +#define KD_STATE_JOGDIAL_AVAILABILITY (KD_IOGROUP_JOGDIAL + 0) +#define KD_INPUT_JOGDIAL_UP (KD_IOGROUP_JOGDIAL + 1) +#define KD_INPUT_JOGDIAL_LEFT (KD_IOGROUP_JOGDIAL + 2) +#define KD_INPUT_JOGDIAL_RIGHT (KD_IOGROUP_JOGDIAL + 3) +#define KD_INPUT_JOGDIAL_DOWN (KD_IOGROUP_JOGDIAL + 4) +#define KD_INPUT_JOGDIAL_SELECT (KD_IOGROUP_JOGDIAL + 5) + +/* KD_IOGROUP_STICK: I/O group for joystick. */ +#define KD_IOGROUP_STICK 0x7000 +#define KD_STATE_STICK_AVAILABILITY (KD_IOGROUP_STICK + 0) +#define KD_INPUT_STICK_X (KD_IOGROUP_STICK + 1) +#define KD_INPUT_STICK_Y (KD_IOGROUP_STICK + 2) +#define KD_INPUT_STICK_Z (KD_IOGROUP_STICK + 3) +#define KD_INPUT_STICK_BUTTON (KD_IOGROUP_STICK + 4) +#define KD_IO_STICK_STRIDE 8 + +/* KD_IOGROUP_DPAD: I/O group for D-pad. */ +#define KD_IOGROUP_DPAD 0x8000 +#define KD_STATE_DPAD_AVAILABILITY (KD_IOGROUP_DPAD + 0) +#define KD_STATE_DPAD_COPY (KD_IOGROUP_DPAD + 1) +#define KD_INPUT_DPAD_UP (KD_IOGROUP_DPAD + 2) +#define KD_INPUT_DPAD_LEFT (KD_IOGROUP_DPAD + 3) +#define KD_INPUT_DPAD_RIGHT (KD_IOGROUP_DPAD + 4) +#define KD_INPUT_DPAD_DOWN (KD_IOGROUP_DPAD + 5) +#define KD_INPUT_DPAD_SELECT (KD_IOGROUP_DPAD + 6) +#define KD_IO_DPAD_STRIDE 8 + +/* KD_IOGROUP_BUTTONS: I/O group for buttons associated with joystick or D-pad. */ +#define KD_IOGROUP_BUTTONS 0x9000 +#define KD_STATE_BUTTONS_AVAILABILITY (KD_IOGROUP_BUTTONS + 0) +#define KD_INPUT_BUTTONS_0 (KD_IOGROUP_BUTTONS + 1) + +/* KD_IO_UNDEFINED: I/O items reserved for implementation-dependent use. */ +#define KD_IO_UNDEFINED 0x40000000 + +/******************************************************* + * Windowing + *******************************************************/ +#ifdef KD_WINDOW_SUPPORTED +#include <EGL/egl.h> +typedef struct KDWindow KDWindow; + +/* kdCreateWindow: Create a window. */ +KD_API KDWindow *KD_APIENTRY kdCreateWindow(EGLDisplay display, EGLConfig config, void *eventuserptr); + +/* kdDestroyWindow: Destroy a window. */ +KD_API KDint KD_APIENTRY kdDestroyWindow(KDWindow *window); + +/* kdSetWindowPropertybv, kdSetWindowPropertyiv, kdSetWindowPropertycv: Set a window property to request a change in the on-screen representation of the window. */ +KD_API KDint KD_APIENTRY kdSetWindowPropertybv(KDWindow *window, KDint pname, const KDboolean *param); +KD_API KDint KD_APIENTRY kdSetWindowPropertyiv(KDWindow *window, KDint pname, const KDint32 *param); +KD_API KDint KD_APIENTRY kdSetWindowPropertycv(KDWindow *window, KDint pname, const KDchar *param); + +/* kdGetWindowPropertybv, kdGetWindowPropertyiv, kdGetWindowPropertycv: Get the current value of a window property. */ +KD_API KDint KD_APIENTRY kdGetWindowPropertybv(KDWindow *window, KDint pname, KDboolean *param); +KD_API KDint KD_APIENTRY kdGetWindowPropertyiv(KDWindow *window, KDint pname, KDint32 *param); +KD_API KDint KD_APIENTRY kdGetWindowPropertycv(KDWindow *window, KDint pname, KDchar *param, KDsize *size); + +/* kdRealizeWindow: Realize the window as a displayable entity and get the native window handle for passing to EGL. */ +KD_API KDint KD_APIENTRY kdRealizeWindow(KDWindow *window, EGLNativeWindowType *nativewindow); + +/* KD_WINDOWPROPERTY_SIZE: Window client area width and height. */ +#define KD_WINDOWPROPERTY_SIZE 66 + +/* KD_WINDOWPROPERTY_VISIBILITY: Window visibility status. */ +#define KD_WINDOWPROPERTY_VISIBILITY 67 + +/* KD_WINDOWPROPERTY_FOCUS: Window input focus status. */ +#define KD_WINDOWPROPERTY_FOCUS 68 + +/* KD_WINDOWPROPERTY_CAPTION: Window caption. */ +#define KD_WINDOWPROPERTY_CAPTION 69 + +/* KD_EVENT_WINDOW_CLOSE: Event to request to close window. */ +#define KD_EVENT_WINDOW_CLOSE 44 + +/* KD_EVENT_WINDOWPROPERTY_CHANGE: Notification about realized window property change. */ +#define KD_EVENT_WINDOWPROPERTY_CHANGE 47 +typedef struct KDEventWindowProperty { + KDint32 pname; +} KDEventWindowProperty; + +/* KD_EVENT_WINDOW_FOCUS: Event for change of window’s focus state. */ +#define KD_EVENT_WINDOW_FOCUS 60 +typedef struct KDEventWindowFocus { + KDint32 focusstate; +} KDEventWindowFocus; + +/* KD_EVENT_WINDOW_REDRAW: Event to notify need to redraw the window. */ +#define KD_EVENT_WINDOW_REDRAW 59 +#endif /* KD_WINDOW_SUPPORTED */ + +/******************************************************* + * Assertions and logging + *******************************************************/ + +/* kdHandleAssertion: Handle assertion failure. */ +KD_API void KD_APIENTRY kdHandleAssertion(const KDchar *condition, const KDchar *filename, KDint linenumber); + +/* kdLogMessage: Output a log message. */ +#ifdef KD_NDEBUG +#define kdLogMessage(s) +#else +KD_API void KD_APIENTRY kdLogMessage(const KDchar *string); +#endif + +/* struct KDEvent delayed to the end as it uses event data structs from + * other parts of the .h file. */ +struct KDEvent { + KDust timestamp; + KDint32 type; + void *userptr; + union KDEventData { + KDEventState state; + KDEventInput input; + KDEventInputJog inputjog; + KDEventInputPointer inputpointer; + KDEventInputStick inputstick; + KDEventSocketReadable socketreadable; + KDEventSocketWritable socketwritable; + KDEventSocketConnect socketconnect; + KDEventSocketIncoming socketincoming; + KDEventNameLookup namelookup; +#ifdef KD_WINDOW_SUPPORTED + KDEventWindowProperty windowproperty; + KDEventWindowFocus windowfocus; +#endif /* KD_WINDOW_SUPPORTED */ + KDEventUser user; + } data; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __kd_h_ */ + diff --git a/make/stub_includes/egl/KD/kdplatform.h b/make/stub_includes/egl/KD/kdplatform.h new file mode 100755 index 000000000..5e3ebebdf --- /dev/null +++ b/make/stub_includes/egl/KD/kdplatform.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +/* +* Copyright (c) 2007 The Khronos Group Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject +* to the following conditions: +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* +*/ + + +/* NVIDIA KD/kdplatform.h for OpenKODE Core 1.0 Final candidate (draft 5070) */ + +#ifndef __kdplatform_h_ +#define __kdplatform_h_ + +#define KD_API +#define KD_APIENTRY + +typedef int KDint32; +typedef unsigned int KDuint32; +#if defined(_MSC_VER) +typedef signed __int64 KDint64; +typedef unsigned __int64 KDuint64; +#else +typedef long long KDint64; +typedef unsigned long long KDuint64; +#endif +typedef short KDint16; +typedef unsigned short KDuint16; +typedef unsigned long KDuintptr; +typedef unsigned long KDsize; +typedef long KDssize; +#define KDINT_MIN (-0x7fffffff-1) +#define KDINT_MAX 0x7fffffff +#define KDUINT_MAX 0xffffffffU +#define KDINT64_MIN (-0x7fffffffffffffffLL-1) +#define KDINT64_MAX 0x7fffffffffffffffLL +#define KDUINT64_MAX 0xffffffffffffffffULL +#define KDSIZE_MAX (~(unsigned long)0) +#define KDSSIZE_MAX ((long)KDSIZE_MAX/2) +#define KDSSIZE_MIN (-1 - KDSSIZE_MAX) +#define KDUINTPTR_MAX KDSIZE_MAX +#define KD_NORETURN +#define KD_WINDOW_SUPPORTED +#ifdef KD_NDEBUG +#define kdAssert(c) +#else +#define kdAssert(c) ((void)( (c) ? 0 : (kdHandleAssertion(#c, __FILE__, __LINE__), 0))) +#endif + +#define KD_INFINITY_BITS 0x7f800000u +#define KD_NEGATIVE_ZERO_BITS 0x80000000u +#define KD_INFINITY (kdBitsToFloatNV(KD_INFINITY_BITS)) +#define KD_NEGATIVE_ZERO (kdBitsToFloatNV(KD_NEGATIVE_ZERO_BITS)) + +KD_API float KD_APIENTRY kdBitsToFloatNV(KDuint32 x); + +#endif /* __kdplatform_h_ */ + diff --git a/make/stub_includes/egl/window-system-ext.c b/make/stub_includes/egl/window-system-ext.c new file mode 100755 index 000000000..7398847ac --- /dev/null +++ b/make/stub_includes/egl/window-system-ext.c @@ -0,0 +1,7 @@ +#define USE_GLUEGEN + +// Define EGL_EGLEXT_PROTOTYPES so that the EGL extension prototypes in +// "eglext.h" are parsed. +#define EGL_EGLEXT_PROTOTYPES + +#include <EGL/eglext.h> diff --git a/make/stub_includes/egl/window-system.c b/make/stub_includes/egl/window-system.c new file mode 100755 index 000000000..fbd0f0cde --- /dev/null +++ b/make/stub_includes/egl/window-system.c @@ -0,0 +1,2 @@ +#define USE_GLUEGEN +#include <EGL/egl.h> |