sl@0: // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // sl@0: // Permission is hereby granted, free of charge, to any person obtaining a sl@0: // copy of this software and/or associated documentation files (the sl@0: // "Materials"), to deal in the Materials without restriction, including sl@0: // without limitation the rights to use, copy, modify, merge, publish, sl@0: // distribute, sublicense, and/or sell copies of the Materials, and to sl@0: // permit persons to whom the Materials are furnished to do so, subject to sl@0: // the following conditions: sl@0: // sl@0: // The above copyright notice and this permission notice shall be included sl@0: // in all copies or substantial portions of the Materials. sl@0: // sl@0: // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, sl@0: // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF sl@0: // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. sl@0: // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY sl@0: // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, sl@0: // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE sl@0: // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. sl@0: // sl@0: // Description: sl@0: // Tables of OpenWF-C strings and extensions, plus access for EGL. sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "owfextensions.h" sl@0: #include "owftypes.h" sl@0: sl@0: /*! sl@0: * Vendor, renderer and version strings sl@0: */ sl@0: const char* wfc_strings[] = sl@0: { sl@0: "Nokia", sl@0: "Sample Implementation", sl@0: "1.0", sl@0: }; sl@0: sl@0: /* sl@0: * Table of extensions supported, terminated by a NULL. sl@0: */ sl@0: const char *wfc_extensions[] = sl@0: { sl@0: NULL sl@0: }; sl@0: sl@0: #ifdef __cplusplus sl@0: typedef void (*OWFExtensionFunction)(...); sl@0: #else sl@0: typedef void (*OWFExtensionFunction)(); sl@0: #endif sl@0: sl@0: typedef struct OWFExtension_tag sl@0: { sl@0: const char *name; sl@0: OWFExtensionFunction function; sl@0: } OWFExtension; sl@0: sl@0: /* sl@0: * Table of extension function name/pointer pairs, terminated with a NULL name sl@0: * pair (pointer not used for terminating entry). sl@0: */ sl@0: static OWFExtension OWF_ExtensionFunctionTable[] = sl@0: { sl@0: { NULL, NULL } sl@0: }; sl@0: sl@0: OWF_API_CALL OWFExtensionFunction sl@0: owfGetProcAddress(const char *procName) sl@0: { sl@0: WFCint ii; sl@0: sl@0: if (!procName) sl@0: { sl@0: return NULL; sl@0: } sl@0: sl@0: for (ii=0; OWF_ExtensionFunctionTable[ii].name != NULL; ii++) sl@0: { sl@0: if (strcmp(procName, OWF_ExtensionFunctionTable[ii].name)==0) sl@0: { sl@0: return OWF_ExtensionFunctionTable[ii].function; sl@0: } sl@0: } sl@0: sl@0: return NULL; sl@0: } sl@0: sl@0: /* sl@0: * eglGetProcAddress uses export 1 (implemented as GetExtensionFunctionTable) to sl@0: * fill in a function pointer table. The first entry is the function that looks up sl@0: * a function pointer for a given name. Other entries could be added in the sl@0: * future if coordinated with the EGL implementation. sl@0: */ sl@0: sl@0: typedef struct sl@0: { sl@0: OWFExtensionFunction (*owfGetProcAddressFn) (const char* procname); sl@0: } owfCFunctions; sl@0: sl@0: extern "C" WFC_API_CALL void WFC_APIENTRY sl@0: GetExtensionFunctionTable(owfCFunctions* fnTable) WFC_APIEXIT sl@0: { sl@0: fnTable->owfGetProcAddressFn = owfGetProcAddress; sl@0: }